fix: write actual mock port to file for smoke test
This commit is contained in:
parent
dfedd80d0d
commit
abe3e28a49
2 changed files with 11 additions and 7 deletions
|
|
@ -719,9 +719,10 @@ def main():
|
|||
base_port = int(os.environ.get("MOCK_FORGE_PORT", 3000))
|
||||
port = find_free_port(base_port)
|
||||
|
||||
# If we found a different port, update the environment variable
|
||||
if port != base_port:
|
||||
os.environ["MOCK_FORGE_PORT"] = str(port)
|
||||
# Write actual port to a file for the test script to read
|
||||
port_file = os.environ.get("MOCK_FORGE_PORT_FILE", "/tmp/mock-forgejo-port")
|
||||
with open(port_file, "w") as f:
|
||||
f.write(str(port))
|
||||
|
||||
server = ThreadingHTTPServer(("0.0.0.0", port), ForgejoHandler)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue