-
Notifications
You must be signed in to change notification settings - Fork 601
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
Add test for gemspec files #2117
Comments
I had a play this afternoon with spec'ing the test file inclusion, and this was where I got to.
The raindow effect in the minitest output was an unexpected delight. # frozen_string_literal: true
# test/new_relic/gem_file_test.rb
# $ TEST="test/new_relic/gem_file_test.rb" bundle exec rake test
require_relative '../test_helper'
class GemFileTest < Minitest::Test
def test_the_test_agent_helper_is_shipped_in_the_gem_files
agent_helper_file = 'test/agent_helper.rb'
gem_spec_file_path = File.expand_path('../../../newrelic_rpm.gemspec', __FILE__)
gem_spec = Gem::Specification.load(gem_spec_file_path)
assert_equal('newrelic_rpm', gem_spec.name)
assert_includes(gem_spec.files, agent_helper_file)
end
end |
Yep, that sounds great to me. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#2113 revealed our recent changes to the files included in the Ruby agent unintentionally broke the
NewRelic::Agent.require_test_helper
public API. We have some tests that try to protect this from happening, but they didn't catch the problem in this case.The lines of code to test are around the
s.files
assignment:newrelic-ruby-agent/newrelic_rpm.gemspec
Lines 42 to 46 in 9fdb439
At a minimum, we need to test whether
test/agent_helper.rb
is included in the build.The text was updated successfully, but these errors were encountered: