Constrain core validation memory usage
Some checks failed
Some checks failed
This commit is contained in:
@@ -70,6 +70,8 @@ class EnvironmentResolutionTests(unittest.TestCase):
|
||||
class GatePlanTests(unittest.TestCase):
|
||||
def test_core_contains_no_workspace_or_runtime_gates(self) -> None:
|
||||
keys = {gate.key for gate in validate.build_gate_plan("core")}
|
||||
self.assertIn("engine-restore", keys)
|
||||
self.assertIn("engine-cli-build", keys)
|
||||
self.assertIn("engine-tests", keys)
|
||||
self.assertIn("python-test_validate", keys)
|
||||
self.assertNotIn("sys4-corpus-validate", keys)
|
||||
@@ -77,6 +79,26 @@ class GatePlanTests(unittest.TestCase):
|
||||
self.assertNotIn("age-cli-sweep", keys)
|
||||
engine = next(gate for gate in validate.build_gate_plan("core") if gate.key == "engine-tests")
|
||||
self.assertIn("Category!=Workspace", engine.command)
|
||||
self.assertIn("--no-restore", engine.command)
|
||||
self.assertIn("-m:1", engine.command)
|
||||
self.assertIn("-p:BuildInParallel=false", engine.command)
|
||||
self.assertEqual(validate.LOW_MEMORY_DOTNET_ENVIRONMENT, engine.environment)
|
||||
self.assertIn(
|
||||
"engine/Age.Engine.Tests/Age.Engine.Tests.csproj",
|
||||
engine.command,
|
||||
)
|
||||
cli = next(
|
||||
gate for gate in validate.build_gate_plan("core") if gate.key == "engine-cli-build"
|
||||
)
|
||||
self.assertIn("engine/Age.Cli/Age.Cli.csproj", cli.command)
|
||||
self.assertIn("--no-restore", cli.command)
|
||||
self.assertIn("-m:1", cli.command)
|
||||
self.assertEqual(validate.LOW_MEMORY_DOTNET_ENVIRONMENT, cli.environment)
|
||||
restore = next(
|
||||
gate for gate in validate.build_gate_plan("core") if gate.key == "engine-restore"
|
||||
)
|
||||
self.assertIn("--disable-parallel", restore.command)
|
||||
self.assertEqual(validate.LOW_MEMORY_DOTNET_ENVIRONMENT, restore.environment)
|
||||
|
||||
def test_workspace_extends_core(self) -> None:
|
||||
core = {gate.key for gate in validate.build_gate_plan("core")}
|
||||
@@ -90,6 +112,9 @@ class GatePlanTests(unittest.TestCase):
|
||||
if gate.key == "engine-workspace-tests"
|
||||
)
|
||||
self.assertIn("Category=Workspace", installed.command)
|
||||
self.assertIn("--no-restore", installed.command)
|
||||
self.assertIn("-m:1", installed.command)
|
||||
self.assertEqual(validate.LOW_MEMORY_DOTNET_ENVIRONMENT, installed.environment)
|
||||
|
||||
def test_runtime_requires_resolved_paths(self) -> None:
|
||||
with self.assertRaisesRegex(ValueError, "resolved Godot"):
|
||||
|
||||
@@ -55,6 +55,12 @@ WORKSPACE_GENERATED_INPUTS = (
|
||||
paths.BUILD / "callscript-names.json",
|
||||
paths.BUILD / "scjump-decisions.json",
|
||||
)
|
||||
LOW_MEMORY_DOTNET_ENVIRONMENT = (
|
||||
("DOTNET_CLI_USE_MSBUILD_SERVER", "0"),
|
||||
("MSBUILDDISABLENODEREUSE", "1"),
|
||||
("DOTNET_gcServer", "0"),
|
||||
("DOTNET_GCConserveMemory", "9"),
|
||||
)
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@@ -156,15 +162,45 @@ def build_gate_plan(
|
||||
)
|
||||
for test in CORE_TESTS
|
||||
)
|
||||
gates.append(
|
||||
Gate(
|
||||
"engine-restore",
|
||||
".NET engine restore",
|
||||
(
|
||||
"dotnet", "restore", "engine/AgeEngine.sln", "--nologo",
|
||||
"--verbosity", "minimal", "--disable-parallel",
|
||||
"-p:RestoreDisableParallel=true",
|
||||
),
|
||||
300,
|
||||
LOW_MEMORY_DOTNET_ENVIRONMENT,
|
||||
)
|
||||
)
|
||||
gates.append(
|
||||
Gate(
|
||||
"engine-cli-build",
|
||||
".NET engine CLI build",
|
||||
(
|
||||
"dotnet", "build", "engine/Age.Cli/Age.Cli.csproj", "--no-restore", "--nologo",
|
||||
"--verbosity", "minimal", "-m:1", "-p:UseSharedCompilation=false",
|
||||
"-p:BuildInParallel=false", "-p:DebugType=None", "-p:DebugSymbols=false",
|
||||
),
|
||||
300,
|
||||
LOW_MEMORY_DOTNET_ENVIRONMENT,
|
||||
)
|
||||
)
|
||||
gates.append(
|
||||
Gate(
|
||||
"engine-tests",
|
||||
".NET engine core tests",
|
||||
(
|
||||
"dotnet", "test", "engine/AgeEngine.sln", "--nologo", "--verbosity", "minimal",
|
||||
"--filter", "Category!=Workspace", "-p:UseSharedCompilation=false",
|
||||
"dotnet", "test", "engine/Age.Engine.Tests/Age.Engine.Tests.csproj",
|
||||
"--no-restore", "--nologo",
|
||||
"--verbosity", "minimal", "--filter", "Category!=Workspace", "-m:1",
|
||||
"-p:UseSharedCompilation=false", "-p:BuildInParallel=false",
|
||||
"-p:DebugType=None", "-p:DebugSymbols=false",
|
||||
),
|
||||
300,
|
||||
LOW_MEMORY_DOTNET_ENVIRONMENT,
|
||||
)
|
||||
)
|
||||
|
||||
@@ -174,10 +210,14 @@ def build_gate_plan(
|
||||
"engine-workspace-tests",
|
||||
".NET installed-data and native-oracle tests",
|
||||
(
|
||||
"dotnet", "test", "engine/AgeEngine.sln", "--nologo", "--verbosity", "minimal",
|
||||
"--filter", "Category=Workspace", "-p:UseSharedCompilation=false",
|
||||
"dotnet", "test", "engine/Age.Engine.Tests/Age.Engine.Tests.csproj",
|
||||
"--no-restore", "--nologo",
|
||||
"--verbosity", "minimal", "--filter", "Category=Workspace", "-m:1",
|
||||
"-p:UseSharedCompilation=false", "-p:BuildInParallel=false",
|
||||
"-p:DebugType=None", "-p:DebugSymbols=false",
|
||||
),
|
||||
300,
|
||||
LOW_MEMORY_DOTNET_ENVIRONMENT,
|
||||
)
|
||||
)
|
||||
gates.append(
|
||||
|
||||
Reference in New Issue
Block a user