-
Notifications
You must be signed in to change notification settings - Fork 125
fix(specs): Add a check to fail if community PR #3915
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Currently, if a community PR is opened, the specs will not run because the `KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` secret will not be set. This will cause the specs to silently fail on the CI and potentially break `main`: ``` Run bundle exec rake knapsack_pro:queue:rspec E, [2025-07-02T09:39:24.571116 #3735] ERROR -- : [knapsack_pro] {"errors" => ["invalid test suite token"]} Finished in 0.45262 seconds (files took 5.69 seconds to load) 0 examples, 0 failures E, [2025-07-02T09:39:24.572334 #3735] ERROR -- : [knapsack_pro] An unexpected exception happened. RSpec cannot handle it. The exception: #<NoMethodError: undefined method 'response' for an instance of KnapsackPro::Client::Connection> E, [2025-07-02T09:39:24.572368 #3735] ERROR -- : [knapsack_pro] Exception message: undefined method 'response' for an instance of KnapsackPro::Client::Connection E, [2025-07-02T09:39:24.572463 #3735] ERROR -- : [knapsack_pro] Exception backtrace: /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/queue_allocator.rb:12:in 'KnapsackPro::QueueAllocator::Batch#initialize' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/queue_allocator.rb:105:in 'Class#new' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/queue_allocator.rb:105:in 'KnapsackPro::QueueAllocator#pull_tests_from_queue' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/queue_allocator.rb:47:in 'KnapsackPro::QueueAllocator#test_file_paths' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/runners/queue/base_runner.rb:29:in 'KnapsackPro::Runners::Queue::BaseRunner#test_file_paths' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/runners/queue/rspec_runner.rb:181:in 'KnapsackPro::Runners::Queue::RSpecRunner#pull_tests_from_queue' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/runners/queue/rspec_runner.rb:82:in 'block in KnapsackPro::Runners::Queue::RSpecRunner#with_batch' <internal:kernel>:168:in 'Kernel#loop' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/runners/queue/rspec_runner.rb:80:in 'KnapsackPro::Runners::Queue::RSpecRunner#with_batch' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/extensions/rspec_extension.rb:93:in 'block (2 levels) in KnapsackPro::Extensions::RSpecExtension::Runner#knapsack__run_specs' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.2/lib/rspec/core/configuration.rb:2097:in 'RSpec::Core::Configuration#with_suite_hooks' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/extensions/rspec_extension.rb:92:in 'block in KnapsackPro::Extensions::RSpecExtension::Runner#knapsack__run_specs' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.2/lib/rspec/core/reporter.rb:74:in 'RSpec::Core::Reporter#report' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/extensions/rspec_extension.rb:91:in 'KnapsackPro::Extensions::RSpecExtension::Runner#knapsack__run_specs' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/runners/queue/rspec_runner.rb:55:in 'KnapsackPro::Runners::Queue::RSpecRunner#run' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/runners/queue/rspec_runner.rb:20:in 'KnapsackPro::Runners::Queue::RSpecRunner.run' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/tasks/queue/rspec.rake:12:in 'block (3 levels) in <main>' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/task.rb:281:in 'block in Rake::Task#execute' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/task.rb:281:in 'Array#each' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/task.rb:281:in 'Rake::Task#execute' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/task.rb:219:in 'block in Rake::Task#invoke_with_call_chain' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/task.rb:199:in 'Monitor#synchronize' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/task.rb:199:in 'Rake::Task#invoke_with_call_chain' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/task.rb:188:in 'Rake::Task#invoke' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/application.rb:188:in 'Rake::Application#invoke_task' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/application.rb:138:in 'block (2 levels) in Rake::Application#top_level' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/application.rb:138:in 'Array#each' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/application.rb:138:in 'block in Rake::Application#top_level' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/application.rb:147:in 'Rake::Application#run_with_threads' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/application.rb:132:in 'Rake::Application#top_level' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/application.rb:83:in 'block in Rake::Application#run' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/application.rb:214:in 'Rake::Application#standard_exception_handling' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/application.rb:80:in 'Rake::Application#run' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/exe/rake:27:in '<top (required)>' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/bin/rake:25:in 'Kernel#load' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/bin/rake:25:in '<main>' Stopped processing SimpleCov as a previous error not related to SimpleCov has been detected Coverage report generated for RSpec to /home/runner/work/lago-api/lago-api/coverage. 0 / 0 LOC (100.0%) covered. ``` This commit adds a check to fail if the `KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` secret is not set to ensure we run the specs before merging the PR.
This reverts commit 656e8e9.
vincent-pochet
approved these changes
Jul 4, 2025
groyoh
added a commit
that referenced
this pull request
Jul 4, 2025
…y member (#3915) Currently, if a community PR is opened, the`KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` secret will not be set. This will cause the specs to fail with an error as we are not able to run Knapsack Pro in this case. This is not an ideal situation as it will complexify the contribution process. The specs will now run sequentially in the CI workflow if the `KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` secret is not set.
diegocharles
pushed a commit
that referenced
this pull request
Jul 11, 2025
…#3915) ## Context Currently, if a community PR is opened, the`KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` secret will not be set. This will cause the specs to silently fail on the CI and potentially break `main`: ``` Run bundle exec rake knapsack_pro:queue:rspec E, [2025-07-02T09:39:24.571116 #3735] ERROR -- : [knapsack_pro] {"errors" => ["invalid test suite token"]} Finished in 0.45262 seconds (files took 5.69 seconds to load) 0 examples, 0 failures E, [2025-07-02T09:39:24.572334 #3735] ERROR -- : [knapsack_pro] An unexpected exception happened. RSpec cannot handle it. The exception: #<NoMethodError: undefined method 'response' for an instance of KnapsackPro::Client::Connection> E, [2025-07-02T09:39:24.572368 #3735] ERROR -- : [knapsack_pro] Exception message: undefined method 'response' for an instance of KnapsackPro::Client::Connection E, [2025-07-02T09:39:24.572463 #3735] ERROR -- : [knapsack_pro] Exception backtrace: /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/queue_allocator.rb:12:in 'KnapsackPro::QueueAllocator::Batch#initialize' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/queue_allocator.rb:105:in 'Class#new' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/queue_allocator.rb:105:in 'KnapsackPro::QueueAllocator#pull_tests_from_queue' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/queue_allocator.rb:47:in 'KnapsackPro::QueueAllocator#test_file_paths' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/runners/queue/base_runner.rb:29:in 'KnapsackPro::Runners::Queue::BaseRunner#test_file_paths' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/runners/queue/rspec_runner.rb:181:in 'KnapsackPro::Runners::Queue::RSpecRunner#pull_tests_from_queue' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/runners/queue/rspec_runner.rb:82:in 'block in KnapsackPro::Runners::Queue::RSpecRunner#with_batch' <internal:kernel>:168:in 'Kernel#loop' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/runners/queue/rspec_runner.rb:80:in 'KnapsackPro::Runners::Queue::RSpecRunner#with_batch' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/extensions/rspec_extension.rb:93:in 'block (2 levels) in KnapsackPro::Extensions::RSpecExtension::Runner#knapsack__run_specs' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.2/lib/rspec/core/configuration.rb:2097:in 'RSpec::Core::Configuration#with_suite_hooks' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/extensions/rspec_extension.rb:92:in 'block in KnapsackPro::Extensions::RSpecExtension::Runner#knapsack__run_specs' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.2/lib/rspec/core/reporter.rb:74:in 'RSpec::Core::Reporter#report' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/extensions/rspec_extension.rb:91:in 'KnapsackPro::Extensions::RSpecExtension::Runner#knapsack__run_specs' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/runners/queue/rspec_runner.rb:55:in 'KnapsackPro::Runners::Queue::RSpecRunner#run' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/knapsack_pro/runners/queue/rspec_runner.rb:20:in 'KnapsackPro::Runners::Queue::RSpecRunner.run' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/knapsack_pro-8.1.0/lib/tasks/queue/rspec.rake:12:in 'block (3 levels) in <main>' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/task.rb:281:in 'block in Rake::Task#execute' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/task.rb:281:in 'Array#each' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/task.rb:281:in 'Rake::Task#execute' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/task.rb:219:in 'block in Rake::Task#invoke_with_call_chain' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/task.rb:199:in 'Monitor#synchronize' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/task.rb:199:in 'Rake::Task#invoke_with_call_chain' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/task.rb:188:in 'Rake::Task#invoke' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/application.rb:188:in 'Rake::Application#invoke_task' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/application.rb:138:in 'block (2 levels) in Rake::Application#top_level' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/application.rb:138:in 'Array#each' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/application.rb:138:in 'block in Rake::Application#top_level' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/application.rb:147:in 'Rake::Application#run_with_threads' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/application.rb:132:in 'Rake::Application#top_level' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/application.rb:83:in 'block in Rake::Application#run' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/application.rb:214:in 'Rake::Application#standard_exception_handling' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/lib/rake/application.rb:80:in 'Rake::Application#run' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/exe/rake:27:in '<top (required)>' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/bin/rake:25:in 'Kernel#load' /home/runner/work/lago-api/lago-api/vendor/bundle/ruby/3.4.0/bin/rake:25:in '<main>' Stopped processing SimpleCov as a previous error not related to SimpleCov has been detected Coverage report generated for RSpec to /home/runner/work/lago-api/lago-api/coverage. 0 / 0 LOC (100.0%) covered. ``` See an example here: https://github.com/getlago/lago-api/actions/runs/16020160377/job/45199719035. ## Description This commit adds a check to fail the CI workflow if the `KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` secret is not set to ensure we run the specs before merging the PR.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Currently, if a community PR is opened, the
KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC
secret will not be set. This will cause the specs to silently fail on the CI and potentially breakmain
:See an example here: https://github.com/getlago/lago-api/actions/runs/16020160377/job/45199719035.
Description
This PR adds a check to fail the CI workflow if the
KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC
secret is not set to ensure we run the specs before merging the PR.