Skip to content

feat(ci): add E2E handshake test for API-Core integration#145

Merged
GenerQAQ merged 15 commits intomemodb-io:devfrom
slyt3:feat/e2e-handshake
Jan 20, 2026
Merged

feat(ci): add E2E handshake test for API-Core integration#145
GenerQAQ merged 15 commits intomemodb-io:devfrom
slyt3:feat/e2e-handshake

Conversation

@slyt3
Copy link
Copy Markdown
Contributor

@slyt3 slyt3 commented Jan 13, 2026

Why we need this PR?

This should close Phase 2 of Issue (Infrastructure-E2E) #140

We needed a reliable way to confirm and verify that the entire backend stack (Go API, RabbitMQ, Python Core, Database, S3) is correctly integrated and communicating :) . Unit tests alone do not cover these complex cross-service interactions. This PR introduces an isolated E2E "Handshake" test suite that proves the services can successfully talk to each other in a CI-like environment. :)

Describe your solution

I implemented a comprehensive E2E testing infrastructure:

  1. Isolated Test Environment: Introduced src/server/docker-compose.test.yml, a specialized configuration for testing that:

    • Spins up a full stack (Postgres, Redis, RabbitMQ, SeaweedFS, API, Core).
    • Uses strict healthcheck conditions to ensure all dependencies are ready before services start.
    • Isolates ports to prevent conflicts with local development environments.
  2. Handshake Test Script: Added src/server/tests/e2e/handshake_test.py, which:

    • Directly seeds a test project into the database.
    • Acts as a client to the Go API to create a session and send a message.
    • Polls the database to verify the Python Core successfully received the message via RabbitMQ and processed it (validating the full pipeline even if the LLM call fails due to invalid keys).
  3. CI Integration: Added .github/workflows/e2e-handshake.yaml to automatically run this full-stack verification on every PR.

  4. Critical Fixes:

    • Fixed Go API configuration to correctly read RabbitMQ and S3 environment variables in Docker.
    • Fixed Core startup crashes caused by race conditions with dependency shutdowns.
    • Hardened SeaweedFS setup to ensure buckets exist before dependent services start.

Implementation Tasks

Please ensure your pull request meets the following requirements:

  • Create docker-compose.test.yml with robust healthchecks and networking
  • Implement handshake_test.py to verify full system integration (API -> MQ -> Core)
  • Add GitHub Actions workflow for automated E2E testing
  • Fix Go API panic due to incorrect RabbitMQ port/vhost configuration
  • Fix Python Core race condition by preventing premature seaweedfs-setup exit

Impact Areas

Which part of Acontext would this feature affect?

  • Client SDK (Python)
  • Client SDK (TypeScript)
  • Core Service
  • API Server
  • Dashboard
  • CLI Tool
  • Documentation
  • Other: CI/CD Infrastructure

Checklist

  • Open your pull request against the dev branch.
  • All tests pass in available continuous integration systems (e.g., GitHub Actions).
  • Tests are added or modified as needed to cover code changes.

kill me if e2e-handshake.yaml implemented (CI run triggered) fails

@slyt3
Copy link
Copy Markdown
Contributor Author

slyt3 commented Jan 13, 2026

🗡️

@slyt3
Copy link
Copy Markdown
Contributor Author

slyt3 commented Jan 13, 2026

🎉

@slyt3
Copy link
Copy Markdown
Contributor Author

slyt3 commented Jan 17, 2026

@GenerQAQ any follow up? or should i close this PR and my issue that i was working on? Dont want to take any new issues before implementing something new

@GenerQAQ
Copy link
Copy Markdown
Contributor

@GenerQAQ any follow up? or should i close this PR and my issue that i was working on? Dont want to take any new issues before implementing something new

Previously, I was busy with the development of new features, I'm starting my review now and will share feedback soon. ♥️

Copy link
Copy Markdown
Contributor

@GenerQAQ GenerQAQ left a comment

Choose a reason for hiding this comment

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

Overall, this PR adds a solid E2E testing infrastructure. A few issues to address:

Comment thread src/server/docker-compose.test.yml Outdated
Comment thread src/server/docker-compose.test.yml
Comment thread src/server/docker-compose.test.yml
Comment thread src/server/tests/e2e/handshake_test.py Outdated
Comment thread src/server/docker-compose.test.yml Outdated
Comment thread src/server/tests/e2e/handshake_test.py
Comment thread .github/workflows/e2e-handshake.yaml Outdated
Cleaned up config, improved error handling, and added documentation comments based on reviewer suggestions.
@slyt3 slyt3 requested a review from GenerQAQ January 20, 2026 10:24
Copy link
Copy Markdown
Contributor

@GenerQAQ GenerQAQ left a comment

Choose a reason for hiding this comment

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

LGTM! ready to merge once the minor issues are addressed.

The current title "Feat/e2e handshake" could be more descriptive. Consider:

  • feat: add E2E handshake test suite
  • feat(test): add E2E integration test for full stack handshake
  • feat(ci): add E2E handshake test for API-Core integration

Comment thread src/server/tests/e2e/handshake_test.py Outdated
Comment thread src/server/tests/e2e/handshake_test.py
@slyt3 slyt3 changed the title Feat/e2e handshake feat(ci): add E2E handshake test for API-Core integration Jan 20, 2026
- Remove unused time import
- Configure immediate message processing (buffer_max_turns: 1)
- Reduces test execution time by ~8 seconds
@slyt3 slyt3 requested a review from GenerQAQ January 20, 2026 11:32
Copy link
Copy Markdown
Contributor

@GenerQAQ GenerQAQ left a comment

Choose a reason for hiding this comment

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

LGTM, Ready to merge! 🚀

@GenerQAQ GenerQAQ merged commit a3fc634 into memodb-io:dev Jan 20, 2026
1 check passed
@slyt3 slyt3 deleted the feat/e2e-handshake branch January 20, 2026 11:43
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.

2 participants