@jesdi/skills 0.0.103 → 0.0.104
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/package.json
CHANGED
|
@@ -154,3 +154,29 @@ def test_ctrl_c_removes_the_worktree(tmp_path, home, cache):
|
|
|
154
154
|
finally:
|
|
155
155
|
reap(proc)
|
|
156
156
|
assert len(worktrees(repo)) == 1
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
DRAIN = """import subprocess, sys
|
|
160
|
+
sys.path.insert(0, {skill!r})
|
|
161
|
+
from weigh_mutation import _drain
|
|
162
|
+
chatty = "import signal, sys\\nsignal.signal(signal.SIGINT, signal.SIG_IGN)\\nwhile True: print('x' * 100, flush=True)"
|
|
163
|
+
proc = subprocess.Popen([sys.executable, "-c", chatty], stdout=subprocess.PIPE, text=True)
|
|
164
|
+
try:
|
|
165
|
+
_drain(proc)
|
|
166
|
+
except KeyboardInterrupt:
|
|
167
|
+
proc.kill()
|
|
168
|
+
sys.exit(130)
|
|
169
|
+
"""
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
def test_a_ctrl_c_between_two_reads_still_stops_the_wait():
|
|
173
|
+
"""mutmut that keeps printing and ignores Ctrl-C: a plain communicate() misses about one SIGINT in five, here 10 in a row stop."""
|
|
174
|
+
script = DRAIN.format(skill=str(WEIGH.parent))
|
|
175
|
+
for _ in range(10):
|
|
176
|
+
proc = subprocess.Popen([sys.executable, "-c", script], start_new_session=True)
|
|
177
|
+
try:
|
|
178
|
+
time.sleep(0.5)
|
|
179
|
+
os.kill(proc.pid, signal.SIGINT)
|
|
180
|
+
assert proc.wait(timeout=5) == 130
|
|
181
|
+
finally:
|
|
182
|
+
reap(proc)
|
|
@@ -153,6 +153,16 @@ def _matrix(python, repo, wt, env, per_function):
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
|
|
156
|
+
def _drain(proc):
|
|
157
|
+
"""proc's stdout once it exits. It wakes every second: a blocking read misses a Ctrl-C that lands between two reads of
|
|
158
|
+
mutmut's output, and mutmut can hang after its own Ctrl-C, so the run would wait forever."""
|
|
159
|
+
while True:
|
|
160
|
+
try:
|
|
161
|
+
return proc.communicate(timeout=1)[0]
|
|
162
|
+
except subprocess.TimeoutExpired:
|
|
163
|
+
pass
|
|
164
|
+
|
|
165
|
+
|
|
156
166
|
def score(python, repo, overlay, per_function=3):
|
|
157
167
|
"""The pinned mutmut run on HEAD and its kill matrix, as a dict: score (percent of all mutants killed), pseudo_tested
|
|
158
168
|
(percent of the covered functions whose mutants all survived), sampled (mutant ids: per_function per function on
|
|
@@ -170,7 +180,7 @@ def score(python, repo, overlay, per_function=3):
|
|
|
170
180
|
_configure(wt, python_files(wt))
|
|
171
181
|
env = {**os.environ, "PYTHONPATH": str(mutmut_overlay(python)), "PYTHONDONTWRITEBYTECODE": "1"}
|
|
172
182
|
proc = subprocess.Popen([str(python), "-m", "mutmut", "run"], cwd=wt, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
|
|
173
|
-
out = proc
|
|
183
|
+
out = _drain(proc)
|
|
174
184
|
if proc.returncode:
|
|
175
185
|
raise SetupError(f"mutmut run exited {proc.returncode}:\n" + out)
|
|
176
186
|
exported = subprocess.run([str(python), "-m", "mutmut", "export-cicd-stats"], cwd=wt, env=env, capture_output=True, text=True)
|
package/skills-manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"generatedAt": "2026-11-
|
|
3
|
+
"generatedAt": "2026-11-25T02:41:02.281Z",
|
|
4
4
|
"skills": [
|
|
5
5
|
{
|
|
6
6
|
"name": "agents-wayfinder",
|
|
@@ -112,8 +112,8 @@
|
|
|
112
112
|
},
|
|
113
113
|
{
|
|
114
114
|
"name": "test-weigh-in",
|
|
115
|
-
"version": "0.1.
|
|
116
|
-
"hash": "sha256-
|
|
115
|
+
"version": "0.1.5",
|
|
116
|
+
"hash": "sha256-eaf67863d41bfeb1ac8a2d98888a9e92aafe0feb78bc498ac8ef6fba7f8bde68",
|
|
117
117
|
"description": "Measure a Python/pytest suite and score it on five pillars (Protection against regressions, Resistance to refactoring, Fast feedback, Maintainability, Economy), writing a JSON snapshot and a static HTML dashboard. Read-only. Use when the user asks to weigh, measure or score their test suite."
|
|
118
118
|
},
|
|
119
119
|
{
|