-
Notifications
You must be signed in to change notification settings - Fork 5
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
FI-3588: Use git for files in test kit gemspecs #578
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #578 +/- ##
=======================================
Coverage 84.29% 84.29%
=======================================
Files 275 275
Lines 11668 11668
Branches 1302 1302
=======================================
Hits 9836 9836
Misses 1822 1822
Partials 10 10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Dir['config/presets/*.json.erb'], | ||
'LICENSE' | ||
].flatten | ||
spec.files = `[ -d .git ] && git ls-files -z lib config/presets LICENSE`.split("\x0") |
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.
Aren't the files just getting listed here instead? If I create my-test-kit/docs
and commit it to git it still doesn't get packaged into the gem.
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.
The number of times that necessary files haven't been included in a published gem because they're outside of lib
is pretty small. The number of times they haven't been included because they're a new file type that hadn't been included before is pretty large.
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.
If that's the intention then this works.
We should also mention the existence of spec.files
here: https://inferno-framework.github.io/docs/distributing-tests.html
15aeb7e
to
70fc8c9
Compare
Summary
This branch updates the gemspec in the template to include files based on what is committed to git. This will help avoid the issue where a test kit gem is published but new files are not included because they do not meet the criteria for inclusion in the gemspec.
Testing Guidance
bundle exec bin/inferno new my_test_kit
cd my-test-kit
mkdir config/presets
touch config/presets/my_preset.json
git add config
git commit -m "add preset"
gem build my_test_kit.gemspec
mkdir gem
mv my_test_kit-0.0.0.gem gem
cd gem
tar -xvf my_test_kit-0.0.0.gem
tar -xvzf data.tar.gz
You should see all of the expected files (everything in lib and the preset).