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

FI-3588: Use git for files in test kit gemspecs #578

Merged
merged 4 commits into from
Dec 30, 2024

Conversation

Jammjammjamm
Copy link
Collaborator

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).

Copy link

codecov bot commented Dec 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.29%. Comparing base (0d17cd0) to head (70fc8c9).
Report is 1 commits behind head on main.

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           
Flag Coverage Δ
backend 92.62% <ø> (ø)
frontend 79.20% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Dir['config/presets/*.json.erb'],
'LICENSE'
].flatten
spec.files = `[ -d .git ] && git ls-files -z lib config/presets LICENSE`.split("\x0")
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Contributor

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

@Jammjammjamm Jammjammjamm force-pushed the fi-3588-use-git-for-files branch from 15aeb7e to 70fc8c9 Compare December 30, 2024 14:04
@Jammjammjamm Jammjammjamm merged commit f30f8b3 into main Dec 30, 2024
10 checks passed
@Jammjammjamm Jammjammjamm deleted the fi-3588-use-git-for-files branch December 30, 2024 15:13
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.

2 participants