Basic NUnit Example
Below is a basic workflow for executing a NUnit tests in a git repository. You can paste this directly into the YAML of an existing or new test, just make
sure to update the name
and namespace
for your environment as needed.
- the
spec.steps
property defines the NUnit execution together with arguments to generate JUnit-compatible NUnit reports.
NUnit Workflow
kind: TestWorkflow
apiVersion: testworkflows.testkube.io/v1
metadata:
name: nunit-sample
namespace: testkube
spec:
content:
git:
uri: https://github.com/kubeshop/testkube
revision: main
paths:
- test/nunit/nunit-project/ExampleProject
container:
workingDir: /data/repo/test/nunit/nunit-project/ExampleProject
image: bitnami/dotnet-sdk:8-debian-12
resources:
requests:
cpu: 512m
memory: 512Mi
steps:
- name: Run tests
shell: dotnet test --logger:"junit;LogFilePath=nunit-report/nunit-junit-report.xml"
artifacts:
paths:
- nunit-report/*
After execution, you can see the output from the executions under the executions panel tabs:
- Log Output
- JUnit Report
The log output from the NUnit execution:
The JUnit Report from the NUnit execution: