Skip to content

fix: align INTERNAL_ACCESS_TOKEN in user_integration_test.env with CI test env#3

Open
circleci-app[bot] wants to merge 1 commit into
develop-2from
chunk/fix-internal-access-token-mismatch
Open

fix: align INTERNAL_ACCESS_TOKEN in user_integration_test.env with CI test env#3
circleci-app[bot] wants to merge 1 commit into
develop-2from
chunk/fix-internal-access-token-mismatch

Conversation

@circleci-app
Copy link
Copy Markdown

@circleci-app circleci-app Bot commented May 22, 2026

Summary

  • The integration tests were silently failing because INTERNAL_ACCESS_TOKEN in dev-ops/user_integration_test.env (Fqn0m0HQ0gXydRtBCg5l) did not match the USER_INTERNAL_ACCESS_TOKEN passed to the test runner in the CI config (internal-access-token).
  • When setupAdminUser() called /user/v1/admin/create with the wrong token, the user-service rejected the request (unauthorized). The admin user was never created, so the subsequent login call threw — causing all tests to fail in the before() hook.
  • Because mocha-junit-reporter writes results to the XML file rather than stdout, the CI log showed a blank output block with no visible error, making the failure hard to diagnose.

Fix

Changed INTERNAL_ACCESS_TOKEN=Fqn0m0HQ0gXydRtBCg5lINTERNAL_ACCESS_TOKEN=internal-access-token in dev-ops/user_integration_test.env so the user-service accepts the token the tests actually send. The commonTests.js helper already documents: "Must match INTERNAL_ACCESS_TOKEN in user_integration_test.env".

Test plan

  • CI integration-test job passes after this change
  • User Creation Flow > Admin user tests create/login successfully
  • User Creation Flow > Regular user tests create/login successfully

Original failing job

https://app.circleci.com/agents/circleci/3c4df9e5-2e07-4dba-99a6-6a869f03d07e/chat/e6cc964b-fba8-4bbd-93e0-60a38ec87043

… test env

The integration tests were failing because the USER_INTERNAL_ACCESS_TOKEN
passed to the test runner (internal-access-token) did not match the
INTERNAL_ACCESS_TOKEN configured in the user-service environment
(Fqn0m0HQ0gXydRtBCg5l).

When the test called /user/v1/admin/create with the wrong token, the
user-service rejected the request, the admin user was never created, and
the subsequent login call in setupAdminUser() threw an error — causing
all tests in before() to fail silently (mocha-junit-reporter writes to
XML, not stdout).

Fix by setting INTERNAL_ACCESS_TOKEN=internal-access-token in
user_integration_test.env to match the value passed via CI environment
variable USER_INTERNAL_ACCESS_TOKEN, as documented in the commonTests.js
comment ("Must match INTERNAL_ACCESS_TOKEN in user_integration_test.env").
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants