fix: write actual mock port to file for smoke test
Some checks failed
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/pr/ci Pipeline failed
ci/woodpecker/pr/smoke-init Pipeline failed

This commit is contained in:
Agent 2026-04-02 09:12:17 +00:00
parent dfedd80d0d
commit abe3e28a49
2 changed files with 11 additions and 7 deletions

View file

@ -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)