Use new test method to avoid shared state among test case#208
Conversation
cheempz
left a comment
There was a problem hiding this comment.
Awesome revamp @xuan-cao-swi! Left a few minor comments.
| end | ||
|
|
||
| it 'default_test_solarwinds_ready' do | ||
| skip if ENV['APM_RUBY_TEST_STAGING_KEY'].to_s.empty? |
There was a problem hiding this comment.
I think this should be an Error instead of skip when required env var for running test is not set--if we somehow accidentally remove this GH Action secret we'd never notice. In upcoming update of CONTRIB docs we should note the required env vars when running tests locally.
There was a problem hiding this comment.
Sure, but in this case, when people try to run bundle exec rake docker_tests from rake, they need to provide this env like bundle exec rake docker_tests -e APM_RUBY_TEST_STAGING_KEY=....
There was a problem hiding this comment.
that seems acceptable to me
There was a problem hiding this comment.
Updated the rake test
| BUNDLE_GEMFILE=gemfiles/unit.gemfile bundle exec ruby -I test test/opentelemetry/solarwinds_propagator_test.rb -n /trace_state_header/ | ||
| bundle update | ||
| bundle exec ruby -I test test/opentelemetry/solarwinds_propagator_test.rb | ||
| bundle exec ruby -I test test/opentelemetry/solarwinds_propagator_test.rb -n /trace_state_header/ |
There was a problem hiding this comment.
Oh nice you're already updating CONTRIB. How about noting the required env vars when running tests locally?
| echo "--- SUMMARY ------------------------------" | ||
| grep -E '===|failures|FAIL|ERROR' "$TEST_RUNS_FILE_NAME" | ||
| echo "==================== FINAL SUMMARY ====================" | ||
| echo "Total: $total_tests | Passed: $passed_tests | Failed: $failed_tests" |
There was a problem hiding this comment.
| echo "Total: $total_tests | Passed: $passed_tests | Failed: $failed_tests" | |
| echo "Total Files: $total_tests | Passed: $passed_tests | Failed: $failed_tests" |
I think this "total_tests" is actually tracking the total test files (not actual test cases) that were run.
cheempz
left a comment
There was a problem hiding this comment.
LGTM, thanks for the revisit @xuan-cao-swi!
Description
Test (if applicable)