Yep verified and not misleading at all
stage("Run tests")
{
steps {
echo "Running tests"
script {
try {
errorCode = bat( label: '', returnStdout: true, script: """
call C:\\Users\\fihle\\Anaconda3\\condabin\\conda.bat activate pytests
call python -m pip install pytest
call python -m pytest %WORKSPACE%
IF NOT %ERRORLEVEL% == 0 (
echo "ABORT: " %ERRORLEVEL%
exit /b %ERRORLEVEL%
)
""")
}
catch (e)
{
error("Tests didn't finish successfully: ${e}")
}
}
}
}
Resolves the issue