-
Notifications
You must be signed in to change notification settings - Fork 31
Move integration testing into a separate Docker image #123
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
Changes from all commits
505c117
43e50e0
24934c1
c8bd6ae
87af37a
98561b4
4b904ba
d0d8384
15a31f8
12e7575
dbcc803
5aabdf5
a030a54
388d459
7ae5347
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| version: '3' | ||
| services: | ||
| whyis-demo: | ||
| container_name: "whyis-demo" | ||
| image: ${WHYIS_DEMO_IMAGE:-tetherlessworld/whyis-demo:latest} | ||
| whyis-integration: | ||
| container_name: "whyis-integration" | ||
| build: | ||
| context: ../../.. | ||
| dockerfile: docker/image/whyis-integration/Dockerfile | ||
| depends_on: | ||
| - whyis-demo | ||
| links: | ||
| - whyis-demo:whyis | ||
| image: tetherlessworld/whyis-integration:latest | ||
| command: /docker-entrypoint.sh |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # For running CI purposes | ||
| FROM cypress/included:3.2.0 | ||
|
|
||
| COPY docker/image/whyis-integration/docker-entrypoint.sh / | ||
| COPY docker/image/whyis-integration/cypress.json /integration/ | ||
| COPY tests/integration/cypress /integration/cypress | ||
| WORKDIR /integration | ||
|
|
||
| ENTRYPOINT ["bash"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "baseUrl": "http://whyis", | ||
| "reporter": "junit", | ||
| "reporterOptions": { | ||
| "mochaFile": "results/results-[hash].xml", | ||
| "toConsole": false | ||
| }, | ||
| "screenshotsFolder": "results/screenshots", | ||
| "videosFolder": "results/videos" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #!/bin/bash | ||
| CYPRESS_baseUrl=http://whyis | ||
|
|
||
| curl --retry 5 --retry-connrefused http://whyis > /dev/null | ||
| cypress run --spec cypress/integration/whyis/**/* | ||
| tar cf test-results-js.tar results |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| { | ||
| "baseUrl": "http://localhost:5000" | ||
| "baseUrl": "http://localhost:5000", | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Create a custom cypress.json for CI and copy it in to the Cypress image (or put it in .circleci/) rather than replacing the tests/integration/cypress.json, which should be runnable locally by default and print to stdout.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even with the reporter options, Cypress will show the non-xml output, but I'll move the changes to a different file. |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Results probably aren't available yet, here. Need to loop until the file exists or some time has elapsed.
See e.g., the curl + sleep loops I've done before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the impression that docker-compose should block until the tests are over, which by then, results should exist.
tardoesn't seem to complain on CircleCI, so I thought the result tar should be there.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I don't think that's the case. Tar generally doesn't complain if you pass it nothing.