Skip to content

Commit e28bd1b

Browse files
committed
Setup mb-mail-service in the tests image
This commit also travels back to the present and updates `TESTS_IMAGE_TAG` to the current date.
1 parent 02aa588 commit e28bd1b

File tree

5 files changed

+26
-2
lines changed

5 files changed

+26
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- translations
1010

1111
env:
12-
TESTS_IMAGE_TAG: v-2025-09-27.0
12+
TESTS_IMAGE_TAG: v-2025-09-18.1
1313

1414
jobs:
1515
build-tests-image:

docker/musicbrainz-tests/run_js_perl_and_pgtap_tests.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ sv kill chrome
3434

3535
./docker/musicbrainz-tests/add_mbtest_alias.sh
3636

37-
sv_start_if_down template-renderer vnu website
37+
sv_start_if_down smtp
38+
sv_start_if_down mb-mail-service template-renderer vnu website
3839

3940
export MMD_SCHEMA_ROOT=/home/musicbrainz/mmd-schema
4041
export JUNIT_OUTPUT_FILE=junit_output/perl_and_pgtap.xml
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
exec mb-mail-service
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
exec python3.13 -m aiosmtpd -n -c DebuggingServer localhost:25

docker/templates/Dockerfile.tests.m4

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ run_with_apt_cache \
4747
install_perl && \
4848
install_cpanm_and_carton && \
4949
python3.13 -m ensurepip --upgrade && \
50+
# aiosmtpd needed for the smtp service.
51+
python3.13 -m pip install --break-system-packages aiosmtpd && \
5052
echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen && \
5153
locale-gen && \
5254
# Allow the musicbrainz user execute any command with sudo.
@@ -154,6 +156,18 @@ RUN sudo -E -H -u musicbrainz git clone https://github.com/metabrainz/artwork-re
154156

155157
COPY docker/musicbrainz-tests/artwork-redirect-config.ini artwork-redirect/config.ini
156158

159+
FROM build AS mb_mail_service
160+
161+
ARG MB_MAIL_SERVICE_TAG=v0.4.9
162+
163+
ENV PATH="/root/.cargo/bin:${PATH}"
164+
165+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain none && \
166+
sudo -E -H -u musicbrainz git clone https://github.com/metabrainz/mb-mail-service.git && \
167+
cd mb-mail-service && \
168+
sudo -E -H -u musicbrainz git reset --hard $MB_MAIL_SERVICE_TAG && \
169+
cargo build --release
170+
157171
FROM build AS node_modules
158172

159173
COPY --chown=musicbrainz:musicbrainz .yarnrc.yml package.json yarn.lock MBS_ROOT/
@@ -214,6 +228,7 @@ COPY --from=pgdata --chown=postgres:postgres "$PGHOME"/ "$PGHOME"/
214228
COPY --from=pg_amqp --chown=musicbrainz:musicbrainz /home/musicbrainz/pg_amqp/target/ /
215229
COPY --from=sir --chown=musicbrainz:musicbrainz /home/musicbrainz/sir/ /home/musicbrainz/sir/
216230
COPY --from=artwork_redirect --chown=musicbrainz:musicbrainz /home/musicbrainz/artwork-redirect/ /home/musicbrainz/artwork-redirect/
231+
COPY --from=mb_mail_service --chown=musicbrainz:musicbrainz /home/musicbrainz/mb-mail-service/target/release/mb-mail-service /usr/local/bin/
217232
COPY --from=node_modules --chown=musicbrainz:musicbrainz MBS_ROOT/node_modules/ MBS_ROOT/node_modules/
218233
COPY --chmod=0755 docker/musicbrainz-tests/service/ /etc/service/
219234

@@ -224,8 +239,10 @@ COPY --chmod=0755 \
224239
RUN setup_test_service(`artwork-indexer') && \
225240
setup_test_service(`artwork-redirect') && \
226241
setup_test_service(`chrome') && \
242+
setup_test_service(`mb-mail-service') && \
227243
setup_test_service(`postgresql') && \
228244
setup_test_service(`redis') && \
245+
setup_test_service(`smtp') && \
229246
setup_test_service(`solr') && \
230247
setup_test_service(`ssssss') && \
231248
setup_test_service(`template-renderer') && \

0 commit comments

Comments
 (0)