Comments (4)
Hi @ArturT your code is the workaround we're currently using, I was just wondering if there was a more straightforward way!
BTW, we normally run in queue mode in CI, I just had that command shortened for the test I was running locally. (Assuming that doesn't make a difference.)
Thanks for your help!
from knapsack_pro-ruby.
Interesting! We will investigate! Thanks for your help.
from knapsack_pro-ruby.
I see you use Knapsack Pro in Regular Mode. In the Regular Mode, we invoke the RSpec rake task. I'm not sure why it does not respect the --failure-exit-code=3
option.
Maybe you could create a bash script bin/knapsack_pro_run_tests
and override the exit code:
#!/bin/bash
# run tests in parallel with Knapsack Pro Regular Mode for RSpec
bundle exec rake knapsack_pro:rspec
export KNAPSACK_PRO_EXIT_CODE=$?
# process should exit with non zero exit code when one of test failed
if [ "$KNAPSACK_PRO_EXIT_CODE" -ne "1" ]; then
exit 3
fi
from knapsack_pro-ruby.
In the Queue Mode the non-zero exit code from the RSpec is remembered for each batch of tests fetched from Knapsack Pro API Queue.
A non-zero exit code should be returned in the Queue Mode:
I've just manually tested the Queue Mode and the --failure-exit-code=3
option. When my test case is failing then knapsack_pro gem returns 3
as the exit code
bundle exec rake "knapsack_pro:queue:rspec[--format d --failure-exit-code 3]"
...some output from running test
echo $? # run this to preview the exit code
3
Maybe knapsack_pro is not the last command in your CI pipeline and that is why your CI does not see 3
as exit code?
from knapsack_pro-ruby.
Related Issues (20)
- Running `git fetch --shallow-since` to fetch commit author log causes hang on Buildkite runners HOT 12
- rspec-core conflict HOT 4
- Running queue mode locally for troubleshooting with a small subset of tests, but with multiple batches HOT 6
- Does `rake knapsack_pro:rspec_test_example_detector` need to run if there aren't any slow specs? HOT 2
- Slow test analysis runs even when there's no slow tests HOT 2
- Disable example_status_persistence_file_path HOT 3
- Create a replication command on failed node HOT 2
- Incompatibility with rspec --options on 6.0+ HOT 11
- NoMethodError: undefined method `rspec_is_quitting' HOT 2
- NoMethodError: undefined method `rspec_is_quitting' for RSpec::Core::World HOT 1
- After upgrading to minitest 5.22.0 I get error status even if all test pass HOT 8
- NoMethodError: undefined method `keys' for nil HOT 20
- Failing RSpec tests on ~>7.0.0 HOT 9
- DataDog dropping RSpec tests with the knapsack_pro 7.x gem in Queue Mode HOT 1
- Knapsack v7 ignores run options defined in spec_helpers. HOT 3
- Ruby 3.3 support? HOT 4
- Simplecov doesnt work with Knapsack Pro 7.4 and minitest HOT 16
- Improve handling of skipped tests and dynamic parallelism HOT 12
- knapsack_pro 7.6.1 fails with RSpec HOT 3
- Custom minitest reporter is run once on the first split, twice on the second, ..., N times on the Nth split HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knapsack_pro-ruby.