fix(ci): materialize rebar test src_dirs in shared test image. Refs EventHub/EventHubBack#36
CI / test (push) Successful in 28m14s
CI / deploy-ift (push) Successful in 7m42s
CI / e2e-ift (push) Failing after 21m40s
CI / deploy-stage (push) Has been skipped
CI / e2e-stage (push) Has been skipped

This commit is contained in:
2026-07-17 19:35:12 +03:00
parent e9d1a13900
commit 2b65a804d3
2 changed files with 25 additions and 2 deletions
+10 -2
View File
@@ -10,9 +10,17 @@ COPY src/ src/
COPY test/unit/ test/unit/ COPY test/unit/ test/unit/
COPY test/api_*_SUITE.erl test/ COPY test/api_*_SUITE.erl test/
COPY test/api/ test/api/ COPY test/api/ test/api/
COPY docker/ci-test-prepare.sh /usr/local/bin/ci-test-prepare.sh
RUN chmod +x /usr/local/bin/ci-test-prepare.sh
# default profile: CT (test/api); test profile: EUnit (test/unit) # default profile: CT (test/api); test profile: EUnit (test/unit).
RUN rebar3 compile && rebar3 as test compile # rebar3 кладёт битые/symlink extra src_dirs; готовим реальные копии (как scripts/fix-rebar-unit-symlink.sh).
RUN rebar3 compile \
&& mkdir -p _build/test/lib/eventhub/test \
&& (rebar3 as test compile || true) \
&& ci-test-prepare.sh \
&& rebar3 as test compile
# По умолчанию CT; для eunit: docker run … rebar3 eunit --sname ci_eunit --verbose # По умолчанию CT; для eunit: docker run … rebar3 eunit --sname ci_eunit --verbose
ENTRYPOINT ["ci-test-prepare.sh"]
CMD ["rebar3", "ct", "--sname", "ci_api_test", "-v"] CMD ["rebar3", "ct", "--sname", "ci_api_test", "-v"]
+15
View File
@@ -0,0 +1,15 @@
#!/bin/sh
# Replace rebar3 symlinks under _build/.../test with real copies (BusyBox cp -L fails on them).
set -eu
APP_ROOT="${APP_ROOT:-/app}"
DEST="${APP_ROOT}/_build/test/lib/eventhub/test"
mkdir -p "${DEST}"
rm -rf "${DEST}/unit" "${DEST}/api"
cp -a "${APP_ROOT}/test/unit" "${DEST}/unit"
cp -a "${APP_ROOT}/test/api" "${DEST}/api"
# shellcheck disable=SC2086
cp -a ${APP_ROOT}/test/api_*_SUITE.erl "${DEST}/" 2>/dev/null || true
if [ "$#" -gt 0 ]; then
exec "$@"
fi