aboutsummaryrefslogtreecommitdiff
path: root/build/scripts/ComplementPostgres.Dockerfile
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2022-12-23 14:28:15 +0100
committerGitHub <noreply@github.com>2022-12-23 14:28:15 +0100
commite449d174ccf7569b2536289f3c8145298e80bc90 (patch)
tree96e410b2e61fa54c809369bf2784b59f5d663832 /build/scripts/ComplementPostgres.Dockerfile
parentf762ce1050f2add409a83b1eeb6da5940177cfa7 (diff)
Add possibility to run complement with coverage enabled (#2901)
This adds the possibility to run Complement with coverage enabled. In combination with https://github.com/matrix-org/complement/pull/566 we should then be able to extract the coverage logs, combine them with https://github.com/wadey/gocovmerge (or similar) and upload them to Codecov (with different flags, depending on SQLite, HTTP etc.)
Diffstat (limited to 'build/scripts/ComplementPostgres.Dockerfile')
-rw-r--r--build/scripts/ComplementPostgres.Dockerfile7
1 files changed, 5 insertions, 2 deletions
diff --git a/build/scripts/ComplementPostgres.Dockerfile b/build/scripts/ComplementPostgres.Dockerfile
index 3faf43cc..444cb947 100644
--- a/build/scripts/ComplementPostgres.Dockerfile
+++ b/build/scripts/ComplementPostgres.Dockerfile
@@ -34,13 +34,16 @@ RUN --mount=target=. \
--mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=${CGO} go build -o /dendrite ./cmd/generate-config && \
CGO_ENABLED=${CGO} go build -o /dendrite ./cmd/generate-keys && \
- CGO_ENABLED=${CGO} go build -o /dendrite ./cmd/dendrite-monolith-server
+ CGO_ENABLED=${CGO} go build -o /dendrite ./cmd/dendrite-monolith-server && \
+ CGO_ENABLED=${CGO} go test -c -cover -covermode=atomic -o /dendrite/dendrite-monolith-server-cover -coverpkg "github.com/matrix-org/..." ./cmd/dendrite-monolith-server && \
+ cp build/scripts/complement-cmd.sh /complement-cmd.sh
WORKDIR /dendrite
RUN ./generate-keys --private-key matrix_key.pem
ENV SERVER_NAME=localhost
ENV API=0
+ENV COVER=0
EXPOSE 8008 8448
@@ -51,4 +54,4 @@ CMD /build/run_postgres.sh && ./generate-keys --keysize 1024 --server $SERVER_NA
# Bump max_open_conns up here in the global database config
sed -i 's/max_open_conns:.*$/max_open_conns: 1990/g' dendrite.yaml && \
cp /complement/ca/ca.crt /usr/local/share/ca-certificates/ && update-ca-certificates && \
- exec ./dendrite-monolith-server --really-enable-open-registration --tls-cert server.crt --tls-key server.key --config dendrite.yaml -api=${API:-0} \ No newline at end of file
+ exec /complement-cmd.sh \ No newline at end of file