Skip to content

Commit

Permalink
try to run docker tests
Browse files Browse the repository at this point in the history
  • Loading branch information
czoido committed Sep 26, 2024
1 parent 4a71454 commit 5dbd8b9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/linux-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -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.
10 changes: 10 additions & 0 deletions test/functional/command/runner_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
"""
Expand Down Expand Up @@ -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():
"""
Expand Down Expand Up @@ -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():
"""
Expand Down Expand Up @@ -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():
"""
Expand Down Expand Up @@ -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():
"""
Expand Down Expand Up @@ -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():
"""
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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():
"""
Expand Down Expand Up @@ -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():
"""
Expand Down Expand Up @@ -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():
"""
Expand Down

0 comments on commit 5dbd8b9

Please sign in to comment.