Skip to main content

SKY-A112 · AI-code defects

Test settings loosened

High

The change makes the test run check less without editing a single test: it deselects or ignores tests in the pytest options, adds a conftest.py hook that can drop tests or rewrite their results, lowers a coverage floor, or lets a test command fail quietly. Each loosening the change adds is one finding.

Languages
pytest settings (pyproject.toml, pytest.ini, tox.ini, setup.cfg, conftest.py), coverage settings, Jest and Vitest configs, package.json test scripts, GitHub Actions test steps
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. A quiet GitHub Actions test step is also listed under the silenced_checks check, which only advises by default. 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

The test files still look intact, so a reviewer who checks the tests sees nothing wrong. Yet the failing test no longer runs, or its failure no longer fails the build, and the suite reports green.

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).

refunds/policy.py · Python · changed
def refund_amount(paid, days_since_purchase):Removed:     if days_since_purchase > 30:Added:     if days_since_purchase > 60:        return 0    return paid
pyproject.toml · TOML · changed
[project]name = "refunds"version = "1.4.0" [tool.pytest.ini_options]testpaths = ["tests"]Removed: addopts = "-q"Added: addopts = "-q --deselect tests/test_policy.py::test_no_refund_after_30_days"
1 committed file the change leaves alone
tests/test_policy.py · Python
from refunds.policy import refund_amount  def test_full_refund_within_30_days():    assert refund_amount(80, 10) == 80  def test_no_refund_after_30_days():    assert refund_amount(80, 31) == 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).

pyproject.toml · TOML · changed
[project]name = "refunds"version = "1.4.0" [tool.pytest.ini_options]testpaths = ["tests"]Removed: addopts = "-q"Added: addopts = "-q -p no:cacheprovider"
2 committed files the change leaves alone

refunds/policy.py: same as in the flagged example.

tests/test_policy.py: same as in the flagged example.

Why Skylos leaves it alone

The new option turns off a pytest plugin, but cacheprovider only stores state between runs; every test still runs and still counts. Skylos treats turning off cacheprovider, randomly, random_order, xdist, sugar, rerunfailures and flaky as harmless.

More languages

JSON

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).

package.json · JSON · changed
{  "name": "checkout-web",  "private": true,  "scripts": {Removed:     "test": "jest"Added:     "test": "jest || true"  }}
1 committed file the change leaves alone
src/total.test.js · JavaScript
const { total } = require("./total"); test("sums line items", () => {  expect(total([2, 3])).toBe(5);});

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).

package.json · JSON · changed
{  "name": "checkout-web",  "private": true,  "scripts": {Removed:     "test": "jest"Added:     "test": "jest --ci --coverage"  }}
1 committed file the change leaves alone

src/total.test.js: same as in the flagged example.

Why Skylos leaves it alone

The script gained options, but neither filters which tests run nor lets a failure pass: --ci and --coverage change how Jest runs and reports, not what it checks.

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. Reads only changed settings files: pyproject.toml, pytest.ini, .pytest.ini, tox.ini, setup.cfg, .coveragerc, conftest.py, .github/workflows/*.yml, Jest and Vitest configs and package.json, each compared with its base version.
  3. pytest: reports new addopts entries that select or skip tests (-k, -m, --deselect, --ignore, --ignore-glob, --lf, --sw, --co), turn off a plugin other than a known harmless one, or load the repository's own plugin; a lower --cov-fail-under; new norecursedirs; narrower testpaths or test-name patterns; and xfail_strict turned off. A new ignore that matches no existing test is skipped.
  4. conftest.py: a new or changed hook that can drop tests or change their results (pytest_collection_modifyitems, pytest_runtest_makereport, pytest_report_teststatus and others), new collect_ignore entries, and a changed helper that such a hook depends on.
  5. Coverage: fail_under lowered or removed, and new omit patterns. Jest and Vitest: new ignore patterns that drop existing test files, narrower match settings, passWithNoTests turned on, lower coverage thresholds, and a package.json test script that gains a filter, a new || fallback such as || true, or stops running a test runner.
  6. GitHub Actions: a step that runs tests and newly gets continue-on-error: true (on the step or its job) or a script that swallows its failure (|| true, set +e, exit 0). A brand-new advisory test step is not a loosening.

How to fix it

Remove the deselect and fix the code: here the refund window moved from 30 to 60 days without anyone deciding it should. If a test really must stop running, mark that one test with a reason in the test file, where reviewers see it, rather than hiding it in shared settings.

Fix · TOML
[tool.pytest.ini_options]testpaths = ["tests"]addopts = "-q"

When it can be wrong

  • A deliberate split, such as moving slow tests behind -m "not slow" while CI runs them in another job, is reported. Say so in the pull request.
  • Settings built at run time (a Jest config returned by a function or spread from another object, options passed on the command line) are not read, so loosening done there is not seen.
  • A brand-new config file only counts when it leaves out tests that already existed.

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.