Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime tests services #2180

Merged
merged 1 commit into from
Dec 20, 2023
Merged

Runtime tests services #2180

merged 1 commit into from
Dec 20, 2023

Conversation

rylev
Copy link
Collaborator

@rylev rylev commented Dec 15, 2023

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.

@rylev rylev merged commit 9df2e1b into main Dec 20, 2023
9 checks passed
@rylev rylev deleted the services branch December 20, 2023 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants