Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implements support for external services in runtime tests. These services can be anything external to Spin that the Spin runtime requires to run (e.g., PostgreSQL, Redis, a TCP server, etc.). How these services work is described in the README.
Future extensions
This PR adds support for services written in Python. In the future, we will add support for services written using Docker. We'll also add the ability to skip tests that require certain services so that devs can run tests that don't require services or only require services that they can easily run (e.g., Python scripts) but skip tests that require services that they don't want to run (e.g., Docker based services).
The hope is that Python and Docker are good enough for any services we will need. We want to avoid running services in an adhoc, non-cross platform way (e.g., bash scripts).
Shortcomings
The current TCP echo service hard codes the 6001 port. This is because, there is currently no way to get the TCP tests to not have pre-knowledge of which port they will run on. We could set the port in an environment variable which would allow the test component to know which port it should aim at, but
allowed_outbound_hosts
does not support environment variable interpolation. We either need to add support for this in Spin or add support in the runtime test runner for interpolating more values in the Spin.toml manifest. This is left for a future PR.