fix(test): bind the port advertised as --url - #56
Merged
Conversation
redirect_uri is validated against --url, so setting it to localhost:8080 while the suite reached a testcontainers-mapped random port made magic_link_login refuse with "Invalid redirect URI" and return no data - two failures on main since #55. Ask the OS for a free port, bind the container to it, and give the same address to --url. Also pins the test server image to 2.4.0-rc.23; rc.13 predates every change under test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Two magic-link tests have failed on
mainsince #55.redirect_uriis validated against--url. #55 set--url=http://localhost:8080— the address inside the container — while the suite reaches the server through a testcontainers-mapped random host port and sendsredirectURLon that mapped host. The server refuses it (Invalid redirect URI),magic_link_loginreturns no data, and no verification request is created, so the follow-upverify emailtest fails too.Reproduced against rc.23 outside the suite: identical args with
--urlmatching the reachable address succeed; with it pointing elsewhere they fail.Fix: ask the OS for a free port, bind the container to it, and hand the same address to
--url.Also bumps the pinned test image from 2.4.0-rc.13 to 2.4.0-rc.23.
Local run: 11 suites, 104 tests, all passing.