diff --git a/jobs/templates/includes/stage-cypress-tests.groovy.j2 b/jobs/templates/includes/stage-cypress-tests.groovy.j2 index 41ed980..47cb2f7 100644 --- a/jobs/templates/includes/stage-cypress-tests.groovy.j2 +++ b/jobs/templates/includes/stage-cypress-tests.groovy.j2 @@ -1,71 +1,72 @@ stage('Cypress tests') { {% filter indent(width=2) %} {%- include 'includes/agent-docker-cypress.groovy.j2' -%} {% endfilter %} stages { stage ('Setup cypress environment') { steps { sh ''' python3 -m pip install --no-use-pep517 --user -e .[testing] yarn install --frozen-lockfile yarn build-dev ''' } } stage ('Run cypress tests') { steps { sh '''#!/bin/bash export PYTHONPATH=$PWD python3 swh/web/manage.py migrate --settings=swh.web.settings.tests python3 swh/web/manage.py createcachetable --settings=swh.web.settings.tests cat swh/web/tests/create_test_admin.py | python3 swh/web/manage.py shell --settings=swh.web.settings.tests python3 swh/web/manage.py runserver --nostatic --settings=swh.web.settings.tests & wait-for-it localhost:5004 yarn run cypress run --config numTestsKeptInMemory=0 ''' } post { always { junit( allowEmptyResults: true, testResults: 'cypress/junit/results/*.xml', ) sh ''' yarn run mochawesome || true yarn run nyc report --reporter=lcov || true yarn run nyc report --reporter=cobertura || true + rm -rf node_modules ''' publishHTML (target: [ allowMissing: true, alwaysLinkToLastBuild: false, keepAll: true, reportDir: 'cypress/mochawesome/report', reportFiles: 'mochawesome.html', includes: 'assets/**/*', reportName: "Mochawesome Tests Report" ]) publishHTML (target: [ allowMissing: true, alwaysLinkToLastBuild: false, keepAll: true, reportDir: 'cypress/coverage/lcov-report', reportFiles: 'index.html', reportName: "Istanbul Code Coverage" ]) publishCoverage( adapters: [ coberturaAdapter(path: 'cypress/coverage/cobertura-coverage.xml'), ], tag: 'cypress', ) } } } } }