Skip to content

T5: Identity E2E smoke test#70

Open
devin-ai-integration[bot] wants to merge 2 commits into
devin/identity-t4-gatewayfrom
devin/identity-t5-e2e
Open

T5: Identity E2E smoke test#70
devin-ai-integration[bot] wants to merge 2 commits into
devin/identity-t4-gatewayfrom
devin/identity-t5-e2e

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds tests/identity-smoke-test.sh — an E2E smoke test that validates the Identity microservice end-to-end, both directly and through the API gateway.

The script runs 10 assertions covering the full auth lifecycle:

  • Direct (:5001): health check, register → 201, login → 200 + JWT extraction, unauthenticated → 401, authenticated → 200
  • Gateway (:5000): same register/login/auth flow routed through YARP

Gateway tests are skipped gracefully when the gateway isn't reachable. The script exits non-zero on any failure.

Verified locally: Dockerfile builds, all assertions pass against docker compose services (postgres + identity-service + api-gateway).

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/0f07b7a8f1014aec962930431c54da9f
Requested by: @mbatchelor81


Open in Devin Review

@mbatchelor81 mbatchelor81 self-assigned this Jun 26, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 potential issues.

Open in Devin Review

Comment thread tests/identity-smoke-test.sh Outdated

# 1. Health check (direct)
echo "--- Test 1: Health check (direct) ---"
wait_for_service "$IDENTITY_URL/healthz" "Identity Service"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 wait_for_service failure exits the script without a test summary

The wait_for_service call on line 38 is not wrapped in an if or || guard. If the service never comes up (and assuming the ((attempt++)) bug is fixed), return 1 on line 30 will propagate a non-zero exit under set -e, terminating the script immediately. This means no test summary is printed and the exit code is 1 but with no indication of which tests passed/failed. If this is intentional (bail early when the service is unreachable), it may be worth adding a note or trapping the exit to print the summary. Compare with the gateway health check at line 110 which gracefully skips tests when the gateway is unreachable.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional — if the identity service never comes up, there's nothing useful to test. The early exit with non-zero status signals the failure clearly. This mirrors how the gateway health check gates gateway tests, but for the identity service the entire test suite depends on it being reachable.

Comment on lines +49 to +58
REGISTER_RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$IDENTITY_URL/api/identity/register" \
-H "Content-Type: application/json" \
-d '{"userName":"smoketest","email":"smoke@test.com","password":"SmokeTest123!"}')
REGISTER_BODY=$(echo "$REGISTER_RESPONSE" | head -n -1)
REGISTER_CODE=$(echo "$REGISTER_RESPONSE" | tail -n 1)
if [ "$REGISTER_CODE" = "201" ]; then
log_pass "POST /api/identity/register → 201"
else
log_fail "POST /api/identity/register" "expected 201, got $REGISTER_CODE — body: $REGISTER_BODY"
fi

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Test is not idempotent — re-running will attempt to register the same users

The test registers hardcoded users smoketest and gwsmoke. If the test is run a second time against the same database, registration will likely fail (duplicate user), causing tests 2 and the gateway register test to fail. The script doesn't clean up users after running or handle the 409/conflict case. This is a common issue with E2E tests and may warrant either randomized usernames, a cleanup step, or treating 409 as acceptable on registration.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By design — this smoke test is intended to run against a fresh docker compose up with a clean database each time. The containers are torn down after the test run, so user collisions don't arise in practice.

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.

1 participant