-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fix tests #472
Merged
+95
−224
Merged
Fix tests #472
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
133a46c
Improve unit test workflow file
Splines 02eae65
fix tests
henrixapp a8589b3
pass in token
henrixapp 2fb8fbb
right bind
henrixapp 234676a
upgrade ruby for linter
henrixapp 9808094
Remove empty test suites, fix css selector based tests
henrixapp 36d856d
Merge test jobs to reuse cache.
henrixapp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- mampf-next | ||
- production | ||
- experimental | ||
pull_request: | ||
|
||
jobs: | ||
unit-test-job: | ||
name: Execute unit tests & upload to Codecov | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Pull docker images | ||
run: docker compose pull --ignore-buildable | ||
working-directory: docker/run_cypress_tests | ||
|
||
- name: Use Docker layer caching # https://github.com/jpribyl/action-docker-layer-caching | ||
uses: jpribyl/action-docker-layer-caching@v0.1.1 | ||
continue-on-error: true | ||
|
||
- name: Build docker containers | ||
run: docker compose build | ||
working-directory: docker/run_cypress_tests | ||
- name: Create and migrate DB | ||
run: docker compose run --entrypoint "" mampf sh -c "rake db:create db:migrate db:test:prepare" | ||
working-directory: docker/run_cypress_tests | ||
- name: Reindex sunspot | ||
working-directory: docker/run_cypress_tests | ||
run: | | ||
docker compose run --entrypoint="" mampf sh -c "RAILS_ENV=test rake sunspot:reindex" | ||
|
||
- name: Run unit tests | ||
working-directory: docker/run_cypress_tests | ||
run: docker compose run --entrypoint="" mampf sh -c "RAILS_ENV=test rails spec" | ||
- name: Send test coverage report to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: ./coverage/coverage.xml | ||
fail_ci_if_error: true | ||
verbose: true | ||
e2e-test-job: | ||
name: Run E2E tests & upload results to Cypress | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
needs: unit-test-job | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Pull docker images | ||
run: docker compose pull --ignore-buildable | ||
working-directory: docker/run_cypress_tests | ||
|
||
- name: Use Docker layer caching # https://github.com/jpribyl/action-docker-layer-caching | ||
uses: jpribyl/action-docker-layer-caching@v0.1.1 | ||
continue-on-error: true | ||
|
||
- name: Build docker containers | ||
run: docker compose build | ||
working-directory: docker/run_cypress_tests | ||
- name: Create and migrate DB | ||
run: docker compose run --entrypoint "" mampf sh -c "rake db:create db:migrate db:test:prepare" | ||
working-directory: docker/run_cypress_tests | ||
- name: Run integration tests | ||
working-directory: docker/run_cypress_tests | ||
env: | ||
# pass the Dashboard record key as an environment variable | ||
CYPRESS_baseUrl: http://mampf:3000 | ||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | ||
# pass GitHub token to allow accurately detecting a build vs a re-run build | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: docker compose run -e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} --entrypoint="" cypress_runner sh -c "while ! curl http://mampf:3000 ; do echo waiting for MaMpf to come online at http://mampf:3000; sleep 3; done; cypress run --record --key ${{ secrets.CYPRESS_RECORD_KEY }}" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Maybe rename the folder to
docker/run_tests
as it is not specifically for Cypress tests anymore.