From 49cdfd3fc25d41d5a6797ef599b3ada11b6ddb02 Mon Sep 17 00:00:00 2001 From: Xuan Son Nguyen Date: Wed, 20 Nov 2024 00:19:07 +0100 Subject: [PATCH] fix test on windows --- .github/workflows/server.yml | 9 +++++---- examples/server/tests/features/steps/steps.py | 2 ++ examples/server/tests/utils.py | 4 +++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml index 699ac095d..5860a687e 100644 --- a/.github/workflows/server.yml +++ b/.github/workflows/server.yml @@ -122,14 +122,14 @@ jobs: id: server_integration_tests run: | cd examples/server/tests - PORT=8888 ./tests.sh + ./tests.sh - name: Slow tests id: server_integration_tests_slow if: ${{ (github.event.schedule || github.event.inputs.slow_tests == 'true') && matrix.build_type == 'Release' }} run: | cd examples/server/tests - PORT=8888 ./tests.sh --stop --no-skipped --no-capture --tags slow + SLOW_TESTS=1 ./tests.sh server-windows: @@ -180,11 +180,12 @@ jobs: run: | cd examples/server/tests $env:PYTHONIOENCODING = ":replace" - behave.exe --summary --stop --no-capture --exclude 'issues|wrong_usages|passkey' --tags llama.cpp + pytest -v -s - name: Slow tests id: server_integration_tests_slow if: ${{ (github.event.schedule || github.event.inputs.slow_tests == 'true') && matrix.build_type == 'Release' }} run: | cd examples/server/tests - behave.exe --stop --no-skipped --no-capture --tags slow + $env:SLOW_TESTS = "1" + pytest -v -s diff --git a/examples/server/tests/features/steps/steps.py b/examples/server/tests/features/steps/steps.py index 687b163f4..36b07dc09 100644 --- a/examples/server/tests/features/steps/steps.py +++ b/examples/server/tests/features/steps/steps.py @@ -1,6 +1,8 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +# type: ignore + import asyncio import json import os diff --git a/examples/server/tests/utils.py b/examples/server/tests/utils.py index e69498dcb..829658722 100644 --- a/examples/server/tests/utils.py +++ b/examples/server/tests/utils.py @@ -1,6 +1,8 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +# type: ignore[reportUnusedImport] + import subprocess import os import sys @@ -166,7 +168,7 @@ class ServerProcess: ) thread_stderr.start() - print(f"server pid={self.process.pid}, behave pid={os.getpid()}") + print(f"server pid={self.process.pid}, pytest pid={os.getpid()}") # wait for server to start start_time = time.time()