From 0ec93d260e061b8e2bbdc9fd774113b986cfcafe Mon Sep 17 00:00:00 2001 From: Maurane GLAUDE Date: Tue, 18 Jun 2024 17:03:23 +0200 Subject: [PATCH] fix(tests): fix port to listen to while app running, change build workflow step --- .github/workflows/python-package.yml | 6 ++---- tests/integration/conftest.py | 2 +- tests/integration/server_mock/server.py | 2 +- tests/integration/test_run_server.py | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 82ef22f..481524c 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -44,13 +44,11 @@ jobs: - name: Build Windows Installer if: matrix.os == 'windows-latest' - run: hatch run pyinstaller:build AntaresWebInstaller.exe - working-directory: dist/ + run: hatch run pyinstaller:build - name: Build Ubuntu Installer if: matrix.os == 'ubuntu-20.04' - run: hatch run pyinstaller:build AntaresWebInstaller - working-directory: dist/ + run: hatch run pyinstaller:build - name: Upload binaries uses: actions/upload-artifact@v4 diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index c3744b5..b8bffac 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -73,7 +73,7 @@ def antares_web_server_fixture(antares_web_server_path: Path) -> t.Generator[sub # Wait for the server to be ready timeout_time = time.time() + SERVER_TIMEOUT while time.time() < timeout_time: - if ping("localhost", 8000, timeout=0.1): + if ping("localhost", 8080, timeout=0.1): break time.sleep(0.1) else: diff --git a/tests/integration/server_mock/server.py b/tests/integration/server_mock/server.py index 0c2e2dd..ee96fe6 100644 --- a/tests/integration/server_mock/server.py +++ b/tests/integration/server_mock/server.py @@ -14,7 +14,7 @@ # Define the server configuration HOST = "127.0.0.1" -PORT = 8000 +PORT = 8080 VERSION = "2.14.0" diff --git a/tests/integration/test_run_server.py b/tests/integration/test_run_server.py index 9ea69d5..ada44c3 100644 --- a/tests/integration/test_run_server.py +++ b/tests/integration/test_run_server.py @@ -6,6 +6,6 @@ def test_server_health(antares_web_server): Test the health endpoint of the Antares web server. """ - res = httpx.get("http://localhost:8000/health", timeout=0.25) + res = httpx.get("http://localhost:8080/health", timeout=0.25) assert res.status_code == 200, res.json() assert res.json() == {"status": "available"}