From c87d6e4506c620feb21c851248bd2f0b226160c0 Mon Sep 17 00:00:00 2001 From: Valentin David Date: Mon, 12 Nov 2018 12:55:22 +0100 Subject: Run tests on aarch64 Fixes #755 --- .gitlab-ci.yml | 16 +++++++++++----- tests/integration/project/elements/base/base-alpine.bst | 9 +++++++-- tests/integration/project/project.conf | 6 ++++++ 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 35a960b31..e030d7a54 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -86,25 +86,31 @@ source_dist: - coverage-linux/ tests-debian-9: - image: buildstream/testsuite-debian:9-master-119-552f5fc6 + image: buildstream/testsuite-debian:9-master-123-7ce6581b <<: *linux-tests tests-fedora-27: - image: buildstream/testsuite-fedora:27-master-119-552f5fc6 + image: buildstream/testsuite-fedora:27-master-123-7ce6581b <<: *linux-tests tests-fedora-28: - image: buildstream/testsuite-fedora:28-master-119-552f5fc6 + image: buildstream/testsuite-fedora:28-master-123-7ce6581b <<: *linux-tests tests-ubuntu-18.04: - image: buildstream/testsuite-ubuntu:18.04-master-119-552f5fc6 + image: buildstream/testsuite-ubuntu:18.04-master-123-7ce6581b + <<: *linux-tests + +tests-fedora-28-aarch64: + image: buildstream/testsuite-fedora:aarch64-28-master-123-7ce6581b + tags: + - aarch64 <<: *linux-tests tests-unix: # Use fedora here, to a) run a test on fedora and b) ensure that we # can get rid of ostree - this is not possible with debian-8 - image: buildstream/testsuite-fedora:27-master-119-552f5fc6 + image: buildstream/testsuite-fedora:27-master-123-7ce6581b stage: test variables: BST_FORCE_BACKEND: "unix" diff --git a/tests/integration/project/elements/base/base-alpine.bst b/tests/integration/project/elements/base/base-alpine.bst index 687588f7c..dd5ee7d88 100644 --- a/tests/integration/project/elements/base/base-alpine.bst +++ b/tests/integration/project/elements/base/base-alpine.bst @@ -7,6 +7,11 @@ description: | sources: - kind: tar - url: alpine:integration-tests-base.v1.x86_64.tar.xz base-dir: '' - ref: 3eb559250ba82b64a68d86d0636a6b127aa5f6d25d3601a79f79214dc9703639 + (?): + - arch == "x86_64": + ref: 3eb559250ba82b64a68d86d0636a6b127aa5f6d25d3601a79f79214dc9703639 + url: "alpine:integration-tests-base.v1.x86_64.tar.xz" + - arch == "aarch64": + ref: 431fb5362032ede6f172e70a3258354a8fd71fcbdeb1edebc0e20968c792329a + url: "alpine:integration-tests-base.v1.aarch64.tar.xz" diff --git a/tests/integration/project/project.conf b/tests/integration/project/project.conf index 3bf128543..e0475539a 100644 --- a/tests/integration/project/project.conf +++ b/tests/integration/project/project.conf @@ -9,6 +9,12 @@ options: type: bool description: Whether to expect a linux platform default: True + arch: + type: arch + description: Current architecture + values: + - x86_64 + - aarch64 split-rules: test: - | -- cgit v1.2.1 From 16b0148976b8a92c4ba7888e407cd4c5e26e0cae Mon Sep 17 00:00:00 2001 From: Valentin David Date: Mon, 12 Nov 2018 14:21:46 +0100 Subject: Disable cachekey tests on other architectures than x86_64 --- tests/cachekey/cachekey.py | 4 +++- tests/testutils/site.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/cachekey/cachekey.py b/tests/cachekey/cachekey.py index b1f8a9140..113f5bab0 100644 --- a/tests/cachekey/cachekey.py +++ b/tests/cachekey/cachekey.py @@ -36,7 +36,7 @@ # the result. # from tests.testutils.runcli import cli -from tests.testutils.site import HAVE_BZR, HAVE_GIT, HAVE_OSTREE, IS_LINUX +from tests.testutils.site import HAVE_BZR, HAVE_GIT, HAVE_OSTREE, IS_LINUX, MACHINE_ARCH from buildstream.plugin import CoreWarnings from buildstream import _yaml import os @@ -144,6 +144,8 @@ DATA_DIR = os.path.join( # The cache key test uses a project which exercises all plugins, # so we cant run it at all if we dont have them installed. # +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64', + reason='Cache keys depend on architecture') @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') @pytest.mark.skipif(HAVE_BZR is False, reason="bzr is not available") @pytest.mark.skipif(HAVE_GIT is False, reason="git is not available") diff --git a/tests/testutils/site.py b/tests/testutils/site.py index 7dc01a613..6801be471 100644 --- a/tests/testutils/site.py +++ b/tests/testutils/site.py @@ -49,3 +49,5 @@ except ImportError: HAVE_ARPY = False IS_LINUX = os.getenv('BST_FORCE_BACKEND', sys.platform).startswith('linux') + +_, _, _, _, MACHINE_ARCH = os.uname() -- cgit v1.2.1 From 85046b29000f9f61579413fffe8cac96a036ad9e Mon Sep 17 00:00:00 2001 From: Valentin David Date: Mon, 12 Nov 2018 14:22:17 +0100 Subject: Disable tests on example on other architectures than x86_64 --- tests/examples/autotools.py | 6 +++++- tests/examples/developing.py | 8 +++++++- tests/examples/flatpak-autotools.py | 6 +++++- tests/examples/integration-commands.py | 6 +++++- tests/examples/junctions.py | 6 +++++- tests/examples/running-commands.py | 6 +++++- 6 files changed, 32 insertions(+), 6 deletions(-) diff --git a/tests/examples/autotools.py b/tests/examples/autotools.py index 37f6ed0e3..fc6ff7e09 100644 --- a/tests/examples/autotools.py +++ b/tests/examples/autotools.py @@ -3,7 +3,7 @@ import pytest from tests.testutils import cli_integration as cli from tests.testutils.integration import assert_contains -from tests.testutils.site import IS_LINUX +from tests.testutils.site import IS_LINUX, MACHINE_ARCH pytestmark = pytest.mark.integration @@ -13,6 +13,8 @@ DATA_DIR = os.path.join( # Tests a build of the autotools amhello project on a alpine-linux base runtime +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64', + reason='Examples are writtent for x86_64') @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') @pytest.mark.datafiles(DATA_DIR) def test_autotools_build(cli, tmpdir, datafiles): @@ -36,6 +38,8 @@ def test_autotools_build(cli, tmpdir, datafiles): # Test running an executable built with autotools. +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64', + reason='Examples are writtent for x86_64') @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') @pytest.mark.datafiles(DATA_DIR) def test_autotools_run(cli, tmpdir, datafiles): diff --git a/tests/examples/developing.py b/tests/examples/developing.py index bca6ac61d..6c65c5e54 100644 --- a/tests/examples/developing.py +++ b/tests/examples/developing.py @@ -4,7 +4,7 @@ import pytest import tests.testutils.patch as patch from tests.testutils import cli_integration as cli from tests.testutils.integration import assert_contains -from tests.testutils.site import IS_LINUX +from tests.testutils.site import IS_LINUX, MACHINE_ARCH pytestmark = pytest.mark.integration @@ -14,6 +14,8 @@ DATA_DIR = os.path.join( # Test that the project builds successfully +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64', + reason='Examples are writtent for x86_64') @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') @pytest.mark.datafiles(DATA_DIR) def test_autotools_build(cli, tmpdir, datafiles): @@ -35,6 +37,8 @@ def test_autotools_build(cli, tmpdir, datafiles): # Test the unmodified hello command works as expected. +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64', + reason='Examples are writtent for x86_64') @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') @pytest.mark.datafiles(DATA_DIR) def test_run_unmodified_hello(cli, tmpdir, datafiles): @@ -66,6 +70,8 @@ def test_open_workspace(cli, tmpdir, datafiles): # Test making a change using the workspace +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64', + reason='Examples are writtent for x86_64') @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') @pytest.mark.datafiles(DATA_DIR) def test_make_change_in_workspace(cli, tmpdir, datafiles): diff --git a/tests/examples/flatpak-autotools.py b/tests/examples/flatpak-autotools.py index 2d02755fc..32a0dc193 100644 --- a/tests/examples/flatpak-autotools.py +++ b/tests/examples/flatpak-autotools.py @@ -3,7 +3,7 @@ import pytest from tests.testutils import cli_integration as cli from tests.testutils.integration import assert_contains -from tests.testutils.site import IS_LINUX +from tests.testutils.site import IS_LINUX, MACHINE_ARCH pytestmark = pytest.mark.integration @@ -32,6 +32,8 @@ def workaround_setuptools_bug(project): # Test that a build upon flatpak runtime 'works' - we use the autotools sample # amhello project for this. +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64', + reason='Examples are writtent for x86_64') @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') @pytest.mark.datafiles(DATA_DIR) def test_autotools_build(cli, tmpdir, datafiles): @@ -55,6 +57,8 @@ def test_autotools_build(cli, tmpdir, datafiles): # Test running an executable built with autotools +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64', + reason='Examples are writtent for x86_64') @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') @pytest.mark.datafiles(DATA_DIR) def test_autotools_run(cli, tmpdir, datafiles): diff --git a/tests/examples/integration-commands.py b/tests/examples/integration-commands.py index 32ef763eb..19c5df2ef 100644 --- a/tests/examples/integration-commands.py +++ b/tests/examples/integration-commands.py @@ -3,7 +3,7 @@ import pytest from tests.testutils import cli_integration as cli from tests.testutils.integration import assert_contains -from tests.testutils.site import IS_LINUX +from tests.testutils.site import IS_LINUX, MACHINE_ARCH pytestmark = pytest.mark.integration @@ -12,6 +12,8 @@ DATA_DIR = os.path.join( ) +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64', + reason='Examples are writtent for x86_64') @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') @pytest.mark.datafiles(DATA_DIR) def test_integration_commands_build(cli, tmpdir, datafiles): @@ -23,6 +25,8 @@ def test_integration_commands_build(cli, tmpdir, datafiles): # Test running the executable +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64', + reason='Examples are writtent for x86_64') @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') @pytest.mark.datafiles(DATA_DIR) def test_integration_commands_run(cli, tmpdir, datafiles): diff --git a/tests/examples/junctions.py b/tests/examples/junctions.py index d2a653884..9ddb7b7fb 100644 --- a/tests/examples/junctions.py +++ b/tests/examples/junctions.py @@ -3,7 +3,7 @@ import pytest from tests.testutils import cli_integration as cli from tests.testutils.integration import assert_contains -from tests.testutils.site import IS_LINUX +from tests.testutils.site import IS_LINUX, MACHINE_ARCH pytestmark = pytest.mark.integration @@ -13,6 +13,8 @@ DATA_DIR = os.path.join( # Test that the project builds successfully +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64', + reason='Examples are writtent for x86_64') @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') @pytest.mark.datafiles(DATA_DIR) def test_build(cli, tmpdir, datafiles): @@ -23,6 +25,8 @@ def test_build(cli, tmpdir, datafiles): # Test the callHello script works as expected. +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64', + reason='Examples are writtent for x86_64') @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') @pytest.mark.datafiles(DATA_DIR) def test_shell_call_hello(cli, tmpdir, datafiles): diff --git a/tests/examples/running-commands.py b/tests/examples/running-commands.py index 95f645d77..26b53f7ad 100644 --- a/tests/examples/running-commands.py +++ b/tests/examples/running-commands.py @@ -3,7 +3,7 @@ import pytest from tests.testutils import cli_integration as cli from tests.testutils.integration import assert_contains -from tests.testutils.site import IS_LINUX +from tests.testutils.site import IS_LINUX, MACHINE_ARCH pytestmark = pytest.mark.integration @@ -12,6 +12,8 @@ DATA_DIR = os.path.join( ) +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64', + reason='Examples are writtent for x86_64') @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') @pytest.mark.datafiles(DATA_DIR) def test_running_commands_build(cli, tmpdir, datafiles): @@ -23,6 +25,8 @@ def test_running_commands_build(cli, tmpdir, datafiles): # Test running the executable +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64', + reason='Examples are writtent for x86_64') @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') @pytest.mark.datafiles(DATA_DIR) def test_running_commands_run(cli, tmpdir, datafiles): -- cgit v1.2.1 From dd5a073b2dc95b7908bce8015bb8dd44f48bd78d Mon Sep 17 00:00:00 2001 From: Valentin David Date: Mon, 12 Nov 2018 16:19:56 +0100 Subject: Add support for aarch64 in a test --- tests/format/list-directive-type-error/project.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/format/list-directive-type-error/project.conf b/tests/format/list-directive-type-error/project.conf index dde56d7b8..1dd0f1b0a 100644 --- a/tests/format/list-directive-type-error/project.conf +++ b/tests/format/list-directive-type-error/project.conf @@ -4,4 +4,4 @@ options: arch: type: arch description: Example architecture option - values: [ x86_32, x86_64 ] + values: [ x86_32, x86_64, aarch64 ] -- cgit v1.2.1 From c5d72ae789ddc7669bfea6abdd47ea2e00b90984 Mon Sep 17 00:00:00 2001 From: Valentin David Date: Wed, 14 Nov 2018 12:51:44 +0100 Subject: Test aarch64 only overnight --- .gitlab-ci.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e030d7a54..e5aeb495a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -79,8 +79,6 @@ source_dist: - cd ../.. - mkdir -p coverage-linux/ - cp dist/buildstream/.coverage coverage-linux/coverage."${CI_JOB_NAME}" - except: - - schedules artifacts: paths: - coverage-linux/ @@ -88,24 +86,34 @@ source_dist: tests-debian-9: image: buildstream/testsuite-debian:9-master-123-7ce6581b <<: *linux-tests + except: + - schedules tests-fedora-27: image: buildstream/testsuite-fedora:27-master-123-7ce6581b <<: *linux-tests + except: + - schedules tests-fedora-28: image: buildstream/testsuite-fedora:28-master-123-7ce6581b <<: *linux-tests + except: + - schedules tests-ubuntu-18.04: image: buildstream/testsuite-ubuntu:18.04-master-123-7ce6581b <<: *linux-tests + except: + - schedules -tests-fedora-28-aarch64: +overnight-fedora-28-aarch64: image: buildstream/testsuite-fedora:aarch64-28-master-123-7ce6581b tags: - aarch64 <<: *linux-tests + only: + - schedules tests-unix: # Use fedora here, to a) run a test on fedora and b) ensure that we -- cgit v1.2.1