From a81379f366b2068b730cd5f59a02759813cd5d3e Mon Sep 17 00:00:00 2001 From: David Sanchez Date: Tue, 23 Apr 2024 09:12:28 +0200 Subject: [PATCH] docker runner test skip fixed --- conans/requirements_dev.txt | 1 + conans/test/integration/command/runner_test.py | 15 +++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/conans/requirements_dev.txt b/conans/requirements_dev.txt index dd09b1800eb..c81ee6c559c 100644 --- a/conans/requirements_dev.txt +++ b/conans/requirements_dev.txt @@ -7,3 +7,4 @@ bottle PyJWT pluginbase docker>=5.0.0, <6.0.0 +setuptools \ No newline at end of file diff --git a/conans/test/integration/command/runner_test.py b/conans/test/integration/command/runner_test.py index aab2eeb0e30..421e67614b4 100644 --- a/conans/test/integration/command/runner_test.py +++ b/conans/test/integration/command/runner_test.py @@ -1,5 +1,6 @@ import textwrap import os +import sys import pytest import docker from conans.test.utils.tools import TestClient @@ -9,10 +10,12 @@ def docker_skip(test_image=None): + if sys.platform == 'win32': + return True try: docker_client = docker.from_env() if test_image: - docker_client.images.get(test_image) + docker_client.images.pull(test_image) except docker.errors.DockerException: return True except docker.errors.ImageNotFound: @@ -34,7 +37,7 @@ def dockerfile_path(name=None): return path -@pytest.mark.skipif(docker_skip(), reason="Only docker running") +@pytest.mark.skipif(docker_skip('ubuntu:22.04'), reason="Only docker running") # @pytest.mark.xfail(reason="conan inside docker optional test") def test_create_docker_runner_dockerfile_folder_path(): """ @@ -120,7 +123,7 @@ class MyTest(ConanFile): assert "Removing container" in client.out -@pytest.mark.skipif(docker_skip(), reason="Only docker running") +@pytest.mark.skipif(docker_skip('ubuntu:22.04'), reason="Only docker running") # @pytest.mark.xfail(reason="conan inside docker optional test") def test_create_docker_runner_dockerfile_file_path(): """ @@ -180,7 +183,7 @@ class MyTest(ConanFile): assert "Removing container" in client.out -@pytest.mark.skipif(docker_skip(), reason="Only docker running") +@pytest.mark.skipif(docker_skip('ubuntu:22.04'), reason="Only docker running") # @pytest.mark.xfail(reason="conan inside docker optional test") @pytest.mark.parametrize("build_type,shared", [("Release", False), ("Debug", True)]) @pytest.mark.tool("ninja") @@ -246,7 +249,7 @@ def package(self): assert 'cmake -G "Ninja"' in client.out assert "main: {}!".format(build_type) in client.out -@pytest.mark.skipif(docker_skip(), reason="Only docker running") +@pytest.mark.skipif(docker_skip('ubuntu:22.04'), reason="Only docker running") # @pytest.mark.xfail(reason="conan inside docker optional test") def test_create_docker_runner_profile_abs_path(): """ @@ -306,7 +309,7 @@ class MyTest(ConanFile): assert "Removing container" in client.out -@pytest.mark.skipif(docker_skip(), reason="Only docker running") +@pytest.mark.skipif(docker_skip('ubuntu:22.04'), reason="Only docker running") # @pytest.mark.xfail(reason="conan inside docker optional test") def test_create_docker_runner_profile_abs_path_from_configfile(): """