-
Notifications
You must be signed in to change notification settings - Fork 3
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
NH-53257 Use docker instead of compose to run test containers #50
Conversation
Fix otel_config_propagator_test.rb failures by requiring dependency and setting a dummy service key
Rakefile
Outdated
--volume $PWD:/code/ruby-solarwinds --workdir /code/ruby-solarwinds \ | ||
--entrypoint test/test_setup.sh -e RUN_TESTS=1 \ | ||
--name ruby_sw_apm_#{args.os}_#{args.ruby_version} ruby_sw_apm_#{args.os}_#{args.ruby_version}" | ||
--name ruby_sw_apm_#{args.tag} ruby:#{args.tag}" |
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.
It would be nice to have choice of platform like
cmd = "docker run --rm --tty \
--volume $PWD:/code/ruby-solarwinds --workdir /code/ruby-solarwinds \
--entrypoint test/test_setup.sh -e RUN_TESTS=1 --platform=#{args.platform} \
--name ruby_sw_apm_#{args.tag} ruby:#{args.tag}"
but please ignore if too much arguments for rake task
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 makes sense, to allow running tests on alpine :). Added!
Remove test container name clash
Pushed 525df31 because I ran into an issue setting up VSCode Ruby LSP extension (pretty cool, recommend it) which boiled down to the global bundle "without" config that interfered with the extension's gem installation. Looking more, found we can actually set the config at local level and take advantage of the environment vars set in official ruby containers, as noted in the updated PR description. |
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.
Thanks!
https://swicloud.atlassian.net/browse/NH-53257
Use docker to run test containers. This is to address the problem that with the original compose-based way, it's not possible to run multiple containers via the rake tasks because each
docker_dev
anddocker_tests
task invocation will tear the entire compose stack down. I thought about using compose profiles or separate compose files, but just using plain docker run seemed the simplest given current use case. Also stop setting a name for the test containers since that could cause run failure due to name collision, and seemed not needed for these disposable containers.Fix the otel_config_propagator_test.rb failures by requiring
solarwinds_apm/config
and setting a dummy service key. This issue was seen when running just this single test file, we should probably improve the test setup/teardown so that there aren't these masked dependencies.No longer need to set global bundler config, since official ruby containers use the BUNDLE_APP_CONFIG env var which bypasses collisions between config set on the host machine and set within the container. So added it along with BUNDLE_SILENCE_ROOT_WARNING to the dev container.