-
Notifications
You must be signed in to change notification settings - Fork 3
Use new test method to avoid shared state among test case #208
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
Conversation
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.
Awesome revamp @xuan-cao-swi! Left a few minor comments.
test/api/tracing_ready_test.rb
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that seems acceptable to me
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice you're already updating CONTRIB. How about noting the required env vars when running tests locally?
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.
Updated
test/run_tests.sh
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
Updated
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.
LGTM, thanks for the revisit @xuan-cao-swi!
Description
Test (if applicable)