Skip to content

Commit

Permalink
test(minitest): avoid installing at_exit
Browse files Browse the repository at this point in the history
  • Loading branch information
3v0k4 committed Jan 8, 2024
1 parent 5836b96 commit 2f3779f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

### Unreleased (patch)

* test(minitest): avoid installing `at_exit` (that would result in an empty run of Minitest after Knapsack Pro is finished)

### 6.0.3

* fix(Turnip): make sure `.feature` files are recorded
Expand Down
4 changes: 4 additions & 0 deletions lib/knapsack_pro/runners/queue/minitest_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ class MinitestRunner < BaseRunner
def self.run(args)
require 'minitest'

# Avoid installing `at_exit` since we are calling `Minitest.run` ourselves.
# Without this, Minitest would run again (autorun) after `Minitest.run`.
::Minitest.class_variable_set('@@installed_at_exit', true)

ENV['KNAPSACK_PRO_TEST_SUITE_TOKEN'] = KnapsackPro::Config::Env.test_suite_token_minitest
ENV['KNAPSACK_PRO_QUEUE_RECORDING_ENABLED'] = 'true'
ENV['KNAPSACK_PRO_QUEUE_ID'] = KnapsackPro::Config::EnvGenerator.set_queue_id
Expand Down

0 comments on commit 2f3779f

Please sign in to comment.