Skip to content

Commit 3e35e6d

Browse files
committed
Do not assume that TokenServer build will always include the MySQL backend when testing
As of the previous commit, the MySQL TokenServer backend is only enabled if SyncServer is also using MySQL or Spanner, otherwise it needs to be enabled explicitely.
1 parent 2524fb8 commit 3e35e6d

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

Dockerfile

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ RUN apt-get -q update && \
3333
apt-get -q update ; \
3434
fi; \
3535
fi && \
36-
if [ "$TOKENSERVER_DATABASE_BACKEND" = "postgres" ]; then \
36+
if [ "$SYNCSTORAGE_DATABASE_BACKEND" = "postgres" ] || [ "$TOKENSERVER_DATABASE_BACKEND" = "postgres" ]; then \
3737
POSTGRES_DEV_PKG="libpq-dev"; \
3838
fi && \
3939
apt-get -q install -y --no-install-recommends $MYSQL_PKG $POSTGRES_DEV_PKG cmake python3-dev python3-pip python3-setuptools python3-wheel python3-venv pkg-config && \
@@ -45,11 +45,7 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked \
4545
--mount=type=cache,target=/usr/local/cargo/git,sharing=locked \
4646
--mount=type=cache,target=/app/target,sharing=locked \
4747
set -x && \
48-
TOKENSERVER_FEATURES="" && \
49-
if [ "$TOKENSERVER_DATABASE_BACKEND" = "postgres" ]; then \
50-
TOKENSERVER_FEATURES="--features=tokenserver-db/postgres"; \
51-
fi && \
52-
cargo chef cook --release --no-default-features --features=syncstorage-db/$SYNCSTORAGE_DATABASE_BACKEND $TOKENSERVER_FEATURES --features=py_verifier --recipe-path recipe.json
48+
cargo chef cook --release --no-default-features --features=syncstorage-db/$SYNCSTORAGE_DATABASE_BACKEND --features=tokenserver-db/$TOKENSERVER_DATABASE_BACKEND --features=py_verifier --recipe-path recipe.json
5349

5450
ENV POETRY_HOME="/opt/poetry" \
5551
POETRY_VIRTUALENVS_IN_PROJECT=1 \
@@ -96,13 +92,9 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked \
9692
--mount=type=cache,target=/usr/local/cargo/git,sharing=locked \
9793
--mount=type=cache,target=/app/target,sharing=locked \
9894
set -x && \
99-
TOKENSERVER_FEATURES="" && \
100-
if [ "$TOKENSERVER_DATABASE_BACKEND" = "postgres" ]; then \
101-
TOKENSERVER_FEATURES="--features=tokenserver-db/postgres"; \
102-
fi && \
10395
cargo --version && \
10496
rustc --version && \
105-
cargo install --path ./syncserver --no-default-features --features=syncstorage-db/$SYNCSTORAGE_DATABASE_BACKEND $TOKENSERVER_FEATURES --features=py_verifier --locked --root /app
97+
cargo install --path ./syncserver --no-default-features --features=syncstorage-db/$SYNCSTORAGE_DATABASE_BACKEND --features=tokenserver-db/$TOKENSERVER_DATABASE_BACKEND --features=py_verifier --locked --root /app
10698

10799
FROM docker.io/library/debian:bookworm-slim
108100
ARG SYNCSTORAGE_DATABASE_BACKEND

0 commit comments

Comments
 (0)