Skip to content

Detect unloaded files under lib directory #506

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

Merged
merged 8 commits into from
Apr 18, 2025

Conversation

Yang-33
Copy link
Contributor

@Yang-33 Yang-33 commented Apr 10, 2025

This change adds specs to detect files that are not required yet by required line-bot-api or require line/bot. However, since RSpec runs tests in the same process, it heavily depends on the order of test execution. Additionally, after require line-bot-api, we cannot clean up and then cannot call require line/bot.

Therefore, this change makes sure that important tests are run in a separate process. To avoid having to manually enter commands locally with test separation in mind, this change describes all the tests in the Rakefile's test task to hide the details of test execution.

@Yang-33 Yang-33 self-assigned this Apr 10, 2025
@Yang-33 Yang-33 requested a review from a team April 10, 2025 05:33
@@ -34,7 +34,7 @@ jobs:
- run: gem install bundler
- run: bundle install
- run: bundle exec rubocop
- run: bundle exec rspec
- run: rake test
Copy link
Contributor Author

Choose a reason for hiding this comment

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

maintainer: please don't call bundle exec rspec. It fails even in your local after merging this change.

Comment on lines 38 to 40
- run: bundle exec yard stats ./lib/line/bot/v2 --fail-on-warning
- run: bundle exec rbs collection install
- run: bundle exec rbs -I sig validate
Copy link
Contributor Author

@Yang-33 Yang-33 Apr 10, 2025

Choose a reason for hiding this comment

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

I'll move this into Rakefile later. I want to put bundle exec rake ci here finally

Copy link
Contributor Author

Choose a reason for hiding this comment

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

-> #511

@Yang-33 Yang-33 added this pull request to the merge queue Apr 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 14, 2025
@Yang-33 Yang-33 added this pull request to the merge queue Apr 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 14, 2025
@Yang-33 Yang-33 force-pushed the detect-unload-file-under-lib branch from 584167b to 3a780c7 Compare April 18, 2025 07:07

desc "Run normal tests (exclude no_missing_require_* specs)"
task :test_normal do
sh "bundle exec rspec --exclude-pattern 'spec/line/bot/line_bot_api_gem_spec.rb,spec/line/bot/line_bot_gem_spec.rb'"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

--exclude-pattern allows multiple target when we use comma like --exclude-pattern 'A,B,C', though --exclude-pattern 'A' --exclude-pattern 'B' doesn't work.

@Yang-33 Yang-33 added this pull request to the merge queue Apr 18, 2025
Merged via the queue into master with commit 57058ee Apr 18, 2025
8 checks passed
@Yang-33 Yang-33 deleted the detect-unload-file-under-lib branch April 18, 2025 07:12
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