[Notes] [Git][BuildStream/buildstream][valentindavid/integration-tests-aarch64] 7 commits: _project.py: Validate nodes early in Project._load



Title: GitLab

Valentin David pushed to branch valentindavid/integration-tests-aarch64 at BuildStream / buildstream

Commits:

15 changed files:

Changes:

  • .gitlab-ci.yml
    ... ... @@ -86,25 +86,31 @@ source_dist:
    86 86
         - coverage-linux/
    
    87 87
     
    
    88 88
     tests-debian-9:
    
    89
    -  image: buildstream/testsuite-debian:9-master-119-552f5fc6
    
    89
    +  image: buildstream/testsuite-debian:9-master-123-7ce6581b
    
    90 90
       <<: *linux-tests
    
    91 91
     
    
    92 92
     tests-fedora-27:
    
    93
    -  image: buildstream/testsuite-fedora:27-master-119-552f5fc6
    
    93
    +  image: buildstream/testsuite-fedora:27-master-123-7ce6581b
    
    94 94
       <<: *linux-tests
    
    95 95
     
    
    96 96
     tests-fedora-28:
    
    97
    -  image: buildstream/testsuite-fedora:28-master-119-552f5fc6
    
    97
    +  image: buildstream/testsuite-fedora:28-master-123-7ce6581b
    
    98 98
       <<: *linux-tests
    
    99 99
     
    
    100 100
     tests-ubuntu-18.04:
    
    101
    -  image: buildstream/testsuite-ubuntu:18.04-master-119-552f5fc6
    
    101
    +  image: buildstream/testsuite-ubuntu:18.04-master-123-7ce6581b
    
    102
    +  <<: *linux-tests
    
    103
    +
    
    104
    +tests-fedora-28-aarch64:
    
    105
    +  image: buildstream/testsuite-fedora:aarch64-28-master-123-7ce6581b
    
    106
    +  tags:
    
    107
    +    - aarch64
    
    102 108
       <<: *linux-tests
    
    103 109
     
    
    104 110
     tests-unix:
    
    105 111
       # Use fedora here, to a) run a test on fedora and b) ensure that we
    
    106 112
       # can get rid of ostree - this is not possible with debian-8
    
    107
    -  image: buildstream/testsuite-fedora:27-master-119-552f5fc6
    
    113
    +  image: buildstream/testsuite-fedora:27-master-123-7ce6581b
    
    108 114
       stage: test
    
    109 115
       variables:
    
    110 116
         BST_FORCE_BACKEND: "unix"
    

  • buildstream/_project.py
    ... ... @@ -219,6 +219,19 @@ class Project():
    219 219
     
    
    220 220
             return self._cache_key
    
    221 221
     
    
    222
    +    def _validate_node(self, node):
    
    223
    +        _yaml.node_validate(node, [
    
    224
    +            'format-version',
    
    225
    +            'element-path', 'variables',
    
    226
    +            'environment', 'environment-nocache',
    
    227
    +            'split-rules', 'elements', 'plugins',
    
    228
    +            'aliases', 'name',
    
    229
    +            'artifacts', 'options',
    
    230
    +            'fail-on-overlap', 'shell', 'fatal-warnings',
    
    231
    +            'ref-storage', 'sandbox', 'mirrors', 'remote-execution',
    
    232
    +            'sources', '(@)'
    
    233
    +        ])
    
    234
    +
    
    222 235
         # create_element()
    
    223 236
         #
    
    224 237
         # Instantiate and return an element
    
    ... ... @@ -402,6 +415,8 @@ class Project():
    402 415
                     "Project requested format version {}, but BuildStream {}.{} only supports up until format version {}"
    
    403 416
                     .format(format_version, major, minor, BST_FORMAT_VERSION))
    
    404 417
     
    
    418
    +        self._validate_node(pre_config_node)
    
    419
    +
    
    405 420
             # FIXME:
    
    406 421
             #
    
    407 422
             #   Performing this check manually in the absense
    
    ... ... @@ -467,16 +482,7 @@ class Project():
    467 482
     
    
    468 483
             self._load_pass(config, self.config)
    
    469 484
     
    
    470
    -        _yaml.node_validate(config, [
    
    471
    -            'format-version',
    
    472
    -            'element-path', 'variables',
    
    473
    -            'environment', 'environment-nocache',
    
    474
    -            'split-rules', 'elements', 'plugins',
    
    475
    -            'aliases', 'name',
    
    476
    -            'artifacts', 'options',
    
    477
    -            'fail-on-overlap', 'shell', 'fatal-warnings',
    
    478
    -            'ref-storage', 'sandbox', 'mirrors', 'remote-execution'
    
    479
    -        ])
    
    485
    +        self._validate_node(config)
    
    480 486
     
    
    481 487
             #
    
    482 488
             # Now all YAML composition is done, from here on we just load
    

  • tests/cachekey/cachekey.py
    ... ... @@ -36,7 +36,7 @@
    36 36
     # the result.
    
    37 37
     #
    
    38 38
     from tests.testutils.runcli import cli
    
    39
    -from tests.testutils.site import HAVE_BZR, HAVE_GIT, HAVE_OSTREE, IS_LINUX
    
    39
    +from tests.testutils.site import HAVE_BZR, HAVE_GIT, HAVE_OSTREE, IS_LINUX, MACHINE_ARCH
    
    40 40
     from buildstream.plugin import CoreWarnings
    
    41 41
     from buildstream import _yaml
    
    42 42
     import os
    
    ... ... @@ -144,6 +144,8 @@ DATA_DIR = os.path.join(
    144 144
     # The cache key test uses a project which exercises all plugins,
    
    145 145
     # so we cant run it at all if we dont have them installed.
    
    146 146
     #
    
    147
    +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
    
    148
    +                    reason='Cache keys depend on architecture')
    
    147 149
     @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
    
    148 150
     @pytest.mark.skipif(HAVE_BZR is False, reason="bzr is not available")
    
    149 151
     @pytest.mark.skipif(HAVE_GIT is False, reason="git is not available")
    

  • tests/examples/autotools.py
    ... ... @@ -3,7 +3,7 @@ import pytest
    3 3
     
    
    4 4
     from tests.testutils import cli_integration as cli
    
    5 5
     from tests.testutils.integration import assert_contains
    
    6
    -from tests.testutils.site import IS_LINUX
    
    6
    +from tests.testutils.site import IS_LINUX, MACHINE_ARCH
    
    7 7
     
    
    8 8
     pytestmark = pytest.mark.integration
    
    9 9
     
    
    ... ... @@ -13,6 +13,8 @@ DATA_DIR = os.path.join(
    13 13
     
    
    14 14
     
    
    15 15
     # Tests a build of the autotools amhello project on a alpine-linux base runtime
    
    16
    +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
    
    17
    +                    reason='Examples are writtent for x86_64')
    
    16 18
     @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
    
    17 19
     @pytest.mark.datafiles(DATA_DIR)
    
    18 20
     def test_autotools_build(cli, tmpdir, datafiles):
    
    ... ... @@ -36,6 +38,8 @@ def test_autotools_build(cli, tmpdir, datafiles):
    36 38
     
    
    37 39
     
    
    38 40
     # Test running an executable built with autotools.
    
    41
    +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
    
    42
    +                    reason='Examples are writtent for x86_64')
    
    39 43
     @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
    
    40 44
     @pytest.mark.datafiles(DATA_DIR)
    
    41 45
     def test_autotools_run(cli, tmpdir, datafiles):
    

  • tests/examples/developing.py
    ... ... @@ -4,7 +4,7 @@ import pytest
    4 4
     import tests.testutils.patch as patch
    
    5 5
     from tests.testutils import cli_integration as cli
    
    6 6
     from tests.testutils.integration import assert_contains
    
    7
    -from tests.testutils.site import IS_LINUX
    
    7
    +from tests.testutils.site import IS_LINUX, MACHINE_ARCH
    
    8 8
     
    
    9 9
     pytestmark = pytest.mark.integration
    
    10 10
     
    
    ... ... @@ -14,6 +14,8 @@ DATA_DIR = os.path.join(
    14 14
     
    
    15 15
     
    
    16 16
     # Test that the project builds successfully
    
    17
    +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
    
    18
    +                    reason='Examples are writtent for x86_64')
    
    17 19
     @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
    
    18 20
     @pytest.mark.datafiles(DATA_DIR)
    
    19 21
     def test_autotools_build(cli, tmpdir, datafiles):
    
    ... ... @@ -35,6 +37,8 @@ def test_autotools_build(cli, tmpdir, datafiles):
    35 37
     
    
    36 38
     
    
    37 39
     # Test the unmodified hello command works as expected.
    
    40
    +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
    
    41
    +                    reason='Examples are writtent for x86_64')
    
    38 42
     @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
    
    39 43
     @pytest.mark.datafiles(DATA_DIR)
    
    40 44
     def test_run_unmodified_hello(cli, tmpdir, datafiles):
    
    ... ... @@ -66,6 +70,8 @@ def test_open_workspace(cli, tmpdir, datafiles):
    66 70
     
    
    67 71
     
    
    68 72
     # Test making a change using the workspace
    
    73
    +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
    
    74
    +                    reason='Examples are writtent for x86_64')
    
    69 75
     @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
    
    70 76
     @pytest.mark.datafiles(DATA_DIR)
    
    71 77
     def test_make_change_in_workspace(cli, tmpdir, datafiles):
    

  • tests/examples/flatpak-autotools.py
    ... ... @@ -3,7 +3,7 @@ import pytest
    3 3
     
    
    4 4
     from tests.testutils import cli_integration as cli
    
    5 5
     from tests.testutils.integration import assert_contains
    
    6
    -from tests.testutils.site import IS_LINUX
    
    6
    +from tests.testutils.site import IS_LINUX, MACHINE_ARCH
    
    7 7
     
    
    8 8
     
    
    9 9
     pytestmark = pytest.mark.integration
    
    ... ... @@ -32,6 +32,8 @@ def workaround_setuptools_bug(project):
    32 32
     
    
    33 33
     # Test that a build upon flatpak runtime 'works' - we use the autotools sample
    
    34 34
     # amhello project for this.
    
    35
    +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
    
    36
    +                    reason='Examples are writtent for x86_64')
    
    35 37
     @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
    
    36 38
     @pytest.mark.datafiles(DATA_DIR)
    
    37 39
     def test_autotools_build(cli, tmpdir, datafiles):
    
    ... ... @@ -55,6 +57,8 @@ def test_autotools_build(cli, tmpdir, datafiles):
    55 57
     
    
    56 58
     
    
    57 59
     # Test running an executable built with autotools
    
    60
    +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
    
    61
    +                    reason='Examples are writtent for x86_64')
    
    58 62
     @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
    
    59 63
     @pytest.mark.datafiles(DATA_DIR)
    
    60 64
     def test_autotools_run(cli, tmpdir, datafiles):
    

  • tests/examples/integration-commands.py
    ... ... @@ -3,7 +3,7 @@ import pytest
    3 3
     
    
    4 4
     from tests.testutils import cli_integration as cli
    
    5 5
     from tests.testutils.integration import assert_contains
    
    6
    -from tests.testutils.site import IS_LINUX
    
    6
    +from tests.testutils.site import IS_LINUX, MACHINE_ARCH
    
    7 7
     
    
    8 8
     
    
    9 9
     pytestmark = pytest.mark.integration
    
    ... ... @@ -12,6 +12,8 @@ DATA_DIR = os.path.join(
    12 12
     )
    
    13 13
     
    
    14 14
     
    
    15
    +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
    
    16
    +                    reason='Examples are writtent for x86_64')
    
    15 17
     @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
    
    16 18
     @pytest.mark.datafiles(DATA_DIR)
    
    17 19
     def test_integration_commands_build(cli, tmpdir, datafiles):
    
    ... ... @@ -23,6 +25,8 @@ def test_integration_commands_build(cli, tmpdir, datafiles):
    23 25
     
    
    24 26
     
    
    25 27
     # Test running the executable
    
    28
    +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
    
    29
    +                    reason='Examples are writtent for x86_64')
    
    26 30
     @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
    
    27 31
     @pytest.mark.datafiles(DATA_DIR)
    
    28 32
     def test_integration_commands_run(cli, tmpdir, datafiles):
    

  • tests/examples/junctions.py
    ... ... @@ -3,7 +3,7 @@ import pytest
    3 3
     
    
    4 4
     from tests.testutils import cli_integration as cli
    
    5 5
     from tests.testutils.integration import assert_contains
    
    6
    -from tests.testutils.site import IS_LINUX
    
    6
    +from tests.testutils.site import IS_LINUX, MACHINE_ARCH
    
    7 7
     
    
    8 8
     pytestmark = pytest.mark.integration
    
    9 9
     
    
    ... ... @@ -13,6 +13,8 @@ DATA_DIR = os.path.join(
    13 13
     
    
    14 14
     
    
    15 15
     # Test that the project builds successfully
    
    16
    +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
    
    17
    +                    reason='Examples are writtent for x86_64')
    
    16 18
     @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
    
    17 19
     @pytest.mark.datafiles(DATA_DIR)
    
    18 20
     def test_build(cli, tmpdir, datafiles):
    
    ... ... @@ -23,6 +25,8 @@ def test_build(cli, tmpdir, datafiles):
    23 25
     
    
    24 26
     
    
    25 27
     # Test the callHello script works as expected.
    
    28
    +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
    
    29
    +                    reason='Examples are writtent for x86_64')
    
    26 30
     @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
    
    27 31
     @pytest.mark.datafiles(DATA_DIR)
    
    28 32
     def test_shell_call_hello(cli, tmpdir, datafiles):
    

  • tests/examples/running-commands.py
    ... ... @@ -3,7 +3,7 @@ import pytest
    3 3
     
    
    4 4
     from tests.testutils import cli_integration as cli
    
    5 5
     from tests.testutils.integration import assert_contains
    
    6
    -from tests.testutils.site import IS_LINUX
    
    6
    +from tests.testutils.site import IS_LINUX, MACHINE_ARCH
    
    7 7
     
    
    8 8
     
    
    9 9
     pytestmark = pytest.mark.integration
    
    ... ... @@ -12,6 +12,8 @@ DATA_DIR = os.path.join(
    12 12
     )
    
    13 13
     
    
    14 14
     
    
    15
    +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
    
    16
    +                    reason='Examples are writtent for x86_64')
    
    15 17
     @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
    
    16 18
     @pytest.mark.datafiles(DATA_DIR)
    
    17 19
     def test_running_commands_build(cli, tmpdir, datafiles):
    
    ... ... @@ -23,6 +25,8 @@ def test_running_commands_build(cli, tmpdir, datafiles):
    23 25
     
    
    24 26
     
    
    25 27
     # Test running the executable
    
    28
    +@pytest.mark.skipif(MACHINE_ARCH != 'x86_64',
    
    29
    +                    reason='Examples are writtent for x86_64')
    
    26 30
     @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
    
    27 31
     @pytest.mark.datafiles(DATA_DIR)
    
    28 32
     def test_running_commands_run(cli, tmpdir, datafiles):
    

  • tests/format/list-directive-type-error/project.conf
    ... ... @@ -4,4 +4,4 @@ options:
    4 4
       arch:
    
    5 5
         type: arch
    
    6 6
         description: Example architecture option
    
    7
    -    values: [ x86_32, x86_64 ]
    7
    +    values: [ x86_32, x86_64, aarch64 ]

  • tests/frontend/invalid_element_path/project.conf
    1
    +# Project config for frontend build test
    
    2
    +name: test
    
    3
    +
    
    4
    +elephant-path: elements

  • tests/frontend/show.py
    ... ... @@ -36,6 +36,19 @@ def test_show(cli, datafiles, target, format, expected):
    36 36
                                  .format(expected, result.output))
    
    37 37
     
    
    38 38
     
    
    39
    +@pytest.mark.datafiles(os.path.join(
    
    40
    +    os.path.dirname(os.path.realpath(__file__)),
    
    41
    +    "invalid_element_path",
    
    42
    +))
    
    43
    +def test_show_invalid_element_path(cli, datafiles):
    
    44
    +    project = os.path.join(datafiles.dirname, datafiles.basename)
    
    45
    +    result = cli.run(project=project, silent=True, args=[
    
    46
    +        'show',
    
    47
    +        "foo.bst"])
    
    48
    +
    
    49
    +    result.assert_main_error(ErrorDomain.LOAD, LoadErrorReason.INVALID_DATA)
    
    50
    +
    
    51
    +
    
    39 52
     @pytest.mark.datafiles(DATA_DIR)
    
    40 53
     @pytest.mark.parametrize("target,except_,expected", [
    
    41 54
         ('target.bst', 'import-bin.bst', ['import-dev.bst', 'compose-all.bst', 'target.bst']),
    

  • tests/integration/project/elements/base/base-alpine.bst
    ... ... @@ -7,6 +7,11 @@ description: |
    7 7
     
    
    8 8
     sources:
    
    9 9
       - kind: tar
    
    10
    -    url: alpine:integration-tests-base.v1.x86_64.tar.xz
    
    11 10
         base-dir: ''
    
    12
    -    ref: 3eb559250ba82b64a68d86d0636a6b127aa5f6d25d3601a79f79214dc9703639
    11
    +    (?):
    
    12
    +    - arch == "x86_64":
    
    13
    +        ref: 3eb559250ba82b64a68d86d0636a6b127aa5f6d25d3601a79f79214dc9703639
    
    14
    +        url: "alpine:integration-tests-base.v1.x86_64.tar.xz"
    
    15
    +    - arch == "aarch64":
    
    16
    +        ref: 431fb5362032ede6f172e70a3258354a8fd71fcbdeb1edebc0e20968c792329a
    
    17
    +        url: "alpine:integration-tests-base.v1.aarch64.tar.xz"

  • tests/integration/project/project.conf
    ... ... @@ -9,6 +9,12 @@ options:
    9 9
         type: bool
    
    10 10
         description: Whether to expect a linux platform
    
    11 11
         default: True
    
    12
    +  arch:
    
    13
    +    type: arch
    
    14
    +    description: Current architecture
    
    15
    +    values:
    
    16
    +      - x86_64
    
    17
    +      - aarch64
    
    12 18
     split-rules:
    
    13 19
       test:
    
    14 20
         - |
    

  • tests/testutils/site.py
    ... ... @@ -49,3 +49,5 @@ except ImportError:
    49 49
         HAVE_ARPY = False
    
    50 50
     
    
    51 51
     IS_LINUX = os.getenv('BST_FORCE_BACKEND', sys.platform).startswith('linux')
    
    52
    +
    
    53
    +_, _, _, _, MACHINE_ARCH = os.uname()



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]