ci: reduce native test compilation and artifact upload overhead

This commit is contained in:
kuddev committed 2026-09-14 20:35:37 +08:00
1 parent 8760eef788
commit 948a427280
6 files changed
+67 -2

No files matched your search

+6 -1
View File
@@ -8,11 +8,16 @@ import sys
def native_commands() -> list[list[str]]:
profile = ["--config", ".github/ci-profile.toml", "--profile", "ci"]
return [
[sys.executable, "-m", "unittest", "discover", "-s", "scripts/tests", "-v"],
[sys.executable, "-m", "unittest", "discover", "-s", "scripts/conformance/tests", "-v"],
[
"cargo", "test", "--locked", "--workspace",
"cargo", "check", "--locked", *profile, "-p", "nebula", "--bin", "pebrel",
"--features", "gpui-shell", "--timings",
],
[
"cargo", "test", "--locked", *profile, "--workspace",
"--features", "nebula/gpui-test-support", "--timings",
],
]
+22 -1
View File
@@ -1,6 +1,8 @@
from __future__ import annotations
import subprocess
from pathlib import Path
import tomllib
import unittest
from unittest.mock import patch
@@ -9,7 +11,7 @@ from scripts.ci_native_tests import main, native_commands
class NativeSuiteTests(unittest.TestCase):
def test_full_workspace_and_interactions_share_one_unfiltered_invocation(self):
rust = [command for command in native_commands() if command[0] == "cargo"]
rust = [command for command in native_commands() if command[:2] == ["cargo", "test"]]
self.assertEqual(len(rust), 1)
command = rust[0]
self.assertEqual(command[1], "test")
@@ -21,6 +23,25 @@ class NativeSuiteTests(unittest.TestCase):
self.assertNotIn("--skip", command)
self.assertNotIn("--", command)
def test_actual_product_feature_graph_is_also_checked(self):
checks = [command for command in native_commands() if command[:2] == ["cargo", "check"]]
self.assertEqual(len(checks), 1)
command = checks[0]
self.assertEqual(command[command.index("--features") + 1], "gpui-shell")
self.assertEqual(command[command.index("--bin") + 1], "pebrel")
def test_fast_test_profile_preserves_runtime_checks_and_resets_named_overrides(self):
root = Path(__file__).resolve().parents[2]
config = tomllib.loads((root / ".github/ci-profile.toml").read_text())
workspace = tomllib.loads((root / "Cargo.toml").read_text())
profile = config["profile"]["ci"]
self.assertEqual(profile["inherits"], "dev")
self.assertTrue(profile["debug-assertions"])
self.assertTrue(profile["overflow-checks"])
for package in workspace["profile"]["dev"]["package"]:
self.assertEqual(profile["package"][package]["opt-level"], 0)
self.assertNotIn("release", config["profile"])
def test_both_python_test_roots_are_discovered(self):
suites = [command for command in native_commands() if "unittest" in command]
self.assertEqual(