@shivaedev/vitest-rerun 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +8 -10
- package/docs/north-star.md +0 -38
- package/docs/roadmap.md +0 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.1 - 2026-10-24
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Align published dependency and peer pins and the generated starter with React and React DOM 19.3.1, TanStack Router 1.170.45, Better Auth 1.7.10, happy-dom 21.0.3 and Vitest 5.0.5. The starter also uses pg-boss dashboard 1.12.1.
|
|
8
|
+
|
|
3
9
|
## 0.1.0 - 2026-10-18
|
|
4
10
|
|
|
5
11
|
### Added
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shivaedev/vitest-rerun",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Reruns failed Vitest tests in a fresh process and reports which tests were flaky",
|
|
5
5
|
"homepage": "https://github.com/ShivaeDev/platform/tree/main/packages/vitest-rerun#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -40,7 +40,6 @@
|
|
|
40
40
|
"!src/**/*.test.ts",
|
|
41
41
|
"!src/**/*.spec.ts",
|
|
42
42
|
"!src/**/test-support",
|
|
43
|
-
"docs",
|
|
44
43
|
"CHANGELOG.md",
|
|
45
44
|
"README.md"
|
|
46
45
|
],
|
|
@@ -48,21 +47,20 @@
|
|
|
48
47
|
"@effect/platform-node": "4.0.4",
|
|
49
48
|
"@effect/platform-node-shared": "4.0.4",
|
|
50
49
|
"@effect/vitest": "4.0.4",
|
|
51
|
-
"@shivaedev/effect-test": "0.
|
|
52
|
-
"@shivaedev/quality": "0.
|
|
53
|
-
"@shivaedev/test-story": "0.
|
|
50
|
+
"@shivaedev/effect-test": "0.7.1",
|
|
51
|
+
"@shivaedev/quality": "0.33.2",
|
|
52
|
+
"@shivaedev/test-story": "0.18.1",
|
|
54
53
|
"@types/node": "24.19.2",
|
|
55
|
-
"@
|
|
56
|
-
"@vitest/coverage-v8": "5.0.3",
|
|
54
|
+
"@vitest/coverage-v8": "5.0.5",
|
|
57
55
|
"effect": "4.0.4",
|
|
58
|
-
"typescript": "
|
|
59
|
-
"vitest": "5.0.
|
|
56
|
+
"typescript": "7.0.2",
|
|
57
|
+
"vitest": "5.0.5"
|
|
60
58
|
},
|
|
61
59
|
"peerDependencies": {
|
|
62
60
|
"@effect/platform-node": "4.0.4",
|
|
63
61
|
"@effect/platform-node-shared": "4.0.4",
|
|
64
62
|
"effect": "4.0.4",
|
|
65
|
-
"vitest": "5.0.
|
|
63
|
+
"vitest": "5.0.5"
|
|
66
64
|
},
|
|
67
65
|
"engines": {
|
|
68
66
|
"node": ">=24"
|
package/docs/north-star.md
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# North star
|
|
2
|
-
|
|
3
|
-
## The problem
|
|
4
|
-
|
|
5
|
-
Some tests fail now and then for reasons that have nothing to do with the change under test: timing, ports, a slow runner. In a merge queue, each such failure blocks a merge and costs a full rerun of CI. Vitest's `retry` option looks like the fix, but it repeats the test in the same worker. Module state, mocks, timers and handles left behind by the failed attempt are still there, so the retry is not a clean second chance, and a pass after it says little.
|
|
6
|
-
|
|
7
|
-
Rerunning by hand or rerunning the whole job hides the flake entirely. Nobody records which tests needed a second attempt, so flaky tests accumulate until the suite is unreliable.
|
|
8
|
-
|
|
9
|
-
## The ideal
|
|
10
|
-
|
|
11
|
-
A repository replaces `vitest run` in CI with `vitest-rerun`. Failed tests get a clean rerun in a fresh process, only the failed tests run again, and the job's result reflects whether each test eventually passed. Every recovered test is written to `flaky-tests.json` with its JUnit identity, its attempt count and the messages of its failed attempts, so a dashboard, a bot or a person can find it, count it and fix it.
|
|
12
|
-
|
|
13
|
-
The final reports read as if the run happened once: one JUnit testcase per test with its final result, a JSON report with summed durations, and coverage merged from every attempt. Tools that read JUnit or LCOV need no knowledge of reruns.
|
|
14
|
-
|
|
15
|
-
## What good looks like
|
|
16
|
-
|
|
17
|
-
- A test that fails once and then passes yields a passing run and one `flaky-tests.json` entry whose `classname` and `name` match its JUnit testcase.
|
|
18
|
-
- A test that keeps failing fails the run and produces no flaky entry.
|
|
19
|
-
- A clean run writes no flaky file and runs every test once.
|
|
20
|
-
- A file that runs in several Vitest projects keeps a distinct JUnit identity per project.
|
|
21
|
-
- Tests that passed, including passing tests beside a failed one, never run twice.
|
|
22
|
-
|
|
23
|
-
## Trade-offs
|
|
24
|
-
|
|
25
|
-
**Truth before green.** The package exists to let flaky tests pass, so it must be strict about everything else: an unhandled error, a test still failing after the last rerun or a broken report fails the run.
|
|
26
|
-
|
|
27
|
-
**Clean attempts before speed.** A fresh process costs startup time on every rerun. That cost is the point; an in-process shortcut would bring back the problem this package solves.
|
|
28
|
-
|
|
29
|
-
**A stable contract before a richer one.** `flaky-tests.json` stays small and its fields keep their names. New information goes into new fields only when a real consumer needs it.
|
|
30
|
-
|
|
31
|
-
**Vitest's machinery before our own.** Reports come from Vitest's JSON and JUnit reporters and coverage from its coverage provider. The package selects tests, merges attempt results and writes one file of its own.
|
|
32
|
-
|
|
33
|
-
## What it leaves out
|
|
34
|
-
|
|
35
|
-
- Quarantining, skipping or ranking flaky tests across runs; that belongs to whatever reads `flaky-tests.json`.
|
|
36
|
-
- Retrying unhandled errors, crashed workers or failed setup outside a test file.
|
|
37
|
-
- Test runners other than Vitest, and in-process retries.
|
|
38
|
-
- Deciding which CI events may rerun; a repository chooses `--reruns` per event.
|
package/docs/roadmap.md
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# Roadmap
|
|
2
|
-
|
|
3
|
-
This file owns vitest-rerun's implementation status and open questions. A story in this package establishes the runner's behavior against real Vitest processes, not every consumer's CI.
|
|
4
|
-
|
|
5
|
-
## Built
|
|
6
|
-
|
|
7
|
-
- [x] A `vitest-rerun` command that runs Vitest with retries off and reruns only the failed tests in fresh processes, up to `--reruns` times (default 1).
|
|
8
|
-
- [x] Final JSON and JUnit reports for the whole run, with summed durations and the raw report of each attempt.
|
|
9
|
-
- [x] Coverage merged from every attempt, and a separate Vite cache for reruns.
|
|
10
|
-
- [x] `flaky-tests.json` with each recovered test's JUnit `classname` and `name`, file, attempt count and failure messages, plus the `FlakyTests` schema to read it.
|
|
11
|
-
- [x] A JUnit `classname` that names the Vitest project, so a file that runs in two projects stays distinct.
|
|
12
|
-
- [x] No rerun after an unhandled error; a recovered collection failure is reported in the job summary.
|
|
13
|
-
- [x] Platform's CI shards run through the package, with reruns only in the merge queue.
|
|
14
|
-
|
|
15
|
-
## Open questions
|
|
16
|
-
|
|
17
|
-
- Whether a file that failed to load and then passed belongs in `flaky-tests.json`. It has no testcase in the final JUnit report, so today it appears only in the job summary.
|
|
18
|
-
- Whether a rerun should also cover failures in `beforeAll` and `afterAll` hooks that Vitest reports on a suite rather than a test.
|