SKY-A112 · AI-code defects
Test settings loosened
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 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. A quiet GitHub Actions test step is also listed under thesilenced_checkscheck, which only advises by default.skylos cicd risk-reviewcounts it as "tests weakened", which needs a human approval. - Finding type
- review
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
def refund_amount(paid, days_since_purchase):Removed: if days_since_purchase > 30:Added: if days_since_purchase > 60: return 0 return paid[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
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) == 0What Skylos leaves alone
[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
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
{ "name": "checkout-web", "private": true, "scripts": {Removed: "test": "jest"Added: "test": "jest || true" }}1 committed file the change leaves alone
const { total } = require("./total"); test("sums line items", () => { expect(total([2, 3])).toBe(5);});Not flagged
{ "name": "checkout-web", "private": true, "scripts": {Removed: "test": "jest"Added: "test": "jest --ci --coverage" }}1 committed file the change leaves alone
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
- 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. - 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 andpackage.json, each compared with its base version. - pytest: reports new
addoptsentries 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; newnorecursedirs; narrowertestpathsor test-name patterns; andxfail_strictturned off. A new ignore that matches no existing test is skipped. conftest.py: a new or changed hook that can drop tests or change their results (pytest_collection_modifyitems,pytest_runtest_makereport,pytest_report_teststatusand others), newcollect_ignoreentries, and a changed helper that such a hook depends on.- Coverage:
fail_underlowered or removed, and newomitpatterns. Jest and Vitest: new ignore patterns that drop existing test files, narrower match settings,passWithNoTeststurned on, lower coverage thresholds, and apackage.jsontest script that gains a filter, a new||fallback such as|| true, or stops running a test runner. - 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.
[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 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"