Skip to content

ci: dynamically wait for healthy services before running Cypress tests#76

Merged
NotYuSheng merged 10 commits into
devfrom
ci/integration-test
Jun 30, 2025
Merged

ci: dynamically wait for healthy services before running Cypress tests#76
NotYuSheng merged 10 commits into
devfrom
ci/integration-test

Conversation

@NotYuSheng

@NotYuSheng NotYuSheng commented Jun 25, 2025

Copy link
Copy Markdown
Owner

Summary

This PR enhances the CI pipeline to dynamically detect and wait for all *_service containers to be healthy before running Cypress integration tests. This prevents flakiness due to services not being ready and ensures the system under test is fully initialized before testing begins.

Address #75


Changes Made

  • Added a step in .github/workflows/integration-test.yml to:

    • Parse running containers ending in _service
    • Extract their published ports using docker compose ps --format json and jq
    • Perform health checks on /health endpoints for each
  • Introduced timeout logic to fail fast if any service does not respond with HTTP 200

  • Updated Cypress wait-on target to http://localhost:8501 to reflect frontend port


Context / Rationale

Previously, Cypress would run as soon as Docker Compose finished launching services — even if some were still initializing. This led to sporadic test failures, especially when backend services were not yet ready. By dynamically checking readiness for all _service containers, we eliminate this race condition and make CI runs more reliable and maintainable, especially as new services are added.


Related Docs or References


General Checklist

  • I have tested these changes locally
  • I have updated relevant documentation or added comments where needed
  • I have linked relevant issues and tagged reviewers
  • I have followed coding conventions and naming standards

@NotYuSheng NotYuSheng linked an issue Jun 25, 2025 that may be closed by this pull request
5 tasks
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@NotYuSheng NotYuSheng merged commit 933a705 into dev Jun 30, 2025
2 checks passed
@NotYuSheng NotYuSheng deleted the ci/integration-test branch June 30, 2025 08:12
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.

[Sub-Issue] Add dynamic healthcheck wait step to Cypress workflow

1 participant