Skip to content
This repository has been archived by the owner on Oct 22, 2020. It is now read-only.

Commit

Permalink
Enable browser tests (#1273)
Browse files Browse the repository at this point in the history
* running browser tests on their own

* Rejig Jenkinsfile

* mods after GS suggestion

* Another jenkinsfile
  • Loading branch information
hem-brahmbhatt authored and diversemix committed Jan 10, 2019
1 parent 083da83 commit 9d0f112
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions Jenkinsfile
Expand Up @@ -26,15 +26,6 @@ elifePipeline {
sh "IMAGE_TAG=${commit} docker-compose -f docker-compose.yml -f docker-compose.ci.yml run --rm --name elife-xpub_app_test app npm test"
}, 'test', commit)
},
'test:browser': {
try {
withCommitStatus({
sh "echo Disabled browser tests"
}, 'test:browser', commit)
} finally {
archiveArtifacts artifacts: "build/screenshots/*", allowEmptyArchive: true
}
},
'test:dependencies': {
withCommitStatus({
sh "IMAGE_TAG=${commit} docker-compose -f docker-compose.yml -f docker-compose.ci.yml run --rm --name elife-xpub_app_test_dependencies app npm run test:dependencies"
Expand Down Expand Up @@ -79,6 +70,18 @@ elifePipeline {
}
}

stage 'Browser Tests', {
try {
sh "IMAGE_TAG=${commit} docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d postgres"
sh "IMAGE_TAG=${commit} docker-compose -f docker-compose.yml -f docker-compose.ci.yml run --rm --name elife-xpub_wait_postgres app bash -c './scripts/wait-for-it.sh postgres:5432'"
withCommitStatus({
sh "IMAGE_TAG=${commit} NODE_ENV=production NODE_CONFIG_ENV=test PGDATABASE=test_browser docker-compose -f docker-compose.yml -f docker-compose.ci.yml run -p 10081:10081 --rm --name elife-xpub_app_test_browser app bash -c 'socat -d tcp-listen:10081,reuseaddr,fork tcp:localhost:10080 & npm run test:browser -- --screenshots /tmp/screenshots --screenshots-on-fails'"
}, 'test:browser', commit)
} finally {
sh "IMAGE_TAG=${commit} docker-compose -f docker-compose.yml -f docker-compose.ci.yml down -v"
}
}

stage 'Push image', {
sh "docker push elifesciences/elife-xpub:${commit}"
elifeMainlineOnly {
Expand Down

0 comments on commit 9d0f112

Please sign in to comment.