diff --git a/kea_testing.groovy b/kea_testing.groovy index d8f8054..b247cb3 100644 --- a/kea_testing.groovy +++ b/kea_testing.groovy @@ -46,10 +46,22 @@ pipeline { stage('Run tests') { steps { script { - - echo 'Run any necessary test' + echo '*************' + echo '*** TESTS ***' + echo '*************' /* Here do your tests */ - + sleep 50 + try { + String testName = "1. Check that app is running - 200 response code" + String url = "http://kea.curex-project.eu/" + String responseCode = sh(label: testName, script: "curl -m 10 -sLI -w '%{http_code}' $url -o /dev/null", returnStdout: true) + if (responseCode != '200') { + error("$testName: Returned status code = $responseCode when calling $url") + } + } catch (ignored) { + currentBuild.result = 'FAILURE' + echo "KEA Deployment Tests failed" + } } } }