Skip to content

A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.

Nightly: leave the two local-art EditMode tests out of the run (Refs #2655) (#2736)

Beri3eaa9637974d
diff --git a/changelog.d/laneUO-2655.md b/changelog.d/laneUO-2655.md
new file mode 100644
index 000000000..f32ea0966
--- /dev/null
+++ b/changelog.d/laneUO-2655.md
@@ -0,0 +1,5 @@
+### Changed
+- The nightly's EditMode run leaves out the two tests that compare against gitignored local art
+ (`HexModelMeshTests.TownAliasesFaceAsTheirSandboxPrefabs`, `HexUnitTests.CollectionFiguresFaceAsTheirProtoFigures`,
+ now in a `LocalOnly` category), so its skip count is only the `[Explicit]` tests (Refs #2655). A local run still
+ runs them.
diff --git a/tools/nightly.py b/tools/nightly.py
index cfa36556d..c380d8e0e 100644
--- a/tools/nightly.py
+++ b/tools/nightly.py
@@ -223,6 +223,9 @@ def preflight(cfg: Config, state: State, runner: Runner, gh: GitHub, *, job: Pat
# --- gates, Unity and the full EditMode run ---------------------------------------------------------------------
WARM_UP_OK = "UnityMcpGuard warm-up: gate defines in place"
+# The EditMode tests that compare against gitignored local art (Category in HexModelMeshTests/HexUnitTests): a clean
+# clone always ignores them, so the nightly leaves them out and its skip count is only the [Explicit] tests (#2655).
+LOCAL_ONLY = "LocalOnly"
def _limit(night: Night, minutes: float) -> float:
@@ -380,7 +383,8 @@ def run_editmode(night: Night, runner: Runner) -> None:
raise Refused("editmode", f"the Unity warm-up failed or did not confirm (exit {warm_code})", log=warm_out)
check_window(night)
argv = unity_argv(night, ["-buildTarget", "OSXUniversal", "-runTests", "-testPlatform", "EditMode",
- "-testResults", str(xml), "-logFile", str(night.run_dir / "editmode.log")],
+ "-testCategory", "!" + LOCAL_ONLY, "-testResults", str(xml),
+ "-logFile", str(night.run_dir / "editmode.log")],
webgl=False)
edit_out = night.run_dir / "editmode.out"
try:
diff --git a/tools/tests/test_nightly.py b/tools/tests/test_nightly.py
index 749b96311..6b6bf15b0 100644
--- a/tools/tests/test_nightly.py
+++ b/tools/tests/test_nightly.py
@@ -659,6 +659,17 @@ def test_editmode_needs_tests_and_no_failures_and_never_quits(night, env):
assert restore[0] == nightly.RESTORE_ARGV
+def test_editmode_leaves_out_the_tests_that_need_gitignored_local_assets(night, env):
+ # #2655 item 6: the nightly's clean clone never has them, so they only padded its skip count.
+ r = editmode_runner(night)
+ nightly.run_editmode(night, r)
+ tests = r.envs[1][0]
+ assert tests[tests.index("-testCategory") + 1] == "!" + nightly.LOCAL_ONLY
+ tiles = Path(__file__).resolve().parents[2] / "unity/Assets/Editor/HexTiles/Tests"
+ for name in ("HexModelMeshTests.cs", "HexUnitTests.cs"):
+ assert f'[Test, Category("{nightly.LOCAL_ONLY}")]' in (tiles / name).read_text(encoding="utf-8"), name
+
+
def test_editmode_with_zero_tests_refuses_and_still_restores_settings(night, env):
r = editmode_runner(night, xml='<test-run total="0" passed="0" failed="0"/>')
with pytest.raises(Refused) as e:
diff --git a/unity/Assets/Editor/HexTiles/Tests/HexModelMeshTests.cs b/unity/Assets/Editor/HexTiles/Tests/HexModelMeshTests.cs
index 469fe3317..191c86284 100644
--- a/unity/Assets/Editor/HexTiles/Tests/HexModelMeshTests.cs
+++ b/unity/Assets/Editor/HexTiles/Tests/HexModelMeshTests.cs
@@ -120,7 +120,7 @@ public class HexModelMeshTests
/// prefab's vertices lie nearest the town model's as drawn (both in the unit frame), unless another turn is within
/// <see cref="FacingMargin"/> of it (a near-symmetric block, where the close shots decide). Mirrors are reported, not
/// tested: the renderer cannot draw a negative scale.</summary>
- [Test]
+ [Test, Category("LocalOnly")] // needs gitignored local art; the nightly leaves it out (#2655)
public void TownAliasesFaceAsTheirSandboxPrefabs()
{
var wrong = new List<string>(); int compared = 0;
diff --git a/unity/Assets/Editor/HexTiles/Tests/HexUnitTests.cs b/unity/Assets/Editor/HexTiles/Tests/HexUnitTests.cs
index 2a3342216..fc57503ac 100644
--- a/unity/Assets/Editor/HexTiles/Tests/HexUnitTests.cs
+++ b/unity/Assets/Editor/HexTiles/Tests/HexUnitTests.cs
@@ -70,7 +70,7 @@ public class HexUnitTests
/// <summary>Each Collection figure drawn faces as its proto figure faced (the units and tiles turn figures by that
/// frame): of the four quarter turns, the proto's vertices lie nearest the drawn figure's as they are, unless another
/// turn is within a fifth of it. Ignored without the local proto figures.</summary>
- [Test]
+ [Test, Category("LocalOnly")] // needs gitignored local art; the nightly leaves it out (#2655)
public void CollectionFiguresFaceAsTheirProtoFigures()
{
var wrong = new List<string>(); int compared = 0;