shanejansen / touchstone

Touchstone is a testing framework for your services that focuses on component, end-to-end, and exploratory testing.
16 stars 2 forks source link

Support HTTP Connections Between Services #12

Closed ScottFreeCode closed 2 years ago

ScottFreeCode commented 3 years ago

Services can point to localhost/host.docker.internal to reach other services when running in Touchstone Develop. However, under Touchstone Run, the services are given randomized ports and are not reachable. This makes HTTP calls (and other direct, non-Rabbit communication) between two or more services impossible.

ScottFreeCode commented 3 years ago

Since this comes from the design for running multiple instances of Touchstone in parallel on the same server, see also #16 concerning running multiple instances together more efficiently.

ScottFreeCode commented 3 years ago

Something related: if I have two services, and they both run on port 8080, and they do not need to make HTTP calls to each other, then touchstone run works since they are mapped to random ports but they cannot both be started in touchstone develop since they both need port 8080 (and configuring port: 8081 for one of them of course expects it to run on 8081 internally, not to map 8080 to 8081).

I am not sure if that's an issue in its own right, I could theoretically configure the second service to run on 8081; but I bring it up because depending on the solution we might be able to resolve both of these at once with better handling of the service's port in the container vs. the port it's mapped to on the host.

shanejansen commented 3 years ago

I believe touchstone run will still work, but in the underlying Docker network, there will be a conflict that could cause issues. The auto-discovered port just allows TS running on the host machine to access the services in the Docker network.

Your touchstone.yml file will need to be configured so there are no overlapping ports. I don't believe they can be auto-discovered since the services will need to know all other service's hostname/ports at startup (this enhancement)