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

Test Results added to example #45

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
43 changes: 37 additions & 6 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ blocks:
jobs:
- name: bundle
commands:
- sem-version ruby 2.7.3
- '#sem-version ruby 2.7.3'
- sem-version ruby 3.1.0
- ruby -v
- sem-version node 14.16.1
- echo "changed back"
- echo $SEMAPHORE_GIT_URL
- checkout
- cache restore
- bundle install
Expand All @@ -24,7 +28,9 @@ blocks:
jobs:
- name: check style + security
commands:
- sem-version ruby 2.7.3
- '#sem-version ruby 2.7.3'
- sem-version ruby 3.1.0
- ruby -v
- sem-version node 14.16.1
- checkout
- cache restore
Expand All @@ -38,7 +44,9 @@ blocks:
task:
prologue:
commands:
- sem-version ruby 2.7.3
- '#sem-version ruby 2.7.3'
- sem-version ruby 3.1.0
- ruby -v
- sem-version node 14.16.1
- checkout
- cache restore
Expand All @@ -50,20 +58,37 @@ blocks:
- name: RSpec - model tests
commands:
- bundle exec rspec spec/models
- test-results compile --name "First report results" junit.xml report1.json
- '# Manualy create the second report'
- test-results compile --name "Second report results" junit.xml report2.json
- '# Combine two reports together'
- test-results combine report1.json report2.json report.json
- '# Push report to artifact storage'
- artifact push job report.json -d test-results/junit.json
- name: RSpec - controller tests
commands:
- bundle exec rspec spec/controllers
- test-results compile --name "First report" junit.xml report1.json
- '# Manualy create the second report'
- test-results compile --name "Second report" junit.xml report2.json
- '# Combine two reports together'
- test-results combine report1.json report2.json report.json
- '# Push report to artifact storage'
- artifact push job report.json -d test-results/junit2.json
epilogue:
always:
commands:
- test-results publish junit.xml
- '#test-results publish --name "teste-vaisalvardiferente" junit.xml'
- '#test-results publish --name "tentar outro" junit.xml'
- name: Integration tests
dependencies:
- Unit tests
task:
prologue:
commands:
- sem-version ruby 2.7.3
- '#sem-version ruby 2.7.3'
- sem-version ruby 3.1.0
- ruby -v
- sem-version node 14.16.1
- checkout
- cache restore
Expand All @@ -78,4 +103,10 @@ blocks:
epilogue:
always:
commands:
- test-results publish junit.xml
- test-results publish junit.xml
after_pipeline:
task:
jobs:
- name: Reports
commands:
- test-results gen-pipeline-report
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ You can follow along with this project by reading the
[documentation](https://docs.semaphoreci.com/article/99-rails-continuous-integration).
Or jump straight into `.semaphore/semaphore.yml`.

This project also makes use of the Test Results feature.

You can extend the CI pipeline with Continuous Delivery by implementing a
[promotion](https://docs.semaphoreci.com/article/67-deploying-with-promotions).
Refer to Semaphore documentation for additional deployment examples.
Expand Down
1 change: 1 addition & 0 deletions dummy_to_run_tests.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yep exactly