Skip to content
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

CI: gemspec files test - bypass cache #2130

Merged
merged 5 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion newrelic_rpm.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |s|
'homepage_uri' => 'https://newrelic.com/ruby'
}

reject_list = File.read('./.build_ignore').split("\n")
reject_list = File.read(File.expand_path('../.build_ignore', __FILE__)).split("\n")
file_list = `git ls-files -z`.split("\x0").reject { |f| reject_list.any? { |rf| f.start_with?(rf) } }
# test/agent_helper.rb is a requirement for the NewRelic::Agent.require_test_helper public API
test_helper_path = 'test/agent_helper.rb'
Expand Down
10 changes: 4 additions & 6 deletions test/new_relic/gemspec_files_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@

class GemspecFilesTest < Minitest::Test
def test_the_test_agent_helper_is_shipped_in_the_gem_files
skip if defined?(Rails::VERSION)

agent_helper_file = 'test/agent_helper.rb'
skip if defined?(Rails::VERSION) || File.basename(Dir.pwd).match?('rails')
fallwith marked this conversation as resolved.
Show resolved Hide resolved

gem_spec_file_path = File.expand_path('../../../newrelic_rpm.gemspec', __FILE__)
gem_spec = eval(Gem.open_file(gem_spec_file_path, 'r:UTF-8:-', &:read))

gem_spec = Gem::Specification.load(gem_spec_file_path)

assert gem_spec, "Failed to parse '#{gem_spec_file_path}'"
assert_equal('newrelic_rpm', gem_spec.name)
assert_includes(gem_spec.files, agent_helper_file)
assert_includes(gem_spec.files, 'test/agent_helper.rb')
end
end