Skip to content

Commit

Permalink
update retry_count to get the number from a var or use default 0 (#397)
Browse files Browse the repository at this point in the history
When running locally we might not want the tests to retry, to do this
we would need to comment out the retry lines. We want to make this easier
on the developer

Converting the env variable to an integer because ENV[] on ruby returns a string
https://ruby-doc.org/core-3.0.0/ENV.html
  • Loading branch information
vasconsaurus authored Sep 27, 2023
1 parent 3cd07e5 commit e168c72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ before_install:
before_script:
- docker-compose exec pender test/setup-parallel
script:
- docker-compose exec pender bundle exec rake "parallel:test[3]"
- docker-compose exec pender bundle exec rake parallel:spec
- docker-compose exec -e TEST_RETRY_COUNT=5 pender bundle exec rake "parallel:test[3]"
- docker-compose exec -e TEST_RETRY_COUNT=5 pender bundle exec rake parallel:spec
after_script:
- docker-compose exec pender cat tmp/performance.csv
- docker-compose exec -e TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST -e TRAVIS_TEST_RESULT=$TRAVIS_TEST_RESULT -e TRAVIS_BRANCH=$TRAVIS_BRANCH -e CC_TEST_REPORTER_ID=$CC_TEST_REPORTER_ID -e GIT_COMMIT_SHA=$GIT_COMMIT_SHA -e GIT_COMMITTED_AT=$GIT_COMMITTED_AT pender test/test-coverage
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
require 'minitest/mock'
require 'mocha/minitest'

Minitest::Retry.use!(retry_count: 5)
Minitest::Retry.use!(retry_count: ENV['TEST_RETRY_COUNT'].to_i || 0)

Minitest::Retry.on_failure do |_klass, _test_name|
sleep 10
Expand Down

0 comments on commit e168c72

Please sign in to comment.