Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: correctly clean up server process after e2e tests #1666

Merged
merged 3 commits into from
Nov 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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