Page MenuHomePhabricator

[commtest] Make service endpoints configurable
ClosedPublic

Authored by bartek on Oct 17 2023, 5:47 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jun 25, 5:01 AM
Unknown Object (File)
Tue, Jun 25, 5:01 AM
Unknown Object (File)
Tue, Jun 25, 5:01 AM
Unknown Object (File)
Tue, Jun 25, 5:00 AM
Unknown Object (File)
Tue, Jun 25, 4:53 AM
Unknown Object (File)
Sat, Jun 15, 7:07 PM
Unknown Object (File)
Fri, Jun 14, 3:18 PM
Unknown Object (File)
Fri, Jun 14, 2:13 AM
Subscribers

Details

Summary

Attempt to clean up mess with service addresses in commtest. Gives ability to configure endpoints of tested services, and thus running the tests from within docker network.

Introduced a single source of truth with hardcoded defaults, and two ways of overriding them:

  1. Keeping localhost, while overriding port with COMM_SERVICES_PORT_* env variable - this maintains current behavior for blob and backup
  2. overriding the whole endpoint using *_SERVICE_URL for HTTP services, *_GRPC_ENDPOINT for gRPC services, and *_WS_ENDPOINT for websocket

Depends on D9509

Test Plan
  • Ran commtest for all services the usual way, ensured the tests are passing (or at least not failing due to network error)
  • Changed ports in .env file and ensured the tests are reaching services on new ports
  • Overriden the endpoint correctly (one way is to use staging service address) and ensured the tests are addressing the correct service

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Oct 17 2023, 6:03 AM

I'll need to rebase it on @varun's stack once it's landed

services/commtest/tests/blob_integration_test.rs
49 ↗(On Diff #32076)

This and many below changes are just clippy fixes

Nice

services/commtest/src/identity/device.rs
64 ↗(On Diff #32076)

Can this comment be removed now?

This revision is now accepted and ready to land.Oct 18 2023, 3:22 AM

Massive improvement 👏

services/commtest/src/service_addr.rs
14 ↗(On Diff #32076)

shouldn't this be http?

services/commtest/src/service_addr.rs
14 ↗(On Diff #32076)

of course it should! I'm surprised that it worked despite being wrong 😅

Rebase on latest changes. Fix scheme, reomve todo comment.