[L-3] Live Trustgate integration tests run in the default mix test_named/precommit — no tag/env gate #33

Open
opened 2026-11-14 18:28:57 +01:00 by amiryahaya · 1 comment
Owner

Finding

Three tests hit the real Trustgate pilot over HTTPS with no @tag/env guard, plus flaky patterns (Process.sleep polling, wall-clock expiry waits, 180s module timeout).

Evidence

  • test/mdid_ws/cert_management/trustgate_lifecycle_test.exs:12, 191-212, 269-272
  • mix.exs:148 — precommit runs test_named

Impact

mix precommit fails without internet or when Trustgate is down; CI flakiness.

Fix

  • Tag with @tag :trustgate (or gate on TRUSTGATE_INTEGRATION=1) and exclude by default in test_helper.exs

Line numbers refer to the initial import commit 282cb11. Source: comprehensive audit, 2026-11-12 (first review of this codebase).

## Finding Three tests hit the real Trustgate pilot over HTTPS with no `@tag`/env guard, plus flaky patterns (Process.sleep polling, wall-clock expiry waits, 180s module timeout). ## Evidence - `test/mdid_ws/cert_management/trustgate_lifecycle_test.exs:12, 191-212, 269-272` - `mix.exs:148` — precommit runs test_named ## Impact `mix precommit` fails without internet or when Trustgate is down; CI flakiness. ## Fix - [ ] Tag with `@tag :trustgate` (or gate on TRUSTGATE_INTEGRATION=1) and exclude by default in test_helper.exs _Line numbers refer to the initial import commit `282cb11`. Source: comprehensive audit, 2026-11-12 (first review of this codebase)._
Author
Owner

Reopening: the tagged Trustgate integration tests are gated, but other tests still call the live Trustgate site in the default run. Example: StatusExposureTest in test/mdid_ws_web/controllers/admin_controller_test.exs enrolls through the API with no SOAP stub (seed_local_cert), so mix test needs the internet and depends on Trustgate's answers (found when a change to the enrollment status check made it fail with 503). Fix: stub the SOAP status calls in those tests (or in the shared test setup) so the default run makes no network calls, and keep live tests behind the :trustgate tag. Audit for other tests that enroll or renew without a stub. Also relevant to the emCA port, where the same stubs must be rewritten.

Reopening: the tagged Trustgate integration tests are gated, but other tests still call the live Trustgate site in the default run. Example: StatusExposureTest in test/mdid_ws_web/controllers/admin_controller_test.exs enrolls through the API with no SOAP stub (seed_local_cert), so mix test needs the internet and depends on Trustgate's answers (found when a change to the enrollment status check made it fail with 503). Fix: stub the SOAP status calls in those tests (or in the shared test setup) so the default run makes no network calls, and keep live tests behind the :trustgate tag. Audit for other tests that enroll or renew without a stub. Also relevant to the emCA port, where the same stubs must be rewritten.
Sign in to join this conversation.
No description provided.