From a0343855468bd3d93207cb1139abcb91eb2b3713 Mon Sep 17 00:00:00 2001 From: Fabio Zadrozny Date: Thu, 12 Dec 2024 15:10:14 -0300 Subject: [PATCH] wip5 --- .../tests-sema4ai-sdk-data-server-integration.yml | 1 + sema4ai/tests/sema4ai_code_tests/data_server_fixtures.py | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/tests-sema4ai-sdk-data-server-integration.yml b/.github/workflows/tests-sema4ai-sdk-data-server-integration.yml index 702748e9..af437629 100644 --- a/.github/workflows/tests-sema4ai-sdk-data-server-integration.yml +++ b/.github/workflows/tests-sema4ai-sdk-data-server-integration.yml @@ -68,6 +68,7 @@ jobs: # Big timeout to create environment in windows. RUN_TESTS_TIMEOUT: 3000 ACTION_SERVER_TEST_ACCESS_CREDENTIALS: ${{ secrets.ACTION_SERVER_TEST_ACCESS_CREDENTIALS }} + PYTEST_CAN_RUN_DATA_SERVER: 1 run: poetry run python -u ../../sema4ai-python-ls-core/tests/run_tests.py -rfE -n 1 -otests_output_data_server -vv -m data_server . diff --git a/sema4ai/tests/sema4ai_code_tests/data_server_fixtures.py b/sema4ai/tests/sema4ai_code_tests/data_server_fixtures.py index 95f92a71..5aeae24a 100644 --- a/sema4ai/tests/sema4ai_code_tests/data_server_fixtures.py +++ b/sema4ai/tests/sema4ai_code_tests/data_server_fixtures.py @@ -169,6 +169,15 @@ def _is_current_db_data_valid( @pytest.fixture(scope="session") def data_server_cli(request, tmpdir_factory) -> Iterator["DataServerCliWrapper"]: + import os + + if os.getenv("GITHUB_ACTIONS"): + # Detect if running in github actions + if not os.getenv("PYTEST_CAN_RUN_DATA_SERVER"): + raise RuntimeError( + "Test must be marked with @pytest.mark.data_server to run in github actions to use `data_server_cli` fixture" + ) + from sema4ai_code_tests.data_server_cli_wrapper import DataServerCliWrapper from sema4ai_ls_core.system_mutex import timed_acquire_mutex