exitproof 0.2.0__tar.gz → 0.3.0__tar.gz
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.
- {exitproof-0.2.0 → exitproof-0.3.0}/.claude-plugin/plugin.json +4 -2
- {exitproof-0.2.0 → exitproof-0.3.0}/PKG-INFO +2 -2
- {exitproof-0.2.0 → exitproof-0.3.0}/README.md +1 -1
- {exitproof-0.2.0 → exitproof-0.3.0}/pyproject.toml +1 -1
- {exitproof-0.2.0 → exitproof-0.3.0}/src/exitproof/__init__.py +11 -3
- exitproof-0.3.0/tests/fixtures/bun_green.txt +7 -0
- exitproof-0.3.0/tests/fixtures/bun_red.txt +22 -0
- exitproof-0.3.0/tests/fixtures/go_green.txt +16 -0
- exitproof-0.3.0/tests/fixtures/go_red.txt +18 -0
- exitproof-0.3.0/tests/fixtures/mocha_green.txt +15 -0
- exitproof-0.3.0/tests/fixtures/mocha_red.txt +32 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/tests/test_parse.py +5 -2
- {exitproof-0.2.0 → exitproof-0.3.0}/.claude-plugin/icon.png +0 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/.claude-plugin/marketplace.json +0 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/.github/workflows/ci.yml +0 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/.github/workflows/publish.yml +0 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/.gitignore +0 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/LICENSE +0 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/Makefile +0 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/docs/demo.py +0 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/docs/demo.svg +0 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/hooks/hooks.json +0 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/src/exitproof/__main__.py +0 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/tests/fixtures/cargo_green.txt +0 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/tests/fixtures/cargo_red.txt +0 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/tests/fixtures/jest_green.txt +0 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/tests/fixtures/jest_red.txt +0 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/tests/fixtures/pytest_empty.txt +0 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/tests/fixtures/pytest_green.txt +0 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/tests/fixtures/pytest_red.txt +0 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/tests/fixtures/unittest_green.txt +0 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/tests/fixtures/unittest_red.txt +0 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/tests/fixtures/vitest_green.txt +0 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/tests/fixtures/vitest_red.txt +0 -0
- {exitproof-0.2.0 → exitproof-0.3.0}/tests/test_cli.py +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "exitproof",
|
|
3
|
-
"
|
|
3
|
+
"displayName": "exitproof",
|
|
4
|
+
"version": "0.3.0",
|
|
4
5
|
"description": "Blocks the agent from finishing while its file changes are not covered by a green test run on the current files.",
|
|
5
6
|
"repository": "https://github.com/RAFAELDCOELHO/exitproof",
|
|
6
7
|
"license": "MIT",
|
|
@@ -16,5 +17,6 @@
|
|
|
16
17
|
"network": {
|
|
17
18
|
"hosts": []
|
|
18
19
|
},
|
|
19
|
-
"icon": ".claude-plugin/icon.png"
|
|
20
|
+
"icon": ".claude-plugin/icon.png",
|
|
21
|
+
"homepage": "https://github.com/RAFAELDCOELHO/exitproof"
|
|
20
22
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: exitproof
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Receipts for test runs: your coding agent can't say 'all tests pass' unless they did, on the current files.
|
|
5
5
|
Project-URL: Homepage, https://github.com/RAFAELDCOELHO/exitproof
|
|
6
6
|
Project-URL: Issues, https://github.com/RAFAELDCOELHO/exitproof/issues
|
|
@@ -166,7 +166,7 @@ exec exitproof check
|
|
|
166
166
|
- `exitproof run -- <cmd>` streams the command's output unchanged and returns its exit code. It then appends one JSON line to `.exitproof/runs.jsonl`: the command, exit code, duration, parsed test counts, and a fingerprint.
|
|
167
167
|
- The fingerprint is a hash of every tracked file plus every untracked file that is not ignored, as they are on disk. Ignored files do not count, and neither do `__pycache__/`, `.pytest_cache/`, `.mypy_cache/`, `.ruff_cache/`, `node_modules/` and `.coverage` anywhere in the tree. Keep other build output (`target/`, `dist/`) in `.gitignore`, or every build makes your runs stale.
|
|
168
168
|
- `exitproof check` looks at the **latest run of each distinct command string**. It fails if any of them exited non-zero or ran on different files than the current ones.
|
|
169
|
-
- Test counts are parsed from pytest, unittest, jest, vitest, `cargo test`, and `go test -v` output
|
|
169
|
+
- Test counts are parsed from pytest, unittest, jest, vitest, `cargo test`, `bun test`, mocha and `go test -v` output, each checked against real captured output in `tests/fixtures/`. Other tools still work; they just show `counts unknown`.
|
|
170
170
|
- `.exitproof/` creates its own `.gitignore`, so it is never committed and never affects the fingerprint.
|
|
171
171
|
- `exitproof clear` forgets all recorded runs.
|
|
172
172
|
|
|
@@ -150,7 +150,7 @@ exec exitproof check
|
|
|
150
150
|
- `exitproof run -- <cmd>` streams the command's output unchanged and returns its exit code. It then appends one JSON line to `.exitproof/runs.jsonl`: the command, exit code, duration, parsed test counts, and a fingerprint.
|
|
151
151
|
- The fingerprint is a hash of every tracked file plus every untracked file that is not ignored, as they are on disk. Ignored files do not count, and neither do `__pycache__/`, `.pytest_cache/`, `.mypy_cache/`, `.ruff_cache/`, `node_modules/` and `.coverage` anywhere in the tree. Keep other build output (`target/`, `dist/`) in `.gitignore`, or every build makes your runs stale.
|
|
152
152
|
- `exitproof check` looks at the **latest run of each distinct command string**. It fails if any of them exited non-zero or ran on different files than the current ones.
|
|
153
|
-
- Test counts are parsed from pytest, unittest, jest, vitest, `cargo test`, and `go test -v` output
|
|
153
|
+
- Test counts are parsed from pytest, unittest, jest, vitest, `cargo test`, `bun test`, mocha and `go test -v` output, each checked against real captured output in `tests/fixtures/`. Other tools still work; they just show `counts unknown`.
|
|
154
154
|
- `.exitproof/` creates its own `.gitignore`, so it is never committed and never affects the fingerprint.
|
|
155
155
|
- `exitproof clear` forgets all recorded runs.
|
|
156
156
|
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "exitproof"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.3.0"
|
|
8
8
|
description = "Receipts for test runs: your coding agent can't say 'all tests pass' unless they did, on the current files."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -16,7 +16,7 @@ import sys
|
|
|
16
16
|
import time
|
|
17
17
|
from pathlib import Path
|
|
18
18
|
|
|
19
|
-
__version__ = "0.
|
|
19
|
+
__version__ = "0.3.0"
|
|
20
20
|
DIR = ".exitproof"
|
|
21
21
|
MAX_BLOCKS = 3 # Stop-hook blocks per turn before letting the agent stop anyway.
|
|
22
22
|
JUNK = {b"__pycache__", b".pytest_cache", b".mypy_cache", b".ruff_cache", b"node_modules", b".coverage"}
|
|
@@ -84,6 +84,9 @@ CARGO = re.compile(r"^test result: \w+\. (\d+) passed; (\d+) failed; (\d+) ignor
|
|
|
84
84
|
GO = re.compile(r"^\s*--- (PASS|FAIL|SKIP):")
|
|
85
85
|
RAN = re.compile(r"^Ran (\d+) tests? in ")
|
|
86
86
|
UNITTEST = re.compile(r"^(OK|FAILED)(?: \((.*)\))?$")
|
|
87
|
+
# bun test ("3 pass" / "1 fail" / "2 skip") and mocha ("3 passing (5ms)" / "1 failing" / "2 pending"), one per line
|
|
88
|
+
TALLY = re.compile(r"^\s*(\d+) (pass|fail|skip|todo|passing|failing|pending)(?: \(\S+\))?$")
|
|
89
|
+
TALLY_KEY = {"pass": "passed", "passing": "passed", "fail": "failed", "failing": "failed"}
|
|
87
90
|
|
|
88
91
|
|
|
89
92
|
def _zero() -> dict:
|
|
@@ -94,7 +97,7 @@ class Counts:
|
|
|
94
97
|
"""Feed output lines; result() gives test counts or None if no known summary was seen."""
|
|
95
98
|
|
|
96
99
|
def __init__(self) -> None:
|
|
97
|
-
self.cargo = self.go = self.generic = self.unittest = None
|
|
100
|
+
self.cargo = self.go = self.generic = self.unittest = self.tally = None
|
|
98
101
|
self.ran: int | None = None
|
|
99
102
|
|
|
100
103
|
def feed(self, line: str) -> None:
|
|
@@ -110,6 +113,11 @@ class Counts:
|
|
|
110
113
|
self.go = self.go or _zero()
|
|
111
114
|
self.go[{"PASS": "passed", "FAIL": "failed", "SKIP": "skipped"}[m[1]]] += 1
|
|
112
115
|
return
|
|
116
|
+
m = TALLY.match(line)
|
|
117
|
+
if m:
|
|
118
|
+
self.tally = self.tally or _zero()
|
|
119
|
+
self.tally[TALLY_KEY.get(m[2], "skipped")] += int(m[1])
|
|
120
|
+
return
|
|
113
121
|
m = RAN.match(line)
|
|
114
122
|
if m:
|
|
115
123
|
self.ran = int(m[1])
|
|
@@ -130,7 +138,7 @@ class Counts:
|
|
|
130
138
|
self.generic["errors" if word.startswith("error") else word] += int(n)
|
|
131
139
|
|
|
132
140
|
def result(self) -> dict | None:
|
|
133
|
-
return self.cargo or self.generic or self.unittest or self.go
|
|
141
|
+
return self.cargo or self.generic or self.unittest or self.tally or self.go
|
|
134
142
|
|
|
135
143
|
|
|
136
144
|
def describe(c: dict | None) -> str:
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
bun test v1.3.12 (700fc117)
|
|
2
|
+
|
|
3
|
+
calc.test.js:
|
|
4
|
+
1 | const { test, expect } = require("bun:test");
|
|
5
|
+
2 | test("a", () => expect(1).toBe(1));
|
|
6
|
+
3 | test("b", () => expect(2).toBe(2));
|
|
7
|
+
4 | test("c", () => expect(3).toBe(3));
|
|
8
|
+
5 | test("d", () => expect(1).toBe(2));
|
|
9
|
+
^
|
|
10
|
+
error: expect(received).toBe(expected)
|
|
11
|
+
|
|
12
|
+
Expected: 2
|
|
13
|
+
Received: 1
|
|
14
|
+
|
|
15
|
+
at <anonymous> (/home/user/proj/calc.test.js:5:27)
|
|
16
|
+
(fail) d [2.33ms]
|
|
17
|
+
|
|
18
|
+
3 pass
|
|
19
|
+
2 skip
|
|
20
|
+
1 fail
|
|
21
|
+
4 expect() calls
|
|
22
|
+
Ran 6 tests across 1 file. [18.00ms]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
=== RUN TestA
|
|
2
|
+
--- PASS: TestA (0.00s)
|
|
3
|
+
=== RUN TestB
|
|
4
|
+
--- PASS: TestB (0.00s)
|
|
5
|
+
=== RUN TestC
|
|
6
|
+
--- PASS: TestC (0.00s)
|
|
7
|
+
=== RUN TestD
|
|
8
|
+
--- PASS: TestD (0.00s)
|
|
9
|
+
=== RUN TestE
|
|
10
|
+
calc_test.go:9: later
|
|
11
|
+
--- SKIP: TestE (0.00s)
|
|
12
|
+
=== RUN TestF
|
|
13
|
+
calc_test.go:10: later
|
|
14
|
+
--- SKIP: TestF (0.00s)
|
|
15
|
+
PASS
|
|
16
|
+
ok example.com/calc 0.007s
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
=== RUN TestA
|
|
2
|
+
--- PASS: TestA (0.00s)
|
|
3
|
+
=== RUN TestB
|
|
4
|
+
--- PASS: TestB (0.00s)
|
|
5
|
+
=== RUN TestC
|
|
6
|
+
--- PASS: TestC (0.00s)
|
|
7
|
+
=== RUN TestD
|
|
8
|
+
calc_test.go:8: 1 != 2
|
|
9
|
+
--- FAIL: TestD (0.00s)
|
|
10
|
+
=== RUN TestE
|
|
11
|
+
calc_test.go:9: later
|
|
12
|
+
--- SKIP: TestE (0.00s)
|
|
13
|
+
=== RUN TestF
|
|
14
|
+
calc_test.go:10: later
|
|
15
|
+
--- SKIP: TestF (0.00s)
|
|
16
|
+
FAIL
|
|
17
|
+
FAIL example.com/calc 0.010s
|
|
18
|
+
FAIL
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
npm warn Unknown user config "allow-scripts". This will stop working in the next major version of npm.
|
|
2
|
+
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
|
|
3
|
+
npm warn deprecated glob@8.1.0: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
calc
|
|
7
|
+
✔ a
|
|
8
|
+
✔ b
|
|
9
|
+
✔ c
|
|
10
|
+
1) d
|
|
11
|
+
- e
|
|
12
|
+
- f
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
3 passing (3ms)
|
|
16
|
+
2 pending
|
|
17
|
+
1 failing
|
|
18
|
+
|
|
19
|
+
1) calc
|
|
20
|
+
d:
|
|
21
|
+
|
|
22
|
+
AssertionError [ERR_ASSERTION]: 1 == 2
|
|
23
|
+
+ expected - actual
|
|
24
|
+
|
|
25
|
+
-1
|
|
26
|
+
+2
|
|
27
|
+
|
|
28
|
+
at Context.<anonymous> (test.js:6:24)
|
|
29
|
+
at process.processImmediate (node:internal/timers:504:21)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
@@ -6,8 +6,7 @@ values below come from those projects, not from the parser:
|
|
|
6
6
|
red = 3 passing, 1 failing, 2 skipped/ignored tests
|
|
7
7
|
green = 3 passing, 2 skipped/ignored tests
|
|
8
8
|
empty = pytest with a test file that defines no tests
|
|
9
|
-
Runners: pytest 8, python -m unittest -v, cargo test, jest, vitest run.
|
|
10
|
-
go test was not captured (go is not installed on the capture machine).
|
|
9
|
+
Runners: pytest 8, python -m unittest -v, cargo test, jest, vitest run, bun test, mocha 10, go test -v.
|
|
11
10
|
"""
|
|
12
11
|
from pathlib import Path
|
|
13
12
|
|
|
@@ -23,6 +22,10 @@ ZERO = {"passed": 0, "failed": 0, "skipped": 0, "errors": 0}
|
|
|
23
22
|
CASES = [(f"{r}_{c}", exp) for r in ("pytest", "unittest", "cargo", "jest", "vitest")
|
|
24
23
|
for c, exp in (("red", RED), ("green", GREEN))]
|
|
25
24
|
CASES.append(("pytest_empty", ZERO))
|
|
25
|
+
# bun test 1.x and mocha 10, captured later: their green projects have 4 passing, 2 skipped/pending
|
|
26
|
+
GREEN4 = {"passed": 4, "failed": 0, "skipped": 2, "errors": 0}
|
|
27
|
+
CASES += [("bun_red", RED), ("bun_green", GREEN4), ("mocha_red", RED), ("mocha_green", GREEN4),
|
|
28
|
+
("go_red", RED), ("go_green", GREEN4)] # go test -v, go 1.x
|
|
26
29
|
|
|
27
30
|
|
|
28
31
|
def parse(name: str):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|