Skip to content

Commit 38b1b3a

Browse files
committed
mzcompose: don't duplicate coverage configuration
Without this, we end up mutating the same config again, which then causes docker compose to fail with: services.sqllogictest.environment array items[1,2] must be unique
1 parent 85d2efb commit 38b1b3a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

misc/python/materialize/mzcompose/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,16 +185,19 @@ def _munge_services(
185185
if "allow_host_ports" in config:
186186
config.pop("allow_host_ports")
187187

188-
if self.repo.rd.coverage:
188+
coverage_volume = "./coverage:/coverage"
189+
if self.repo.rd.coverage and coverage_volume not in config.get(
190+
"volumes", []
191+
):
189192
# Emit coverage information to a file in a directory that is
190193
# bind-mounted to the "coverage" directory on the host. We
191194
# inject the configuration to all services for simplicity, but
192195
# this only have an effect if the service runs instrumented Rust
193196
# binaries.
197+
config.setdefault("volumes", []).append(coverage_volume)
194198
config.setdefault("environment", []).append(
195199
f"LLVM_PROFILE_FILE=/coverage/{name}-%m.profraw"
196200
)
197-
config.setdefault("volumes", []).append("./coverage:/coverage")
198201

199202
# Determine mzbuild specs and inject them into services accordingly.
200203
deps = self.repo.resolve_dependencies(images)

0 commit comments

Comments
 (0)