File tree Expand file tree Collapse file tree 5 files changed +38
-7
lines changed Expand file tree Collapse file tree 5 files changed +38
-7
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,8 @@ group :development, :test do
5151 gem "rubocop-rails-omakase" , require : false
5252
5353 gem 'rspec-rails'
54+
55+ gem 'knapsack_pro'
5456end
5557
5658group :development do
Original file line number Diff line number Diff line change 140140 sshkit (>= 1.23.0 , < 2.0 )
141141 thor (~> 1.3 )
142142 zeitwerk (>= 2.6.18 , < 3.0 )
143+ knapsack_pro (8.3.0 )
144+ rake
143145 language_server-protocol (3.17.0.5 )
144146 lint_roller (1.1.0 )
145147 logger (1.7.0 )
@@ -389,6 +391,7 @@ DEPENDENCIES
389391 importmap-rails
390392 jbuilder
391393 kamal
394+ knapsack_pro
392395 propshaft
393396 puma (>= 5.0 )
394397 rails (~> 8.0.2 )
Original file line number Diff line number Diff line change 44bundle install
55```
66
7- # RSpec
7+ # RSpec + Knapsack Pro
88
9- Run:
9+ The RSpec ` before(:suite) ` hook is defined in ` spec/spec_helper.rb ` .
10+
11+ Edit ` bin/knapsack_pro ` to use your API token.
12+
13+ Run RSpec tests with Knapsack Pro:
1014
1115```
12- rspec
16+ bin/knapsack_pro
1317```
1418
15- The RSpec before(: suite ) hook is called.
16-
17- Expected output:
19+ The expected output:
1820
1921```
2022RSpec before(:suite) hook called.
2123.........
2224
23- Finished in 0.00998 seconds (files took 0.51173 seconds to load)
25+ Finished in 0.42772 seconds (files took 0.19781 seconds to load)
24269 examples, 0 failures
2527```
2628
29+ The RSpec ` before(:suite) ` hook is called.
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ export KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=be5ca096c07e995a8800ee0ce1b1ec7c
4+ export KNAPSACK_PRO_LOG_LEVEL=warn
5+
6+ # detect branch and commit hash with git
7+ export KNAPSACK_PRO_REPOSITORY_ADAPTER=git
8+ export KNAPSACK_PRO_PROJECT_DIR=.
9+ # or, you can define them on your own (please ensure you comment out the above two env vars)
10+ # export KNAPSACK_PRO_COMMIT_HASH=commit-hash
11+ # export KNAPSACK_PRO_BRANCH=branch
12+
13+ export KNAPSACK_PRO_CI_NODE_BUILD_ID=$( openssl rand -base64 32)
14+ export KNAPSACK_PRO_CI_NODE_TOTAL=1
15+ export KNAPSACK_PRO_CI_NODE_INDEX=0
16+
17+ bundle exec rake " knapsack_pro:queue:rspec[--format progress]"
Original file line number Diff line number Diff line change 1+ require 'knapsack_pro'
2+
3+ # Custom Knapsack Pro config here
4+
5+ KnapsackPro ::Adapters ::RSpecAdapter . bind
6+
17# This file was generated by the `rails generate rspec:install` command. Conventionally, all
28# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
39# The generated `.rspec` file contains `--require spec_helper` which will cause
You can’t perform that action at this time.
0 commit comments