Skip to content

Commit ba58d69

Browse files
committed
ci: re-enable coverage in nightly
We can now use the stable Rust toolchain and hopefully this no longer suffers from the aforementioned OOMs. Just fast sqllogictests for now, with coverage in the raw JSON format until we figure out what we want to do with it.
1 parent ecf0ef0 commit ba58d69

File tree

2 files changed

+32
-22
lines changed

2 files changed

+32
-22
lines changed

ci/nightly/coverage.py

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,48 +19,58 @@
1919
pipeline.template.yml and the docstring on `trim_pipeline` below.
2020
"""
2121

22+
import subprocess
2223
import sys
2324
from pathlib import Path
2425

25-
import yaml
26-
2726
import materialize.cli.mzcompose
2827

2928

3029
def main() -> int:
31-
with open(Path(__file__).parent.parent / "test" / "pipeline.template.yml") as f:
32-
pipeline = yaml.safe_load(f)
33-
34-
tests = []
35-
36-
for step in pipeline["steps"]:
37-
for plugin in step.get("plugins", []):
38-
for plugin_name, plugin_config in plugin.items():
39-
if plugin_name == "./ci/plugins/mzcompose":
40-
tests.append((plugin_config["composition"], plugin_config["run"]))
30+
# Just the fast sqllogictests, for now
31+
tests = [("sqllogictest", "default")]
4132

4233
for (composition, workflow) in tests:
43-
print(f"==> Running workflow {workflow} in {composition}")
4434
materialize.cli.mzcompose.main(
4535
[
46-
"run",
47-
workflow,
48-
"--coverage",
4936
"--find",
5037
composition,
38+
"--coverage",
39+
"run",
40+
workflow,
5141
]
5242
)
5343
materialize.cli.mzcompose.main(
5444
[
55-
"down",
56-
"-v",
57-
"--coverage",
5845
"--find",
5946
composition,
47+
"down",
48+
"-v",
6049
]
6150
)
6251

63-
# TODO: gather and combine coverage information.
52+
# NB: mzcompose _munge_services() sets LLVM_PROFILE_FILE
53+
subprocess.run(
54+
[
55+
"rust-profdata",
56+
"merge",
57+
"-sparse",
58+
*Path("test/sqllogictest/coverage").glob("sqllogictest*.profraw"),
59+
"-o",
60+
"sqllogictest.profdata",
61+
]
62+
)
63+
with open("coverage-sqllogictest.json", "w") as out:
64+
subprocess.run(
65+
[
66+
"rust-cov",
67+
"export",
68+
"./target-xcompile/x86_64-unknown-linux-gnu/release/sqllogictest",
69+
"./target-xcompile/x86_64-unknown-linux-gnu/release/clusterd",
70+
"--instr-profile=sqllogictest.profdata",
71+
],
72+
stdout=out,
73+
)
6474

6575
return 0
6676

ci/nightly/pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ steps:
9797
- id: coverage
9898
label: Code coverage
9999
timeout_in_minutes: 240
100-
command: bin/ci-builder run nightly bin/pyactivate -m ci.nightly.coverage
100+
command: bin/ci-builder run stable bin/pyactivate -m ci.nightly.coverage
101+
artifact_paths: coverage-*.json
101102
agents:
102103
queue: linux-x86_64
103-
skip: Disabled due to persistent OOMs when linking
104104

105105
- id: kafka-matrix
106106
label: Kafka smoke test against previous Kafka versions

0 commit comments

Comments
 (0)