Skip to main content

SKY-A111 · AI-code defects

Test newly skipped

High

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 with HEAD) or skylos done --base origin/main for a pull request; agent hooks run it when the agent stops
Quality gate
not checked (full and diff scans). Only skylos done reports it, in its test_tampering check, which blocks by default: one newly skipped or focused test fails the verdict. skylos cicd risk-review counts it as "tests weakened", which needs a human approval.
Finding type
review
Wrong result? Report itA false positive, a missed case or a confusing message: it goes privately to the founder.

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

A change: the first version of these files is committed, then the edit below is made without committing, and Skylos reviews it as a diff scan (--diff).

shop/shipping.py · Python · changed
"""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 5
tests/test_shipping.py · Python · changed
Added: 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) == 0

What Skylos leaves alone

A change: the first version of these files is committed, then the edit below is made without committing, and Skylos reviews it as a diff scan (--diff).

tests/test_shipping.py · Python · changed
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") > 0
1 committed file the change leaves alone

shop/shipping.py: same as in the flagged example.

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

A change: the first version of these files is committed, then the edit below is made without committing, and Skylos reviews it as a diff scan (--diff).

src/price.test.ts · TypeScript · changed
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
src/price.ts · TypeScript
export function withVat(net: number): number {  return Math.round(net * 1.2 * 100) / 100;}

Not flagged

A change: the first version of these files is committed, then the edit below is made without committing, and Skylos reviews it as a diff scan (--diff).

src/price.test.ts · TypeScript · changed
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

src/price.ts: same as in the flagged example.

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

  1. Runs in skylos done, which compares the working tree (or a pull request's head) with a base commit: HEAD by default, the merge base with --base. Its settings come from the base commit, never from the change.
  2. 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, skipUnless and expectedFailure decorators, a pytestmark on the module or class, pytest.skip(), pytest.xfail(), pytest.importorskip() or self.skipTest() calls and a raised SkipTest in the test, and a module-level pytest.skip(). JavaScript and TypeScript: xit, xtest, xdescribe and .skip, .todo, .fixme and .failing/.fails/.fail on a test or an enclosing describe.
  3. 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.
  4. Separately reports each .only, fit or fdescribe (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.
  5. 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.

Fix · Python
def shipping_cost(order_total):    if order_total >= FREE_SHIPPING_FROM:        return 0    return 5

When it can be wrong

  • A deliberate skipif for 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.py hook or a pytest.ini marker 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 done findings ignore # skylos: ignore[...] comments and the [tool.skylos] ignore list. 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"

From the Skylos rule handbook, Skylos 5.8.0 (commit 5b880b0). All rules.