|
19 | 19 | pipeline.template.yml and the docstring on `trim_pipeline` below.
|
20 | 20 | """
|
21 | 21 |
|
| 22 | +import subprocess |
22 | 23 | import sys
|
23 | 24 | from pathlib import Path
|
24 | 25 |
|
25 |
| -import yaml |
26 |
| - |
27 | 26 | import materialize.cli.mzcompose
|
28 | 27 |
|
29 | 28 |
|
30 | 29 | 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")] |
41 | 32 |
|
42 | 33 | for (composition, workflow) in tests:
|
43 |
| - print(f"==> Running workflow {workflow} in {composition}") |
44 | 34 | materialize.cli.mzcompose.main(
|
45 | 35 | [
|
46 |
| - "run", |
47 |
| - workflow, |
48 |
| - "--coverage", |
49 | 36 | "--find",
|
50 | 37 | composition,
|
| 38 | + "--coverage", |
| 39 | + "run", |
| 40 | + workflow, |
51 | 41 | ]
|
52 | 42 | )
|
53 | 43 | materialize.cli.mzcompose.main(
|
54 | 44 | [
|
55 |
| - "down", |
56 |
| - "-v", |
57 |
| - "--coverage", |
58 | 45 | "--find",
|
59 | 46 | composition,
|
| 47 | + "down", |
| 48 | + "-v", |
60 | 49 | ]
|
61 | 50 | )
|
62 | 51 |
|
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 | + ) |
64 | 74 |
|
65 | 75 | return 0
|
66 | 76 |
|
|
0 commit comments