summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-06-05 14:45:01 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-06-06 14:34:00 +0000
commit556f71c9a3ccdc4c524f261926a364379506066d (patch)
tree1eaa6f496116e0280c9b4dd7ab29ea0b11fe6f73
parent75433adb848cd92b1600391ff1553feaaf274608 (diff)
downloadbuildstream-556f71c9a3ccdc4c524f261926a364379506066d.tar.gz
test:utils/site: Consolidate IS_LINUX/WSL/Windows in a single site
We currently have two sites file containing redundant information. - tests/testutils/site.py: Remove IS_{LINUX,WSL,WINDOWS} - rest: Change imports to import those from buildstream/tests/_utils/site.py
-rw-r--r--tests/cachekey/cachekey.py3
-rw-r--r--tests/examples/autotools.py3
-rw-r--r--tests/examples/developing.py3
-rw-r--r--tests/examples/first-project.py2
-rw-r--r--tests/examples/flatpak-autotools.py4
-rw-r--r--tests/examples/integration-commands.py3
-rw-r--r--tests/examples/junctions.py3
-rw-r--r--tests/examples/running-commands.py3
-rw-r--r--tests/frontend/buildcheckout.py2
-rw-r--r--tests/integration/build-uid.py4
-rw-r--r--tests/integration/cachedfail.py3
-rw-r--r--tests/sandboxes/missing_dependencies.py2
-rw-r--r--tests/testutils/site.py7
13 files changed, 13 insertions, 29 deletions
diff --git a/tests/cachekey/cachekey.py b/tests/cachekey/cachekey.py
index 84f19b9c3..7c5d90d1f 100644
--- a/tests/cachekey/cachekey.py
+++ b/tests/cachekey/cachekey.py
@@ -45,10 +45,9 @@ import os
import pytest
from buildstream.testing.runcli import cli # pylint: disable=unused-import
-from buildstream.testing._utils.site import HAVE_BZR, HAVE_GIT, MACHINE_ARCH
+from buildstream.testing._utils.site import HAVE_BZR, HAVE_GIT, IS_LINUX, MACHINE_ARCH
from buildstream.plugin import CoreWarnings
from buildstream import _yaml
-from tests.testutils.site import IS_LINUX
##############################################
diff --git a/tests/examples/autotools.py b/tests/examples/autotools.py
index bf132a9a2..ca311c4bb 100644
--- a/tests/examples/autotools.py
+++ b/tests/examples/autotools.py
@@ -6,8 +6,7 @@ import pytest
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
from buildstream.testing.integration import assert_contains
-from buildstream.testing._utils.site import HAVE_BWRAP, MACHINE_ARCH
-from tests.testutils.site import IS_LINUX
+from buildstream.testing._utils.site import HAVE_BWRAP, IS_LINUX, MACHINE_ARCH
pytestmark = pytest.mark.integration
diff --git a/tests/examples/developing.py b/tests/examples/developing.py
index 6994ad4a9..c2b950c01 100644
--- a/tests/examples/developing.py
+++ b/tests/examples/developing.py
@@ -6,9 +6,8 @@ import pytest
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
from buildstream.testing.integration import assert_contains
-from buildstream.testing._utils.site import HAVE_BWRAP, MACHINE_ARCH
+from buildstream.testing._utils.site import HAVE_BWRAP, IS_LINUX, MACHINE_ARCH
import tests.testutils.patch as patch
-from tests.testutils.site import IS_LINUX
pytestmark = pytest.mark.integration
diff --git a/tests/examples/first-project.py b/tests/examples/first-project.py
index d95c8293c..84ab7aa61 100644
--- a/tests/examples/first-project.py
+++ b/tests/examples/first-project.py
@@ -6,7 +6,7 @@ import pytest
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
from buildstream.testing.integration import assert_contains
-from tests.testutils.site import IS_LINUX
+from buildstream.testing._utils.site import IS_LINUX
pytestmark = pytest.mark.integration
diff --git a/tests/examples/flatpak-autotools.py b/tests/examples/flatpak-autotools.py
index f7b76b322..dc4a3ce15 100644
--- a/tests/examples/flatpak-autotools.py
+++ b/tests/examples/flatpak-autotools.py
@@ -6,8 +6,8 @@ import pytest
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
from buildstream.testing.integration import assert_contains
-from buildstream.testing._utils.site import MACHINE_ARCH
-from tests.testutils.site import HAVE_OSTREE, IS_LINUX
+from buildstream.testing._utils.site import IS_LINUX, MACHINE_ARCH
+from tests.testutils.site import HAVE_OSTREE
pytestmark = pytest.mark.integration
diff --git a/tests/examples/integration-commands.py b/tests/examples/integration-commands.py
index cdb27419e..ad794351f 100644
--- a/tests/examples/integration-commands.py
+++ b/tests/examples/integration-commands.py
@@ -5,8 +5,7 @@ import os
import pytest
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
-from buildstream.testing._utils.site import HAVE_BWRAP, MACHINE_ARCH
-from tests.testutils.site import IS_LINUX
+from buildstream.testing._utils.site import HAVE_BWRAP, IS_LINUX, MACHINE_ARCH
pytestmark = pytest.mark.integration
diff --git a/tests/examples/junctions.py b/tests/examples/junctions.py
index 74e0c4476..bb88e5068 100644
--- a/tests/examples/junctions.py
+++ b/tests/examples/junctions.py
@@ -5,8 +5,7 @@ import os
import pytest
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
-from buildstream.testing._utils.site import HAVE_BWRAP, MACHINE_ARCH
-from tests.testutils.site import IS_LINUX
+from buildstream.testing._utils.site import HAVE_BWRAP, IS_LINUX, MACHINE_ARCH
pytestmark = pytest.mark.integration
diff --git a/tests/examples/running-commands.py b/tests/examples/running-commands.py
index a15836b64..23b3e6467 100644
--- a/tests/examples/running-commands.py
+++ b/tests/examples/running-commands.py
@@ -5,8 +5,7 @@ import os
import pytest
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
-from buildstream.testing._utils.site import HAVE_BWRAP, MACHINE_ARCH
-from tests.testutils.site import IS_LINUX
+from buildstream.testing._utils.site import HAVE_BWRAP, IS_LINUX, MACHINE_ARCH
pytestmark = pytest.mark.integration
diff --git a/tests/frontend/buildcheckout.py b/tests/frontend/buildcheckout.py
index 835f084cf..556bf811c 100644
--- a/tests/frontend/buildcheckout.py
+++ b/tests/frontend/buildcheckout.py
@@ -9,10 +9,10 @@ import subprocess
import pytest
from buildstream.testing import cli # pylint: disable=unused-import
+from buildstream.testing._utils.site import IS_WINDOWS
from buildstream import _yaml
from buildstream._exceptions import ErrorDomain, LoadErrorReason
-from tests.testutils.site import IS_WINDOWS
from tests.testutils import generate_junction, yaml_file_get_provenance
from . import configure_project
diff --git a/tests/integration/build-uid.py b/tests/integration/build-uid.py
index 851d83a3d..2ebf230a1 100644
--- a/tests/integration/build-uid.py
+++ b/tests/integration/build-uid.py
@@ -5,9 +5,7 @@ import os
import pytest
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
-from buildstream.testing._utils.site import HAVE_BWRAP, HAVE_SANDBOX
-
-from tests.testutils.site import IS_LINUX
+from buildstream.testing._utils.site import HAVE_BWRAP, HAVE_SANDBOX, IS_LINUX
pytestmark = pytest.mark.integration
diff --git a/tests/integration/cachedfail.py b/tests/integration/cachedfail.py
index eb7723b64..a2273a06d 100644
--- a/tests/integration/cachedfail.py
+++ b/tests/integration/cachedfail.py
@@ -7,11 +7,10 @@ import pytest
from buildstream import _yaml
from buildstream._exceptions import ErrorDomain
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
-from buildstream.testing._utils.site import HAVE_BWRAP, HAVE_SANDBOX
+from buildstream.testing._utils.site import HAVE_BWRAP, HAVE_SANDBOX, IS_LINUX
from tests.conftest import clean_platform_cache
from tests.testutils import create_artifact_share
-from tests.testutils.site import IS_LINUX
pytestmark = pytest.mark.integration
diff --git a/tests/sandboxes/missing_dependencies.py b/tests/sandboxes/missing_dependencies.py
index 1f2a50422..ee346010e 100644
--- a/tests/sandboxes/missing_dependencies.py
+++ b/tests/sandboxes/missing_dependencies.py
@@ -7,9 +7,9 @@ import pytest
from buildstream import _yaml
from buildstream._exceptions import ErrorDomain
+from buildstream.testing._utils.site import IS_LINUX
from buildstream.testing import cli # pylint: disable=unused-import
-from tests.testutils.site import IS_LINUX
# Project directory
DATA_DIR = os.path.join(
diff --git a/tests/testutils/site.py b/tests/testutils/site.py
index 3058e6d6f..8cb5229ae 100644
--- a/tests/testutils/site.py
+++ b/tests/testutils/site.py
@@ -1,9 +1,6 @@
# Some things resolved about the execution site,
# so we dont have to repeat this everywhere
#
-import os
-import sys
-import platform
from buildstream import utils, ProgramNotFoundError
@@ -19,7 +16,3 @@ try:
HAVE_OSTREE = True
except (ImportError, ValueError):
HAVE_OSTREE = False
-
-IS_LINUX = os.getenv('BST_FORCE_BACKEND', sys.platform).startswith('linux')
-IS_WSL = (IS_LINUX and 'Microsoft' in platform.uname().release)
-IS_WINDOWS = (os.name == 'nt')