[FEATURE] Add Microcks acceptance test suite for Dart WebSocket client
Why do we need this improvement?
Under packages/templates/clients/websocket/test/, we already have containerized Microcks acceptance test suites for JavaScript, Python, and Java (Quarkus). However, the Dart client currently only has integration snapshot tests and lacks an acceptance test suite running against real Microcks mocks.
Rule 11 in packages/README.md states: "Acceptance tests must be configured with Microcks". Right now, Dart is the only WebSocket client template without acceptance tests. When changes are made to generator core or the template components, we cannot automatically verify in CI whether the generated Dart client still successfully connects and exchanges valid messages with real WebSocket servers.
How will this change help?
- Parity: Brings the Dart client template to full test parity with JavaScript, Python, and Java acceptance test setups.
- Automated Verification: Automatically validates both inbound and outbound WebSocket message flows on every PR via the CI test matrix.
- Regression Prevention: Catches breaking changes or schema serialization bugs in the Dart client before they reach users.
Screenshots
No response
How could it be implemented/designed?
The implementation follows the established pattern of the existing JavaScript, Python, and Java acceptance tests:
-
Test Project (
packages/templates/clients/websocket/test/dart/):- Add
pubspec.yamlwith testing dependencies:test,web_socket_channel, andhttp. - Implement
test/acceptance_test.dartusing the generatedHoppscotchEchoWebSocketClient:- Inbound test: Connect to
ws://microcks-async-minion:8081and assert that the client receives the expected timestamp message. - Outbound test: Start a local WebSocket server on port 8085, trigger a Microcks schema runner test (
POST /api/tests), send a message withclient.sendEchoMessage(), and assert that Microcks validates schema compliance.
- Inbound test: Connect to
- Add
.gitignoreto keep.dart_tool/andpubspec.lockuntracked.
- Add
-
Container Infrastructure (
microcks-podman.yml):- Add a
tester-dartcontainer service using the officialdocker.io/dart:stableimage under thetest-dartprofile. - Expose port
8085so Microcks can connect to the test server running inside the container.
- Add a
-
CI Pipeline (
pr-testing-with-test-project.yml):- Add
darttomatrix.language: [js, py, java, dart].
- Add
-
Documentation (
packages/templates/clients/websocket/test/README.md):- Document the
--profile test-dartcommand for running Dart acceptance tests locally.
- Document the
🚧 Breaking changes
No
👀 Have you checked for similar open issues?
- [x] I checked and didn't find a similar issue
🏢 Have you read the Contributing Guidelines?
- [x] I have read the Contributing Guidelines
Are you willing to work on this issue?
Yes I am willing to submit a PR!
Above PRs were deliberately raised to verify the working prototype
I've implemented the test and verified it in CI on my fork first:
- Fork PR: https://github.com/devxdh/asyncapi-generator/pull/3
- Passing CI Run (
Acceptance tests (dart)): https://github.com/devxdh/asyncapi-generator/actions/runs/41496139554/job/125451644747?pr=3
cc @Adi-204 in case you'd like to take a look when you have a moment. Just sharing the run and changes here to show it's already tested and working cleanly.
hope this helps in evaluating the issue :)
/approve
@devxdh, no need to create PRs from a fork going forward! You can directly create a PR here and follow the usual review process.
👋 Thanks for your patience. This issue has been reviewed and is ready to be worked on.
Before you start:
- Comment below to let others know you're working on it (avoids duplicate work)
- Read our CONTRIBUTING.md if you haven't already
- Fork the repo, create a feature branch, and open a draft PR early
Approved by @Adi-204