From 7b0b5a46ecc5ea3c270d1eb308e02d11f924bfa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Wed, 16 Apr 2025 12:23:56 +0200 Subject: [PATCH] :alembic: stop running tests requiring AYON server by default this is to ensure test will still run on GH. --- pyproject.toml | 8 ++++++++ .../ayon_core/plugins/publish/test_integrate_traits.py | 5 ++++- tools/manage.ps1 | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 16e7a53230..d940829a69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -152,3 +152,11 @@ addopts = "-ra -q" testpaths = [ "client/ayon_core/tests" ] +markers = [ + "unit: Unit tests", + "integration: Integration tests", + "api: API tests", + "cli: CLI tests", + "slow: Slow tests", + "server: Tests that require a running AYON server", +] diff --git a/tests/client/ayon_core/plugins/publish/test_integrate_traits.py b/tests/client/ayon_core/plugins/publish/test_integrate_traits.py index 71fcb928c0..abb605a121 100644 --- a/tests/client/ayon_core/plugins/publish/test_integrate_traits.py +++ b/tests/client/ayon_core/plugins/publish/test_integrate_traits.py @@ -76,7 +76,6 @@ def sequence_files(tmp_path_factory: pytest.TempPathFactory) -> list[Path]: def mock_context( project: pytest_ayon.ProjectInfo, single_file: Path, - folder_path: Path, sequence_files: list[Path]) -> pyblish.api.Context: """Return a mock instance. @@ -237,6 +236,7 @@ def mock_context( return context +@pytest.mark.server def test_get_template_name(mock_context: pyblish.api.Context) -> None: """Test get_template_name. @@ -355,6 +355,7 @@ def test_filter_lifecycle() -> None: assert filtered[0] == persistent_representation +@pytest.mark.server def test_prepare_product( project: pytest_ayon.ProjectInfo, mock_context: pyblish.api.Context) -> None: @@ -375,6 +376,7 @@ def test_prepare_product( } +@pytest.mark.server def test_prepare_version( project: pytest_ayon.ProjectInfo, mock_context: pyblish.api.Context) -> None: @@ -403,6 +405,7 @@ def test_prepare_version( } +@pytest.mark.server def test_get_transfers_from_representation( mock_context: pyblish.api.Context) -> None: """Test get_transfers_from_representation. diff --git a/tools/manage.ps1 b/tools/manage.ps1 index 8324277713..306a61e30d 100755 --- a/tools/manage.ps1 +++ b/tools/manage.ps1 @@ -242,7 +242,7 @@ function Run-From-Code { function Run-Tests { $Poetry = "$RepoRoot\.poetry\bin\poetry.exe" - $RunArgs = @( "run", "pytest", "$($RepoRoot)/tests") + $RunArgs = @( "run", "pytest", "$($RepoRoot)/tests", "-m", "not server") & $Poetry $RunArgs @arguments }