summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-06-05 14:28:42 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-06-06 14:33:59 +0000
commit8c19f8d8270c9095e30a0ef9b34332fb0f4b5868 (patch)
tree034512af76fa83419de3d1c3eaa6498c489b01c0
parent3b56da44bdafeff1237391ad9edbb73010bcd5ee (diff)
downloadbuildstream-8c19f8d8270c9095e30a0ef9b34332fb0f4b5868.tar.gz
test:utils/site: Consolidate MACHINE_ARCH variable in a single place
We have two different 'site' files that are redundant and both define some variables in BuildStream environment. Moving the MACHINE_ARCH to a single place.
-rw-r--r--src/buildstream/testing/_utils/site.py3
-rw-r--r--tests/cachekey/cachekey.py4
-rw-r--r--tests/examples/autotools.py4
-rw-r--r--tests/examples/developing.py4
-rw-r--r--tests/examples/flatpak-autotools.py3
-rw-r--r--tests/examples/integration-commands.py4
-rw-r--r--tests/examples/junctions.py4
-rw-r--r--tests/examples/running-commands.py4
-rw-r--r--tests/testutils/site.py3
9 files changed, 17 insertions, 16 deletions
diff --git a/src/buildstream/testing/_utils/site.py b/src/buildstream/testing/_utils/site.py
index 9d18d89bd..9e66b804e 100644
--- a/src/buildstream/testing/_utils/site.py
+++ b/src/buildstream/testing/_utils/site.py
@@ -7,6 +7,7 @@ import sys
import platform
from buildstream import _site, utils, ProgramNotFoundError
+from buildstream._platform import Platform
try:
@@ -73,3 +74,5 @@ elif IS_LINUX and HAVE_BWRAP:
HAVE_SANDBOX = True
else:
HAVE_SANDBOX = False
+
+MACHINE_ARCH = Platform.get_host_arch()
diff --git a/tests/cachekey/cachekey.py b/tests/cachekey/cachekey.py
index dc202a94e..84f19b9c3 100644
--- a/tests/cachekey/cachekey.py
+++ b/tests/cachekey/cachekey.py
@@ -45,10 +45,10 @@ import os
import pytest
from buildstream.testing.runcli import cli # pylint: disable=unused-import
-from buildstream.testing._utils.site import HAVE_BZR, HAVE_GIT
+from buildstream.testing._utils.site import HAVE_BZR, HAVE_GIT, MACHINE_ARCH
from buildstream.plugin import CoreWarnings
from buildstream import _yaml
-from tests.testutils.site import IS_LINUX, MACHINE_ARCH
+from tests.testutils.site import IS_LINUX
##############################################
diff --git a/tests/examples/autotools.py b/tests/examples/autotools.py
index 6e300d888..bf132a9a2 100644
--- a/tests/examples/autotools.py
+++ b/tests/examples/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 HAVE_BWRAP
-from tests.testutils.site import IS_LINUX, MACHINE_ARCH
+from buildstream.testing._utils.site import HAVE_BWRAP, MACHINE_ARCH
+from tests.testutils.site import IS_LINUX
pytestmark = pytest.mark.integration
diff --git a/tests/examples/developing.py b/tests/examples/developing.py
index b635a6cd3..6994ad4a9 100644
--- a/tests/examples/developing.py
+++ b/tests/examples/developing.py
@@ -6,9 +6,9 @@ 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
+from buildstream.testing._utils.site import HAVE_BWRAP, MACHINE_ARCH
import tests.testutils.patch as patch
-from tests.testutils.site import IS_LINUX, MACHINE_ARCH
+from tests.testutils.site import IS_LINUX
pytestmark = pytest.mark.integration
diff --git a/tests/examples/flatpak-autotools.py b/tests/examples/flatpak-autotools.py
index 8af564eb1..f7b76b322 100644
--- a/tests/examples/flatpak-autotools.py
+++ b/tests/examples/flatpak-autotools.py
@@ -6,7 +6,8 @@ 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 HAVE_OSTREE, IS_LINUX, MACHINE_ARCH
+from buildstream.testing._utils.site import MACHINE_ARCH
+from tests.testutils.site import HAVE_OSTREE, IS_LINUX
pytestmark = pytest.mark.integration
diff --git a/tests/examples/integration-commands.py b/tests/examples/integration-commands.py
index 84ff5e172..cdb27419e 100644
--- a/tests/examples/integration-commands.py
+++ b/tests/examples/integration-commands.py
@@ -5,8 +5,8 @@ import os
import pytest
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
-from buildstream.testing._utils.site import HAVE_BWRAP
-from tests.testutils.site import IS_LINUX, MACHINE_ARCH
+from buildstream.testing._utils.site import HAVE_BWRAP, MACHINE_ARCH
+from tests.testutils.site import IS_LINUX
pytestmark = pytest.mark.integration
diff --git a/tests/examples/junctions.py b/tests/examples/junctions.py
index 97a12deee..74e0c4476 100644
--- a/tests/examples/junctions.py
+++ b/tests/examples/junctions.py
@@ -5,8 +5,8 @@ import os
import pytest
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
-from buildstream.testing._utils.site import HAVE_BWRAP
-from tests.testutils.site import IS_LINUX, MACHINE_ARCH
+from buildstream.testing._utils.site import HAVE_BWRAP, MACHINE_ARCH
+from tests.testutils.site import IS_LINUX
pytestmark = pytest.mark.integration
diff --git a/tests/examples/running-commands.py b/tests/examples/running-commands.py
index 1be1066d9..a15836b64 100644
--- a/tests/examples/running-commands.py
+++ b/tests/examples/running-commands.py
@@ -5,8 +5,8 @@ import os
import pytest
from buildstream.testing import cli_integration as cli # pylint: disable=unused-import
-from buildstream.testing._utils.site import HAVE_BWRAP
-from tests.testutils.site import IS_LINUX, MACHINE_ARCH
+from buildstream.testing._utils.site import HAVE_BWRAP, MACHINE_ARCH
+from tests.testutils.site import IS_LINUX
pytestmark = pytest.mark.integration
diff --git a/tests/testutils/site.py b/tests/testutils/site.py
index b72be1e33..f2fe76509 100644
--- a/tests/testutils/site.py
+++ b/tests/testutils/site.py
@@ -6,7 +6,6 @@ import sys
import platform
from buildstream import utils, ProgramNotFoundError
-from buildstream._platform import Platform
from buildstream.testing._utils.site import HAVE_BWRAP as _HAVE_BWRAP
@@ -34,5 +33,3 @@ elif IS_LINUX and _HAVE_BWRAP:
HAVE_SANDBOX = True
else:
HAVE_SANDBOX = False
-
-MACHINE_ARCH = Platform.get_host_arch()