wwbmmm commented on PR #3310:
URL: https://github.com/apache/brpc/pull/3310#issuecomment-4581507515

   > Hi @wwbmmm @chenBright @yanglimingcn — process question on integration 
testing for this codec, before I write more code.
   > 
   > The pure-codec unit tests (59 across scramble / handshake / packet) are in 
place. For end-to-end auth verification I'd like to add an integration test 
that drives the full handshake against a real `mysqld` or `mariadbd`.
   > 
   > brpc already has a precedent for this in [`test/brpc_redis_unittest.cpp` 
(L62–L87)](https://github.com/apache/brpc/blob/master/test/brpc_redis_unittest.cpp#L62-L87)
 — `system("which redis-server")` at startup, spawn it with a temp datadir if 
found, otherwise each test does `puts("Skipped due to absence of 
redis-server"); return;`. That gives real-protocol coverage on contributor 
machines and CI runners that have the binary, while staying green on lean 
environments.
   > 
   > Two questions before I mirror the pattern:
   > 
   > 1. **Is the redis-style `system()`-spawn approach the one you'd recommend 
for MySQL**, or would you rather something different — Docker-based service, 
mtr-style harness, mock server only, etc.?
   > 2. **Is CI expected to have `mysqld`/`mariadbd` available** (so the tests 
will actually run in Apache CI), or should the test always self-skip in CI and 
only execute locally?
   > 
   > The upstream MariaDB integration tests I'd want to mirror (`test_auth256` 
cache-hit + cache-miss + RSA pubkey paths, `test_conc312` mid-handshake 
auth-switch) are listed at the bottom of the [spec 
gist](https://gist.github.com/rajvarun77/e84f97360c553230966e305438dfbd0e). 
Happy to mirror whatever pattern you'd want long-term.
   > 
   > Also flagging — CI runs on this branch are currently in 
**`action_required`** state (workflow-approval gate for outside contributors). 
Could either of you click _Approve and run_ on the Checks tab when convenient?
   
   I think you can follow the `brpc_redis_unittest.cpp` way for mysql: install 
a mysqld locally, and connect the mysqld server in the test code.
   For future improvement, I think we can create a new CI job, install redis 
and mysqld in the CI server and run the corresponding test cases.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to