added xUnit Tests
Some checks failed
csharp-secdevops-pipeline-pod/pipeline/head There was a failure building this commit
Some checks failed
csharp-secdevops-pipeline-pod/pipeline/head There was a failure building this commit
This commit is contained in:
8
Jenkinsfile
vendored
8
Jenkinsfile
vendored
@@ -38,8 +38,8 @@ pipeline {
|
||||
stage('Unit Tests') {
|
||||
steps {
|
||||
container('dotnet8') {
|
||||
// Führt alle Tests im Solution-Verzeichnis aus
|
||||
sh 'dotnet test --no-build --configuration Release'
|
||||
// Erstellt eine XML-Datei im Format 'junit', die Jenkins lesen kann
|
||||
sh 'dotnet test --no-build --configuration Release --logger "junit;LogFileName=results.xml;MethodDisplay=ClassAndMethod"'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,6 +56,10 @@ pipeline {
|
||||
|
||||
post {
|
||||
always {
|
||||
// Sammelt die Testergebnisse ein (die wir im Test-Schritt erzeugen)
|
||||
// Das **/ bedeutet: Suche in allen Unterordnern nach .xml Dateien
|
||||
junit testResults: '**/TestResults/*.xml', allowEmptyResults: true
|
||||
|
||||
// Meldet den Status zurück, wenn das Gitea-Plugin korrekt konfiguriert ist
|
||||
echo "Pipeline beendet: ${currentBuild.result}"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user