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

Add random port support to Python services #2206

Merged
merged 1 commit into from Jan 3, 2024

Conversation

rylev
Copy link
Collaborator

@rylev rylev commented Jan 2, 2024

With #2193 we introduced Docker services for runtime testing that can assign random ports on the host to well know ports on the guest. This PR does the same for Python based services which can have well known ports mapped to randomly assigned ports.

The Python services do this by printing a PORT=(P1,P2) message to stdout where P1 is the well known port and P2 is the randomly assigned port. The runtime testing runtime parses this message and knows how to replace the well known ports in the test spin.toml files with the random ports.

With this change, we're at a point where runtime tests should run on most host machines without any modification.

@rylev rylev requested a review from dicej January 2, 2024 17:21
@rylev rylev force-pushed the assigned-ports-python-services branch 2 times, most recently from af74a94 to 9a1a0ff Compare January 2, 2024 17:37
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
@rylev rylev force-pushed the assigned-ports-python-services branch from 9a1a0ff to 2fa17ed Compare January 3, 2024 10:15
@rylev rylev enabled auto-merge January 3, 2024 10:15
@rylev rylev merged commit f4370e4 into main Jan 3, 2024
9 of 11 checks passed
@rylev rylev deleted the assigned-ports-python-services branch January 3, 2024 10:58
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.

None yet

2 participants