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

Create test for agent_helper in gem files #2118

Merged
merged 7 commits into from
Jul 11, 2023
Merged

Create test for agent_helper in gem files #2118

merged 7 commits into from
Jul 11, 2023

Conversation

kaylareopelle
Copy link
Contributor

This PR adds a test to ensure the test/agent_helper.rb file is included in the distributed gem.

Thank you, @ajesler for your creative solution! 🌈

Resolves #2117

# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

require 'minitest/autorun'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajesler - I swapped out the test_helper require statement with minitest/autorun because we don't want/need the agent to be loaded for this particular test.

This is what we do with our other utilities, like our CveNotifierTests

@kaylareopelle kaylareopelle marked this pull request as ready for review July 10, 2023 19:04
Base automatically changed from bugfix/2113-include-test-agent-helper to dev July 10, 2023 21:10
fallwith
fallwith previously approved these changes Jul 10, 2023
Co-authored-by: AJ Esler <aj@esler.co.nz>
fallwith
fallwith previously approved these changes Jul 11, 2023
@kaylareopelle
Copy link
Contributor Author

Hmm... local tests and the CI aren't matching. I'm going to come back to this after the release.

effectively fork `Gem::Specification.load` to bypass its internal
caching mechanism, and catch parse failures with an assertion.
When parsing `newrelic_rpm.gemspec` from a directory other than the
project root, make sure that the `.build_ignore` file can be found by
leveraging its absolute path
We were previously skipping the `rails<version>` env tests, but not the
`norails` ones. Skip those too.
The automated CI tests only run the 'env' suites, so we can't skip
`norails`. Instead, just chdir to the root of the agent dir, which is
where any production targetting `gem build` process will take place.
Skip older Rubygems based contexts
CI: gemspec files test - bypass cache
@fallwith fallwith merged commit 974fa24 into dev Jul 11, 2023
@fallwith fallwith deleted the 2117_gemspec_test branch July 11, 2023 23:00
@github-actions
Copy link
Contributor

SimpleCov Report

Coverage Threshold
Line 94.26% 94%
Branch 85.8% 85%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add test for gemspec files
2 participants