Skip to content

Commit

Permalink
ci: correctly clean up server process after e2e tests (#1666)
Browse files Browse the repository at this point in the history
* use TERM signal to kill server on exit

using KILL does not actually kill all child processes of `yarn start`

* fail build on e2e failure
  • Loading branch information
a-b-r-o-w-n authored Nov 26, 2019
1 parent 3609b4e commit f492bef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Composer/scripts/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ yarn start &
SERVER_PID=$!

npx cypress run --browser chrome
EXIT_CODE=$?
cleanup

function cleanup {
kill -9 $SERVER_PID
kill $SERVER_PID
}

# kill server process
trap cleanup EXIT

exit $EXIT_CODE
3 changes: 1 addition & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ jobs:
- script: ./scripts/e2e.sh
displayName: Run E2E Tests
workingDirectory: Composer
continueOnError: true
env:
# CYPRESS_RECORD_KEY: $(CYPRESS_RECORD_KEY)
CYPRESS_VIDEO: true
Expand All @@ -55,7 +54,7 @@ jobs:
TERM: xterm
COMPOSER_BOTS_FOLDER: $(Pipeline.Workspace)/Composer/TestBots
- task: PublishPipelineArtifact@1
condition: in(variables['Agent.JobStatus'], 'SucceededWithIssues', 'Failed')
condition: failed()
continueOnError: true
inputs:
targetPath: $(Build.ArtifactStagingDirectory)/cypress
Expand Down

0 comments on commit f492bef

Please sign in to comment.