diff --git a/.github/workflows/linux-tests.yml b/.github/workflows/linux-tests.yml index 73d1126e334..26009428dd0 100644 --- a/.github/workflows/linux-tests.yml +++ b/.github/workflows/linux-tests.yml @@ -59,8 +59,8 @@ jobs: options: --user conan --volume /var/run/docker.sock:/var/run/docker.sock strategy: matrix: - python-version: ['3.12.3', '3.9.2', '3.8.6', '3.6.15'] - test-type: ['unittests', 'integration', 'functional'] + python-version: ['3.12.3']#, '3.9.2', '3.8.6', '3.6.15'] + test-type: ['unittests']#, 'integration', 'functional'] name: Python ${{ matrix.python-version }} - ${{ matrix.test-type }} steps: - name: Checkout code @@ -88,10 +88,11 @@ jobs: - name: Run tests shell: bash run: | - if [ "${{ matrix.test-type }}" == "unittests" ]; then - pytest test/unittests --durations=20 -n 4 -rs - elif [ "${{ matrix.test-type }}" == "integration" ]; then - pytest test/integration --durations=20 -n 4 -rs - elif [ "${{ matrix.test-type }}" == "functional" ]; then - pytest test/functional --durations=20 -n 4 -rs - fi + pytest -m docker_runner +# if [ "${{ matrix.test-type }}" == "unittests" ]; then +# pytest test/unittests --durations=20 -n 4 -rs +# elif [ "${{ matrix.test-type }}" == "integration" ]; then +# pytest test/integration --durations=20 -n 4 -rs +# elif [ "${{ matrix.test-type }}" == "functional" ]; then +# pytest test/functional --durations=20 -n 4 -rs +# fi diff --git a/pytest.ini b/pytest.ini index a69be4e9060..26456fc871e 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,3 +1,4 @@ [pytest] norecursedirs = '.*', 'dist', 'CVS', '_darcs', '{arch}', '*.egg', 'venv', 'assets' testpaths = 'test' +markers = docker_runner: Mark tests that require Docker to run. diff --git a/test/functional/command/runner_test.py b/test/functional/command/runner_test.py index fb601288aeb..4d4f58fa610 100644 --- a/test/functional/command/runner_test.py +++ b/test/functional/command/runner_test.py @@ -36,6 +36,7 @@ def dockerfile_path(name=None): return path +@pytest.mark.docker_runner @pytest.mark.skipif(docker_skip('ubuntu:22.04'), reason="Only docker running") def test_create_docker_runner_cache_shared(): """ @@ -79,6 +80,7 @@ def test_create_docker_runner_cache_shared(): assert "Removing container" in client.out +@pytest.mark.docker_runner @pytest.mark.skipif(docker_skip('ubuntu:22.04'), reason="Only docker running") def test_create_docker_runner_cache_shared_profile_from_cache(): """ @@ -122,6 +124,7 @@ def test_create_docker_runner_cache_shared_profile_from_cache(): assert "Removing container" in client.out +@pytest.mark.docker_runner @pytest.mark.skipif(docker_skip('ubuntu:22.04'), reason="Only docker running") def test_create_docker_runner_cache_shared_profile_folder(): """ @@ -165,6 +168,7 @@ def test_create_docker_runner_cache_shared_profile_folder(): assert "[100%] Built target example" in client.out assert "Removing container" in client.out +@pytest.mark.docker_runner @pytest.mark.skipif(docker_skip('ubuntu:22.04'), reason="Only docker running") def test_create_docker_runner_dockerfile_folder_path(): """ @@ -235,6 +239,7 @@ def test_create_docker_runner_dockerfile_folder_path(): assert "Removing container" in client.out +@pytest.mark.docker_runner @pytest.mark.skipif(docker_skip('ubuntu:22.04'), reason="Only docker running") def test_create_docker_runner_profile_default_folder(): """ @@ -280,6 +285,7 @@ def test_create_docker_runner_profile_default_folder(): assert "Removing container" in client.out +@pytest.mark.docker_runner @pytest.mark.skipif(docker_skip('ubuntu:22.04'), reason="Only docker running") def test_create_docker_runner_dockerfile_file_path(): """ @@ -324,6 +330,7 @@ def test_create_docker_runner_dockerfile_file_path(): assert "Removing container" in client.out +@pytest.mark.docker_runner @pytest.mark.skipif(docker_skip('ubuntu:22.04'), reason="Only docker running") @pytest.mark.parametrize("build_type,shared", [("Release", False), ("Debug", True)]) @pytest.mark.tool("ninja") @@ -389,6 +396,7 @@ def package(self): assert 'cmake -G "Ninja"' in client.out assert "main: {}!".format(build_type) in client.out +@pytest.mark.docker_runner @pytest.mark.skipif(docker_skip('ubuntu:22.04'), reason="Only docker running") def test_create_docker_runner_from_configfile(): """ @@ -443,6 +451,7 @@ def test_create_docker_runner_from_configfile(): assert "Removing container" in client.out +@pytest.mark.docker_runner @pytest.mark.skipif(docker_skip('ubuntu:22.04'), reason="Only docker running") def test_create_docker_runner_from_configfile_with_args(): """ @@ -499,6 +508,7 @@ def test_create_docker_runner_from_configfile_with_args(): assert "Removing container" in client.out +@pytest.mark.docker_runner @pytest.mark.skipif(docker_skip('ubuntu:22.04'), reason="Only docker running") def test_create_docker_runner_default_build_profile(): """