ksysoev / wasabi

Toolkit for Creating WebSocket API Gateways
MIT License
4 stars 2 forks source link

Integration tests #55

Closed ksysoev closed 1 month ago

ksysoev commented 1 month ago

Currently all components are tested independently and not guaranteed to be working together smoothly. Would be nice start writing integration tests. Should be good to start with simple echo server test. Tests for sending text and binary frames

KianYang-Lee commented 1 month ago

Is the int tests already in progress? If not I would love to start working on it @ksysoev

ksysoev commented 1 month ago

@KianYang-Lee no, it's free to pick up. thanks man for helping ❤️

ksysoev commented 1 month ago

in integration test you will need to start server on port 0, to start on any free port, then to use Addr to get assigned address and port for connection: https://github.com/ksysoev/wasabi/blob/main/server/server.go#L152

It could be a bit tricky to detect when server is started... unfortunately i didn't find better solution than sleep for now. https://github.com/ksysoev/wasabi/blob/main/server/server_test.go#L268-L269 If you see better way don't hesitate to use it.

KianYang-Lee commented 1 month ago

echo int tests using text implemented in PR #66