Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jay-johnson/d9163509517eee84834d49c93144f05d to your computer and use it in GitHub Desktop.
Save jay-johnson/d9163509517eee84834d49c93144f05d to your computer and use it in GitHub Desktop.
Determine Test Results - Do the results == expected results?
// Now validate the results match the expected results
stage "Test(${test_num}) - Validate Results"
test_results = readFile '/tmp/test_results'
echo "Test(${test_num}) Results($test_results) == Expected(${expected_results})"
sh "if [ \"${test_results}\" != \"${expected_results}\" ]; then echo \" --------------------- Test(${test_num}) Failed--------------------\"; echo \" - Test(${test_num}) Failed\"; echo \" - Test(${test_num}) Failed\";exit 1; else echo \" - Test(${test_num}) Passed\"; exit 0; fi"
echo "Done Running Test(${test_num})"
// cleanup after the test run
sh "rm -f /tmp/test_results"
currentBuild.result = 'SUCCESS'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment