SKY-A111 · AI-code defects
Test newly skipped
A test that ran at the base commit no longer runs after the change, because it gained a skip or expected-failure marker. In JavaScript and TypeScript, a new .only counts too: it focuses one test and stops every other test in its file from running.
- Languages
- Python tests (pytest, unittest), JavaScript/TypeScript tests (Jest, Vitest, Mocha, node:test, Playwright)
- Turned on by
skylos done(compares uncommitted changes withHEAD) orskylos done --base origin/mainfor a pull request; agent hooks run it when the agent stops- Quality gate
- not checked (full and diff scans). Only
skylos donereports it, in itstest_tamperingcheck, which blocks by default: one newly skipped or focused test fails the verdict.skylos cicd risk-reviewcounts it as "tests weakened", which needs a human approval. - Finding type
- review
Why it matters
A skipped test still shows up in the test count, so the run stays green and looks complete. A coding agent that cannot fix a failure can hide it with one decorator line, and the behaviour the test checked goes unchecked from then on.
What Skylos flags
"""Shipping cost rules.""" FREE_SHIPPING_FROM = 50 def shipping_cost(order_total):Removed: if order_total >= FREE_SHIPPING_FROM:Added: if order_total > FREE_SHIPPING_FROM: return 0 return 5Added: import pytestAdded: from shop.shipping import shipping_cost def test_small_order_pays_shipping(): assert shipping_cost(20) == 5 Added: @pytest.mark.skip(reason="flaky")def test_free_shipping_from_threshold(): assert shipping_cost(50) == 0What Skylos leaves alone
Added: import pytestAdded: from shop.shipping import shipping_cost def test_small_order_pays_shipping(): assert shipping_cost(20) == 5 def test_free_shipping_from_threshold(): assert shipping_cost(50) == 0Added: Added: Added: @pytest.mark.skip(reason="needs the carrier sandbox")Added: def test_live_carrier_rates():Added: assert shipping_cost(20, carrier="dhl") > 01 committed file the change leaves alone
Why Skylos leaves it alone
The skipped test is new in this change. SKY-A111 compares tests that existed at the base; a test that never ran before did not stop running. Both existing tests still run.
More languages
TypeScript
Flagged
import { describe, expect, it } from "vitest";import { withVat } from "./price"; describe("withVat", () => {Removed: it("adds 20 percent", () => {Added: it.only("adds 20 percent", () => { expect(withVat(10)).toBe(12); }); it("rounds to cents", () => { expect(withVat(0.99)).toBe(1.19); });});1 committed file the change leaves alone
export function withVat(net: number): number { return Math.round(net * 1.2 * 100) / 100;}Not flagged
import { describe, expect, it } from "vitest";import { withVat } from "./price"; describe("withVat", () => { it("adds 20 percent", () => { expect(withVat(10)).toBe(12); }); it.skip("handles a reduced rate", () => {Removed: expect(withVat(10)).toBe(11);Added: expect(withVat(10, "reduced")).toBe(10.5); });});1 committed file the change leaves alone
Why Skylos leaves it alone
The it.skip test was already skipped at the base; the change only edits its body. Nothing that ran before stops running.
How Skylos decides
- Runs in
skylos done, which compares the working tree (or a pull request's head) with a base commit:HEADby default, the merge base with--base. Its settings come from the base commit, never from the change. - Inventories every test at the base and at head without running anything, and records the markers that stop each one from running. Python:
skip,skipif,xfail,skipIf,skipUnlessandexpectedFailuredecorators, apytestmarkon the module or class,pytest.skip(),pytest.xfail(),pytest.importorskip()orself.skipTest()calls and a raisedSkipTestin the test, and a module-levelpytest.skip(). JavaScript and TypeScript:xit,xtest,xdescribeand.skip,.todo,.fixmeand.failing/.fails/.failon a test or an enclosingdescribe. - Pairs each base test with its head version (same file, class and name, or the same body after a move or rename) and reports a head test that carries a marker its base version did not have.
- Separately reports each
.only,fitorfdescribe(and{ only: true }) at head that was not at the base, even on a new test, because it stops the existing tests in the file from running. A focus that only moved, with the same body, is not new. - Tests written in this change are not compared, so a new test that arrives skipped is not SKY-A111.
How to fix it
Remove the skip and fix the code the test caught: here the free shipping threshold became > instead of >=. If the test is truly flaky, fix the flakiness, or skip it in its own reviewed change that names the cause and an issue to re-enable it.
def shipping_cost(order_total): if order_total >= FREE_SHIPPING_FROM: return 0 return 5When it can be wrong
- A deliberate
skipiffor a platform or an optional dependency, added to an existing test, is reported. Say why in the pull request. - A test made to skip from outside its body, for example by a
conftest.pyhook or apytest.inimarker expression, is not a marker on the test; settings like that are SKY-A112's job. - A JavaScript test whose title is not a plain string literal is not inventoried, so a skip added to it is not seen.
Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.
How to silence it
skylos donefindings ignore# skylos: ignore[...]comments and the[tool.skylos] ignorelist. To stop the check from blocking, commit a lower mode to the base branch first (the change under review cannot loosen its own check):TOML [tool.skylos.done.checks]test_tampering = "advise"