perf(ci): speed up full WebUI regression gates (#6684)
* perf(ci): speed up full WebUI regression gates * perf(ci): balance browser shards with measured hosted timings
This commit is contained in:
1 parent
e91906bc3a
commit
7782095a85
21 files changed
+821
-346
No files matched your search
@@ -10,7 +10,8 @@ def results(*domains):
|
||||
for domain in ("python", "webui", "tui", "docker", "native")
|
||||
}},
|
||||
**{job: {"result": "skipped"} for job in (
|
||||
"test", "windows_process", "windows_installers", "webui_checks", "webui_browser", "webui", "tui", "docker", "native",
|
||||
"test", "windows_process", "windows_installers", "webui_checks", "webui_build",
|
||||
"webui_unit", "webui_browser", "webui", "tui", "docker", "native",
|
||||
)},
|
||||
}
|
||||
|
||||
@@ -20,12 +21,14 @@ def test_documentation_needs_no_product_jobs():
|
||||
|
||||
|
||||
@pytest.mark.parametrize("result", ["failure", "cancelled", "skipped"])
|
||||
def test_selected_job_must_succeed(result):
|
||||
@pytest.mark.parametrize("job", ["webui_checks", "webui_build", "webui_unit", "webui_browser", "webui"])
|
||||
def test_selected_webui_job_must_succeed(job, result):
|
||||
needs = results("webui")
|
||||
for job in ("webui_checks", "webui_browser", "webui"):
|
||||
needs[job]["result"] = "success"
|
||||
needs["webui_browser"]["result"] = result
|
||||
assert check_results(needs, "pull_request")
|
||||
for name in ("webui_checks", "webui_build", "webui_unit", "webui_browser", "webui"):
|
||||
needs[name]["result"] = "success"
|
||||
assert check_results(needs, "pull_request") == []
|
||||
needs[job]["result"] = result
|
||||
assert check_results(needs, "pull_request") == [f"{job}: required, got {result}"]
|
||||
|
||||
|
||||
def test_native_runs_on_high_risk_pr_but_not_main_push():
|
||||
|
||||
@@ -84,3 +84,28 @@ def test_windows_gateway_stop_checks_run_serially_without_losing_coverage():
|
||||
assert len(steps) == 1
|
||||
assert steps[0]["if"] == "runner.os == 'Windows'"
|
||||
assert "-n" not in steps[0]["run"].split()
|
||||
|
||||
|
||||
def test_webui_full_suite_lanes_run_in_parallel_and_are_all_required():
|
||||
jobs = workflow("ci.yml")["jobs"]
|
||||
lanes = {"webui_checks", "webui_build", "webui_unit", "webui_browser"}
|
||||
assert set(jobs["webui"]["needs"]) == {"changes", *lanes}
|
||||
assert lanes <= set(jobs["required"]["needs"])
|
||||
for name in lanes:
|
||||
assert jobs[name]["needs"] == "changes"
|
||||
strategy = jobs["webui_browser"]["strategy"]
|
||||
assert strategy["fail-fast"] == "false"
|
||||
assert strategy["matrix"]["shard"] == ["1", "2", "3", "4"]
|
||||
|
||||
|
||||
def test_webui_coverage_runs_the_full_suite_and_retains_native_reports():
|
||||
steps = workflow("ci.yml")["jobs"]["webui_unit"]["steps"]
|
||||
run = next(step for step in steps if step.get("name") == "Run all unit tests with original coverage thresholds")
|
||||
assert run["run"] == (
|
||||
"bun run test:coverage --reporter=default --reporter=json "
|
||||
"--outputFile.json=test-results/unit/results.json"
|
||||
)
|
||||
upload = next(step for step in steps if step.get("uses") == "actions/upload-artifact@v4")
|
||||
assert upload["if"] == "always()"
|
||||
assert "webui/coverage/coverage-summary.json" in upload["with"]["path"].splitlines()
|
||||
assert upload["with"]["if-no-files-found"] == "error"
|
||||
Reference in new issue
Block a user