diff --git a/Jenkinsfile b/Jenkinsfile index f04d7306..30f698de 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,5 @@ +def testBuildBadge = addEmbeddableBadgeConfiguration(id: "teststatus", subject: "Selenium Tests") + pipeline { agent any options { @@ -41,9 +43,13 @@ pipeline { } stage ('Run Tests') { steps { - withCredentials(bindings: [string(credentialsId: 'tinyMCE_key', variable: 'TINYMCEKEY')]) { - sh 'sed -i "s/my-api-key/${TINYMCEKEY}/g" $WORKSPACE/$PROJECT_DIR/ui/config/environment.js' - } + testBuildBadge.setStatus('running') + testBuildBadge.setColor('blue') + try + { + withCredentials(bindings: [string(credentialsId: 'tinyMCE_key', variable: 'TINYMCEKEY')]) + { sh 'sed -i "s/my-api-key/${TINYMCEKEY}/g" $WORKSPACE/$PROJECT_DIR/ui/config/environment.js' } + echo 'Create docker containers...' sh ''' cd $WORKSPACE/$PROJECT_DIR @@ -55,6 +61,14 @@ pipeline { while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8000/ui/auth/login)" != "200" ]]; do if [[ "$(docker ps | grep agora | wc -l)" != "2" ]]; then exit 1; fi; sleep 5; done pipenv run pytest agora_unit_tests.py -o junit_family=xunit2 --junitxml=reports/junit.xml ''' + testBuildBadge.setStatus('passing') + testBuildBadge.setColor('brightgreen') + } + catch (Exception err) + { + testBuildBadge.setStatus('failing') + testBuildBadge.setColor('red') + } } post { always { diff --git a/README.md b/README.md index 5ea54ae2..220cd08b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Agora [![Build Status](https://jenkins.einfra.grnet.gr/job/AGORA/job/master/badge/icon)](https://jenkins.einfra.grnet.gr/job/AGORA/job/master/) +[![Selenium Tests](https://jenkins.einfra.grnet.gr/job/AGORA/job/devel/badge/icon?config=teststatus)](https://jenkins.einfra.grnet.gr/job/AGORA/job/devel/) The service portfolio management tool is a tool that allows a company / project to manage the portfolio of services they to maintain (offered to users / customers or internal). Agora provides an intuitive user interface which allows users to create/edit/update/delete their services and components. Users can login with credentials provided by the administrator, or use the shibboleth login functionality to login with their academic account.