CI: one tested rule for code changes; review fixes
From the review of this PR: - What counts as code lives only in scripts/ci/affected.py now: nothing selected and not full means no code changed, on pull requests and pushes to main alike. The untested bash copy in Select checks disagreed with it. Root files and folders a crate embeds now select that crate (the licence texts and NOTICE: the engine; skills/: the MCP server's tests), where before a change to them ran no test at all. Other workflows and the bots' scripts select nothing. - A push to main skips the native jobs only when nothing a build reads changed since the last push to main whose run passed. Comparing with the push just before was unsafe: a newer push cancels a waiting run, so that commit may never have been tested. - Fail fast applies to pull requests only. On main, nightly and Run workflow the test build and the shards run regardless of the repository checks, so the action matrix and property tests that hang off Build tests keep their signal. Doc tests (main and nightly only now) no longer wait for the checks. - tests/robustness/ turns on the goldens, so a change to goldens.json runs the seed tests. - tests/oracle/ no longer selects the kernel, which never reads it. - The workflow header and CONTRIBUTING describe what main and pull requests now run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QWhMwdqJYQKQq8RCLSL1LT
This commit is contained in:
@@ -52,6 +52,12 @@ class Synthetic(unittest.TestCase):
|
||||
def test_docs_only_selects_nothing(self):
|
||||
self.assertEqual(affected.select(SYNTH, ["docs/book/a.md", "README.md", "packaging/x.yml"]), (False, []))
|
||||
|
||||
def test_no_code_paths_select_nothing(self):
|
||||
# What CI reads as "no code changed", on pull requests and pushes to main alike.
|
||||
for p in [".github/workflows/docker.yml", ".github/ISSUE_TEMPLATE/bug.yml", "scripts/claim/claim.js",
|
||||
"scripts/triage/triage.test.js", "vendor/README.md", "SECURITY.md"]:
|
||||
self.assertEqual(affected.select(SYNTH, [p]), (False, []), p)
|
||||
|
||||
|
||||
class RealWorkspace(unittest.TestCase):
|
||||
@classmethod
|
||||
@@ -78,11 +84,21 @@ class RealWorkspace(unittest.TestCase):
|
||||
self.assertNotIn("solidcraft-kernel", pk)
|
||||
self.assertNotIn("solidcraft-render", pk)
|
||||
|
||||
def test_oracle_cases_select_the_cli_and_xtask(self):
|
||||
def test_oracle_cases_select_the_cli_and_xtask_not_the_kernel(self):
|
||||
full, pk = affected.select(self.meta, ["tests/oracle/box/recipe.json"])
|
||||
self.assertFalse(full)
|
||||
self.assertIn("solidcraft-cli", pk)
|
||||
self.assertIn("xtask", pk)
|
||||
self.assertNotIn("solidcraft-kernel", pk)
|
||||
|
||||
def test_embedded_root_files_select_their_crate(self):
|
||||
for path, pkg in [("ATTRIBUTION.md", "solidcraft-ui-egui"), ("LICENSE-MIT", "solidcraft-engine"),
|
||||
("NOTICE", "solidcraft-engine"), ("THIRD-PARTY-LICENSES.txt", "solidcraft-engine"),
|
||||
("skills/solidcraft-modeling/SKILL.md", "solidcraft-mcp")]:
|
||||
full, pk = affected.select(self.meta, [path])
|
||||
self.assertFalse(full, path)
|
||||
self.assertIn(pkg, pk, path)
|
||||
self.assertNotIn("solidcraft-kernel", pk, path)
|
||||
|
||||
def test_unmapped_test_data_selects_full(self):
|
||||
self.assertEqual(affected.select(self.meta, ["tests/tools/x.json"]), (True, []))
|
||||
|
||||
Reference in New Issue
Block a user