Skip to content

Commit 7037fe4

Browse files
committed
docs: rof
1 parent ce4d6c2 commit 7037fe4

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

_plugins/docusaurus.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def system!(*args)
7878
"predict",
7979
"queue-mode",
8080
"reference",
81+
"retry-only-failures",
8182
"rspec",
8283
"simplecov",
8384
"split-by-test-examples",
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
pagination_next: null
3+
pagination_prev: null
4+
---
5+
6+
import { TOCBottom } from '@site/src/components/TOCBottom'
7+
import { IconExternalLink } from '@site/src/components/IconExternalLink'
8+
9+
<TOCBottom heading="Reference" Icon={<IconExternalLink />}>
10+
11+
- [`KNAPSACK_PRO_LOG_LEVEL`](reference.md#knapsack_pro_log_level)
12+
13+
</TOCBottom>
14+
15+
# Retry only Failures
16+
17+
:::caution
18+
19+
This feature is limited to beta-testers.
20+
21+
:::
22+
23+
:::caution
24+
25+
Only RSpec on GitHub Actions, CircleCI, GitLab CI, and Buildkite are supported for now.
26+
27+
:::
28+
29+
A substantial percentage of your CI retries are spent running tests that already passed on the previous run. Not only is it a waste of time & resources, it's also an opportunity for flakes to cause troubles.
30+
31+
When executing a rerun, Retry only Failures executes only the tests that failed on the previous build.
32+
33+
## Configuration
34+
35+
To enable Retry only Failures, update your Gemfile as follows:
36+
37+
```ruby
38+
gem "knapsack_pro", github: "knapsackpro/knapsack_pro-ruby", branch: "rof"
39+
```
40+
41+
Also, it's recommended to enable debug logs during the beta testing: [`KNAPSACK_PRO_LOG_LEVEL=debug`](reference.md#knapsack_pro_log_level)
42+
43+
## Example
44+
45+
Let's say your test suite contains 3 specs:
46+
- `a_spec.rb`
47+
- `b_spec.rb`
48+
- `c_spec.rb`
49+
50+
If you run your tests on 2 nodes, you could expect the following split:
51+
- Node 0: executes `a_spec.rb` and `b_spec.rb` where `a_spec.rb[1:1:2]` fails and `b_spec.rb[2:1]` is skipped
52+
- Node 1: executes `c_spec.rb` successfully
53+
54+
If you retry Node 0, Retry only Failures will execute only `a_spec.rb[1:1:2]`. If you retry Node 1, Retry only Failures will execute no tests.

docusaurus/sidebars.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ const sidebars: SidebarsConfig = {
8181
id: "ruby/predict",
8282
className: "hidden",
8383
},
84+
{
85+
type: "doc",
86+
label: "Retry only Failures",
87+
id: "ruby/retry-only-failures",
88+
className: "hidden",
89+
},
8490
],
8591
},
8692
{

0 commit comments

Comments
 (0)