[Notes] [Git][BuildStream/buildstream][jonathan/wsl-tests] 4 commits: Fix test_non_regular_file_patch not working under WSL



Title: GitLab

Jonathan Maw pushed to branch jonathan/wsl-tests at BuildStream / buildstream

Commits:

24 changed files:

Changes:

  • tests/format/project.py
    ... ... @@ -3,6 +3,7 @@ import pytest
    3 3
     from buildstream import _yaml
    
    4 4
     from buildstream._exceptions import ErrorDomain, LoadErrorReason
    
    5 5
     from tests.testutils import cli, filetypegenerator
    
    6
    +from contextlib import contextmanager
    
    6 7
     
    
    7 8
     
    
    8 9
     # Project directory
    
    ... ... @@ -12,6 +13,16 @@ DATA_DIR = os.path.join(
    12 13
     )
    
    13 14
     
    
    14 15
     
    
    16
    +# Some OSes are limited to path length of ~100 characters
    
    17
    +# when binding sockets
    
    18
    +@contextmanager
    
    19
    +def chdir(directory):
    
    20
    +    old_dir = os.getcwd()
    
    21
    +    os.chdir(directory)
    
    22
    +    yield
    
    23
    +    os.chdir(old_dir)
    
    24
    +
    
    25
    +
    
    15 26
     @pytest.mark.datafiles(os.path.join(DATA_DIR))
    
    16 27
     def test_missing_project_conf(cli, datafiles):
    
    17 28
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    ... ... @@ -108,14 +119,15 @@ def test_missing_element_path_directory(cli, datafiles):
    108 119
     @pytest.mark.datafiles(os.path.join(DATA_DIR, 'element-path'))
    
    109 120
     def test_element_path_not_a_directory(cli, datafiles):
    
    110 121
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    111
    -    path = os.path.join(project, 'elements')
    
    112
    -    for file_type in filetypegenerator.generate_file_types(path):
    
    113
    -        result = cli.run(project=project, args=['workspace', 'list'])
    
    114
    -        if not os.path.isdir(path):
    
    115
    -            result.assert_main_error(ErrorDomain.LOAD,
    
    116
    -                                     LoadErrorReason.PROJ_PATH_INVALID_KIND)
    
    117
    -        else:
    
    118
    -            result.assert_success()
    
    122
    +    path = 'elements'
    
    123
    +    with chdir(project):
    
    124
    +        for file_type in filetypegenerator.generate_file_types(path):
    
    125
    +            result = cli.run(project=project, args=['workspace', 'list'])
    
    126
    +            if not os.path.isdir(path):
    
    127
    +                result.assert_main_error(ErrorDomain.LOAD,
    
    128
    +                                         LoadErrorReason.PROJ_PATH_INVALID_KIND)
    
    129
    +            else:
    
    130
    +                result.assert_success()
    
    119 131
     
    
    120 132
     
    
    121 133
     @pytest.mark.datafiles(os.path.join(DATA_DIR, 'local-plugin'))
    
    ... ... @@ -129,14 +141,15 @@ def test_missing_local_plugin_directory(cli, datafiles):
    129 141
     @pytest.mark.datafiles(os.path.join(DATA_DIR, 'local-plugin'))
    
    130 142
     def test_local_plugin_not_directory(cli, datafiles):
    
    131 143
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    132
    -    path = os.path.join(project, 'plugins')
    
    133
    -    for file_type in filetypegenerator.generate_file_types(path):
    
    134
    -        result = cli.run(project=project, args=['workspace', 'list'])
    
    135
    -        if not os.path.isdir(path):
    
    136
    -            result.assert_main_error(ErrorDomain.LOAD,
    
    137
    -                                     LoadErrorReason.PROJ_PATH_INVALID_KIND)
    
    138
    -        else:
    
    139
    -            result.assert_success()
    
    144
    +    path = 'plugins'
    
    145
    +    with chdir(project):
    
    146
    +        for file_type in filetypegenerator.generate_file_types(path):
    
    147
    +            result = cli.run(project=project, args=['workspace', 'list'])
    
    148
    +            if not os.path.isdir(path):
    
    149
    +                result.assert_main_error(ErrorDomain.LOAD,
    
    150
    +                                         LoadErrorReason.PROJ_PATH_INVALID_KIND)
    
    151
    +            else:
    
    152
    +                result.assert_success()
    
    140 153
     
    
    141 154
     
    
    142 155
     @pytest.mark.datafiles(DATA_DIR)
    

  • tests/integration/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 HAVE_BWRAP, IS_LINUX
    
    6
    +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, IS_WINDOWS
    
    7 7
     
    
    8 8
     
    
    9 9
     pytestmark = pytest.mark.integration
    
    ... ... @@ -19,6 +19,7 @@ DATA_DIR = os.path.join(
    19 19
     # amhello project for this.
    
    20 20
     @pytest.mark.integration
    
    21 21
     @pytest.mark.datafiles(DATA_DIR)
    
    22
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    22 23
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    23 24
     def test_autotools_build(cli, tmpdir, datafiles):
    
    24 25
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    ... ... @@ -42,6 +43,7 @@ def test_autotools_build(cli, tmpdir, datafiles):
    42 43
     # amhello project for this.
    
    43 44
     @pytest.mark.integration
    
    44 45
     @pytest.mark.datafiles(DATA_DIR)
    
    46
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    45 47
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    46 48
     def test_autotools_confroot_build(cli, tmpdir, datafiles):
    
    47 49
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    ... ... @@ -63,6 +65,7 @@ def test_autotools_confroot_build(cli, tmpdir, datafiles):
    63 65
     
    
    64 66
     # Test running an executable built with autotools
    
    65 67
     @pytest.mark.datafiles(DATA_DIR)
    
    68
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    66 69
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    67 70
     def test_autotools_run(cli, tmpdir, datafiles):
    
    68 71
         project = os.path.join(datafiles.dirname, datafiles.basename)
    

  • tests/integration/build-tree.py
    ... ... @@ -3,7 +3,7 @@ import pytest
    3 3
     import shutil
    
    4 4
     
    
    5 5
     from tests.testutils import cli, cli_integration, create_artifact_share
    
    6
    -from tests.testutils.site import HAVE_BWRAP, IS_LINUX
    
    6
    +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, IS_WINDOWS
    
    7 7
     from buildstream._exceptions import ErrorDomain
    
    8 8
     
    
    9 9
     
    
    ... ... @@ -17,6 +17,7 @@ DATA_DIR = os.path.join(
    17 17
     
    
    18 18
     
    
    19 19
     @pytest.mark.datafiles(DATA_DIR)
    
    20
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    20 21
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    21 22
     def test_buildtree_staged(cli_integration, tmpdir, datafiles):
    
    22 23
         # We can only test the non interacitve case
    
    ... ... @@ -35,6 +36,7 @@ def test_buildtree_staged(cli_integration, tmpdir, datafiles):
    35 36
     
    
    36 37
     
    
    37 38
     @pytest.mark.datafiles(DATA_DIR)
    
    39
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    38 40
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    39 41
     def test_buildtree_staged_forced_true(cli_integration, tmpdir, datafiles):
    
    40 42
         # Test that if we ask for a build tree it is there.
    
    ... ... @@ -52,6 +54,7 @@ def test_buildtree_staged_forced_true(cli_integration, tmpdir, datafiles):
    52 54
     
    
    53 55
     
    
    54 56
     @pytest.mark.datafiles(DATA_DIR)
    
    57
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    55 58
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    56 59
     def test_buildtree_staged_if_available(cli_integration, tmpdir, datafiles):
    
    57 60
         # Test that a build tree can be correctly detected.
    
    ... ... @@ -69,6 +72,7 @@ def test_buildtree_staged_if_available(cli_integration, tmpdir, datafiles):
    69 72
     
    
    70 73
     
    
    71 74
     @pytest.mark.datafiles(DATA_DIR)
    
    75
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    72 76
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    73 77
     def test_buildtree_staged_forced_false(cli_integration, tmpdir, datafiles):
    
    74 78
         # Test that if we ask not to have a build tree it is not there
    
    ... ... @@ -87,6 +91,7 @@ def test_buildtree_staged_forced_false(cli_integration, tmpdir, datafiles):
    87 91
     
    
    88 92
     
    
    89 93
     @pytest.mark.datafiles(DATA_DIR)
    
    94
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    90 95
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    91 96
     def test_buildtree_from_failure(cli_integration, tmpdir, datafiles):
    
    92 97
         # Test that we can use a build tree after a failure
    
    ... ... @@ -108,6 +113,7 @@ def test_buildtree_from_failure(cli_integration, tmpdir, datafiles):
    108 113
     # Check that build shells work when pulled from a remote cache
    
    109 114
     # This is to roughly simulate remote execution
    
    110 115
     @pytest.mark.datafiles(DATA_DIR)
    
    116
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    111 117
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    112 118
     def test_buildtree_pulled(cli, tmpdir, datafiles):
    
    113 119
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    ... ... @@ -143,6 +149,7 @@ def test_buildtree_pulled(cli, tmpdir, datafiles):
    143 149
     
    
    144 150
     # This test checks for correct behaviour if a buildtree is not present.
    
    145 151
     @pytest.mark.datafiles(DATA_DIR)
    
    152
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    146 153
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    147 154
     def test_buildtree_options(cli, tmpdir, datafiles):
    
    148 155
         project = os.path.join(datafiles.dirname, datafiles.basename)
    

  • tests/integration/build-uid.py
    ... ... @@ -5,7 +5,7 @@ from buildstream import _yaml
    5 5
     
    
    6 6
     from tests.testutils import cli_integration as cli
    
    7 7
     from tests.testutils.integration import assert_contains
    
    8
    -from tests.testutils.site import HAVE_BWRAP, IS_LINUX
    
    8
    +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, IS_WINDOWS
    
    9 9
     
    
    10 10
     
    
    11 11
     pytestmark = pytest.mark.integration
    
    ... ... @@ -56,6 +56,7 @@ def test_build_uid_in_project(cli, tmpdir, datafiles):
    56 56
     
    
    57 57
     @pytest.mark.datafiles(DATA_DIR)
    
    58 58
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    59
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    59 60
     def test_build_uid_default(cli, tmpdir, datafiles):
    
    60 61
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    61 62
         checkout = os.path.join(cli.directory, 'checkout')
    

  • tests/integration/cachedfail.py
    ... ... @@ -7,7 +7,7 @@ from buildstream._exceptions import ErrorDomain
    7 7
     from conftest import clean_platform_cache
    
    8 8
     
    
    9 9
     from tests.testutils import cli_integration as cli, create_artifact_share
    
    10
    -from tests.testutils.site import HAVE_BWRAP, IS_LINUX
    
    10
    +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, IS_WINDOWS
    
    11 11
     
    
    12 12
     
    
    13 13
     pytestmark = pytest.mark.integration
    
    ... ... @@ -21,6 +21,7 @@ DATA_DIR = os.path.join(
    21 21
     
    
    22 22
     @pytest.mark.datafiles(DATA_DIR)
    
    23 23
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    24
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    24 25
     def test_build_checkout_cached_fail(cli, tmpdir, datafiles):
    
    25 26
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    26 27
         element_path = os.path.join(project, 'elements', 'element.bst')
    
    ... ... @@ -65,6 +66,7 @@ def test_build_checkout_cached_fail(cli, tmpdir, datafiles):
    65 66
     
    
    66 67
     @pytest.mark.datafiles(DATA_DIR)
    
    67 68
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    69
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    68 70
     def test_build_depend_on_cached_fail(cli, tmpdir, datafiles):
    
    69 71
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    70 72
         dep_path = os.path.join(project, 'elements', 'dep.bst')
    
    ... ... @@ -124,6 +126,7 @@ def test_build_depend_on_cached_fail(cli, tmpdir, datafiles):
    124 126
     
    
    125 127
     
    
    126 128
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    129
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    127 130
     @pytest.mark.datafiles(DATA_DIR)
    
    128 131
     @pytest.mark.parametrize("on_error", ("continue", "quit"))
    
    129 132
     def test_push_cached_fail(cli, tmpdir, datafiles, on_error):
    

  • tests/integration/cmake.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 HAVE_BWRAP, IS_LINUX
    
    6
    +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, IS_WINDOWS
    
    7 7
     
    
    8 8
     
    
    9 9
     pytestmark = pytest.mark.integration
    
    ... ... @@ -17,6 +17,7 @@ DATA_DIR = os.path.join(
    17 17
     
    
    18 18
     @pytest.mark.datafiles(DATA_DIR)
    
    19 19
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    20
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    20 21
     def test_cmake_build(cli, tmpdir, datafiles):
    
    21 22
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    22 23
         checkout = os.path.join(cli.directory, 'checkout')
    
    ... ... @@ -33,6 +34,7 @@ def test_cmake_build(cli, tmpdir, datafiles):
    33 34
     
    
    34 35
     @pytest.mark.datafiles(DATA_DIR)
    
    35 36
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    37
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    36 38
     def test_cmake_confroot_build(cli, tmpdir, datafiles):
    
    37 39
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    38 40
         checkout = os.path.join(cli.directory, 'checkout')
    
    ... ... @@ -49,6 +51,7 @@ def test_cmake_confroot_build(cli, tmpdir, datafiles):
    49 51
     
    
    50 52
     @pytest.mark.datafiles(DATA_DIR)
    
    51 53
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    54
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    52 55
     def test_cmake_run(cli, tmpdir, datafiles):
    
    53 56
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    54 57
         element_name = 'cmake/cmakehello.bst'
    

  • tests/integration/compose.py
    ... ... @@ -7,7 +7,7 @@ from buildstream import _yaml
    7 7
     
    
    8 8
     from tests.testutils import cli_integration as cli
    
    9 9
     from tests.testutils.integration import walk_dir
    
    10
    -from tests.testutils.site import HAVE_BWRAP, IS_LINUX
    
    10
    +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, IS_WINDOWS
    
    11 11
     
    
    12 12
     
    
    13 13
     pytestmark = pytest.mark.integration
    
    ... ... @@ -76,6 +76,7 @@ def create_compose_element(name, path, config={}):
    76 76
                         '/usr/share/doc/amhello/README'])
    
    77 77
     ])
    
    78 78
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    79
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    79 80
     def test_compose_include(cli, tmpdir, datafiles, include_domains,
    
    80 81
                              exclude_domains, expected):
    
    81 82
         project = os.path.join(datafiles.dirname, datafiles.basename)
    

  • tests/integration/make.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 HAVE_BWRAP, IS_LINUX
    
    6
    +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, IS_WINDOWS
    
    7 7
     
    
    8 8
     
    
    9 9
     pytestmark = pytest.mark.integration
    
    ... ... @@ -20,6 +20,7 @@ DATA_DIR = os.path.join(
    20 20
     @pytest.mark.integration
    
    21 21
     @pytest.mark.datafiles(DATA_DIR)
    
    22 22
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    23
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    23 24
     def test_make_build(cli, tmpdir, datafiles):
    
    24 25
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    25 26
         checkout = os.path.join(cli.directory, 'checkout')
    
    ... ... @@ -38,6 +39,7 @@ def test_make_build(cli, tmpdir, datafiles):
    38 39
     # Test running an executable built with make
    
    39 40
     @pytest.mark.datafiles(DATA_DIR)
    
    40 41
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    42
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    41 43
     def test_make_run(cli, tmpdir, datafiles):
    
    42 44
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    43 45
         element_name = 'make/makehello.bst'
    

  • tests/integration/manual.py
    ... ... @@ -4,7 +4,7 @@ import pytest
    4 4
     from buildstream import _yaml
    
    5 5
     
    
    6 6
     from tests.testutils import cli_integration as cli
    
    7
    -from tests.testutils.site import HAVE_BWRAP, IS_LINUX
    
    7
    +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, IS_WINDOWS
    
    8 8
     
    
    9 9
     
    
    10 10
     pytestmark = pytest.mark.integration
    
    ... ... @@ -33,6 +33,7 @@ def create_manual_element(name, path, config, variables, environment):
    33 33
     
    
    34 34
     @pytest.mark.datafiles(DATA_DIR)
    
    35 35
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    36
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    36 37
     def test_manual_element(cli, tmpdir, datafiles):
    
    37 38
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    38 39
         checkout = os.path.join(cli.directory, 'checkout')
    
    ... ... @@ -67,6 +68,7 @@ strip
    67 68
     
    
    68 69
     @pytest.mark.datafiles(DATA_DIR)
    
    69 70
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    71
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    70 72
     def test_manual_element_environment(cli, tmpdir, datafiles):
    
    71 73
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    72 74
         checkout = os.path.join(cli.directory, 'checkout')
    
    ... ... @@ -97,6 +99,7 @@ def test_manual_element_environment(cli, tmpdir, datafiles):
    97 99
     
    
    98 100
     @pytest.mark.datafiles(DATA_DIR)
    
    99 101
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    102
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    100 103
     def test_manual_element_noparallel(cli, tmpdir, datafiles):
    
    101 104
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    102 105
         checkout = os.path.join(cli.directory, 'checkout')
    
    ... ... @@ -132,6 +135,7 @@ def test_manual_element_noparallel(cli, tmpdir, datafiles):
    132 135
     
    
    133 136
     @pytest.mark.datafiles(DATA_DIR)
    
    134 137
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    138
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    135 139
     def test_manual_element_logging(cli, tmpdir, datafiles):
    
    136 140
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    137 141
         checkout = os.path.join(cli.directory, 'checkout')
    

  • tests/integration/messages.py
    ... ... @@ -24,7 +24,7 @@ from buildstream import _yaml
    24 24
     from buildstream._exceptions import ErrorDomain
    
    25 25
     
    
    26 26
     from tests.testutils import cli_integration as cli
    
    27
    -from tests.testutils.site import HAVE_BWRAP, IS_LINUX
    
    27
    +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, IS_WINDOWS
    
    28 28
     
    
    29 29
     
    
    30 30
     pytestmark = pytest.mark.integration
    
    ... ... @@ -40,6 +40,7 @@ DATA_DIR = os.path.join(
    40 40
     @pytest.mark.integration
    
    41 41
     @pytest.mark.datafiles(DATA_DIR)
    
    42 42
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    43
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    43 44
     def test_disable_message_lines(cli, tmpdir, datafiles):
    
    44 45
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    45 46
         element_path = os.path.join(project, 'elements')
    
    ... ... @@ -76,6 +77,7 @@ def test_disable_message_lines(cli, tmpdir, datafiles):
    76 77
     @pytest.mark.integration
    
    77 78
     @pytest.mark.datafiles(DATA_DIR)
    
    78 79
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    80
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    79 81
     def test_disable_error_lines(cli, tmpdir, datafiles):
    
    80 82
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    81 83
         element_path = os.path.join(project, 'elements')
    

  • tests/integration/pip_element.py
    ... ... @@ -6,7 +6,7 @@ from buildstream import _yaml
    6 6
     
    
    7 7
     from tests.testutils import cli_integration as cli
    
    8 8
     from tests.testutils.integration import assert_contains
    
    9
    -from tests.testutils.site import HAVE_BWRAP, IS_LINUX
    
    9
    +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, IS_WINDOWS
    
    10 10
     
    
    11 11
     
    
    12 12
     pytestmark = pytest.mark.integration
    
    ... ... @@ -20,6 +20,7 @@ DATA_DIR = os.path.join(
    20 20
     
    
    21 21
     @pytest.mark.datafiles(DATA_DIR)
    
    22 22
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    23
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    23 24
     def test_pip_build(cli, tmpdir, datafiles):
    
    24 25
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    25 26
         checkout = os.path.join(cli.directory, 'checkout')
    
    ... ... @@ -57,6 +58,7 @@ def test_pip_build(cli, tmpdir, datafiles):
    57 58
     # Test running an executable built with pip
    
    58 59
     @pytest.mark.datafiles(DATA_DIR)
    
    59 60
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    61
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    60 62
     def test_pip_run(cli, tmpdir, datafiles):
    
    61 63
         # Create and build our test element
    
    62 64
         test_pip_build(cli, tmpdir, datafiles)
    

  • tests/integration/pip_source.py
    ... ... @@ -6,7 +6,7 @@ from buildstream import _yaml
    6 6
     from tests.testutils import cli_integration as cli
    
    7 7
     from tests.testutils.python_repo import setup_pypi_repo
    
    8 8
     from tests.testutils.integration import assert_contains
    
    9
    -from tests.testutils.site import HAVE_BWRAP, IS_LINUX
    
    9
    +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, IS_WINDOWS
    
    10 10
     
    
    11 11
     
    
    12 12
     pytestmark = pytest.mark.integration
    
    ... ... @@ -74,6 +74,7 @@ def test_pip_source_import(cli, tmpdir, datafiles, setup_pypi_repo):
    74 74
     
    
    75 75
     @pytest.mark.datafiles(DATA_DIR)
    
    76 76
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    77
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    77 78
     def test_pip_source_build(cli, tmpdir, datafiles, setup_pypi_repo):
    
    78 79
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    79 80
         element_path = os.path.join(project, 'elements')
    

  • tests/integration/pullbuildtrees.py
    ... ... @@ -4,7 +4,7 @@ import pytest
    4 4
     
    
    5 5
     from tests.testutils import cli, cli_integration as cli2, create_artifact_share
    
    6 6
     from tests.testutils.integration import assert_contains
    
    7
    -from tests.testutils.site import HAVE_BWRAP, IS_LINUX
    
    7
    +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, IS_WINDOWS
    
    8 8
     from buildstream._exceptions import ErrorDomain, LoadErrorReason
    
    9 9
     
    
    10 10
     
    
    ... ... @@ -32,6 +32,7 @@ def default_state(cli, tmpdir, share):
    32 32
     @pytest.mark.integration
    
    33 33
     @pytest.mark.datafiles(DATA_DIR)
    
    34 34
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    35
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    35 36
     def test_pullbuildtrees(cli2, tmpdir, datafiles):
    
    36 37
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    37 38
         element_name = 'autotools/amhello.bst'
    

  • tests/integration/script.py
    ... ... @@ -4,7 +4,7 @@ import pytest
    4 4
     from buildstream import _yaml
    
    5 5
     
    
    6 6
     from tests.testutils import cli_integration as cli
    
    7
    -from tests.testutils.site import HAVE_BWRAP, IS_LINUX
    
    7
    +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, IS_WINDOWS
    
    8 8
     
    
    9 9
     
    
    10 10
     pytestmark = pytest.mark.integration
    
    ... ... @@ -32,6 +32,7 @@ def create_script_element(name, path, config={}, variables={}):
    32 32
     
    
    33 33
     @pytest.mark.datafiles(DATA_DIR)
    
    34 34
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    35
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    35 36
     def test_script(cli, tmpdir, datafiles):
    
    36 37
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    37 38
         checkout = os.path.join(cli.directory, 'checkout')
    
    ... ... @@ -60,6 +61,7 @@ def test_script(cli, tmpdir, datafiles):
    60 61
     
    
    61 62
     @pytest.mark.datafiles(DATA_DIR)
    
    62 63
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    64
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    63 65
     def test_script_root(cli, tmpdir, datafiles):
    
    64 66
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    65 67
         checkout = os.path.join(cli.directory, 'checkout')
    
    ... ... @@ -92,6 +94,7 @@ def test_script_root(cli, tmpdir, datafiles):
    92 94
     
    
    93 95
     @pytest.mark.datafiles(DATA_DIR)
    
    94 96
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    97
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    95 98
     def test_script_no_root(cli, tmpdir, datafiles):
    
    96 99
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    97 100
         element_path = os.path.join(project, 'elements')
    
    ... ... @@ -115,6 +118,7 @@ def test_script_no_root(cli, tmpdir, datafiles):
    115 118
     
    
    116 119
     @pytest.mark.datafiles(DATA_DIR)
    
    117 120
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    121
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    118 122
     def test_script_cwd(cli, tmpdir, datafiles):
    
    119 123
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    120 124
         checkout = os.path.join(cli.directory, 'checkout')
    
    ... ... @@ -146,6 +150,7 @@ def test_script_cwd(cli, tmpdir, datafiles):
    146 150
     
    
    147 151
     @pytest.mark.datafiles(DATA_DIR)
    
    148 152
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    153
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    149 154
     def test_script_layout(cli, tmpdir, datafiles):
    
    150 155
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    151 156
         checkout = os.path.join(cli.directory, 'checkout')
    
    ... ... @@ -165,6 +170,7 @@ def test_script_layout(cli, tmpdir, datafiles):
    165 170
     
    
    166 171
     @pytest.mark.datafiles(DATA_DIR)
    
    167 172
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    173
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    168 174
     def test_regression_cache_corruption(cli, tmpdir, datafiles):
    
    169 175
         project = str(datafiles)
    
    170 176
         checkout_original = os.path.join(cli.directory, 'checkout-original')
    
    ... ... @@ -195,6 +201,7 @@ def test_regression_cache_corruption(cli, tmpdir, datafiles):
    195 201
     
    
    196 202
     @pytest.mark.datafiles(DATA_DIR)
    
    197 203
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    204
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    198 205
     def test_regression_tmpdir(cli, tmpdir, datafiles):
    
    199 206
         project = str(datafiles)
    
    200 207
         element_name = 'script/tmpdir.bst'
    
    ... ... @@ -205,6 +212,7 @@ def test_regression_tmpdir(cli, tmpdir, datafiles):
    205 212
     
    
    206 213
     @pytest.mark.datafiles(DATA_DIR)
    
    207 214
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    215
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    208 216
     def test_regression_cache_corruption_2(cli, tmpdir, datafiles):
    
    209 217
         project = str(datafiles)
    
    210 218
         checkout_original = os.path.join(cli.directory, 'checkout-original')
    

  • tests/integration/shell.py
    ... ... @@ -5,7 +5,7 @@ from buildstream import _yaml
    5 5
     from buildstream._exceptions import ErrorDomain
    
    6 6
     
    
    7 7
     from tests.testutils import cli_integration as cli
    
    8
    -from tests.testutils.site import HAVE_BWRAP, IS_LINUX
    
    8
    +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, IS_WINDOWS
    
    9 9
     
    
    10 10
     
    
    11 11
     pytestmark = pytest.mark.integration
    
    ... ... @@ -50,6 +50,7 @@ def execute_shell(cli, project, command, *, config=None, mount=None, element='ba
    50 50
     # executable
    
    51 51
     @pytest.mark.datafiles(DATA_DIR)
    
    52 52
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    53
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    53 54
     def test_shell(cli, tmpdir, datafiles):
    
    54 55
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    55 56
     
    
    ... ... @@ -61,6 +62,7 @@ def test_shell(cli, tmpdir, datafiles):
    61 62
     # Test running an executable directly
    
    62 63
     @pytest.mark.datafiles(DATA_DIR)
    
    63 64
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    65
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    64 66
     def test_executable(cli, tmpdir, datafiles):
    
    65 67
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    66 68
     
    
    ... ... @@ -73,6 +75,7 @@ def test_executable(cli, tmpdir, datafiles):
    73 75
     @pytest.mark.parametrize("animal", [("Horse"), ("Pony")])
    
    74 76
     @pytest.mark.datafiles(DATA_DIR)
    
    75 77
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    78
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    76 79
     def test_env_assign(cli, tmpdir, datafiles, animal):
    
    77 80
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    78 81
         expected = animal + '\n'
    
    ... ... @@ -93,6 +96,7 @@ def test_env_assign(cli, tmpdir, datafiles, animal):
    93 96
     @pytest.mark.parametrize("animal", [("Horse"), ("Pony")])
    
    94 97
     @pytest.mark.datafiles(DATA_DIR)
    
    95 98
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    99
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    96 100
     def test_env_assign_expand_host_environ(cli, tmpdir, datafiles, animal):
    
    97 101
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    98 102
         expected = 'The animal is: {}\n'.format(animal)
    
    ... ... @@ -116,6 +120,7 @@ def test_env_assign_expand_host_environ(cli, tmpdir, datafiles, animal):
    116 120
     @pytest.mark.parametrize("animal", [("Horse"), ("Pony")])
    
    117 121
     @pytest.mark.datafiles(DATA_DIR)
    
    118 122
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    123
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    119 124
     def test_env_assign_isolated(cli, tmpdir, datafiles, animal):
    
    120 125
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    121 126
         result = execute_shell(cli, project, ['/bin/sh', '-c', 'echo ${ANIMAL}'], isolate=True, config={
    
    ... ... @@ -134,6 +139,7 @@ def test_env_assign_isolated(cli, tmpdir, datafiles, animal):
    134 139
     # /bin/sh)
    
    135 140
     @pytest.mark.datafiles(DATA_DIR)
    
    136 141
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    142
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    137 143
     def test_no_shell(cli, tmpdir, datafiles):
    
    138 144
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    139 145
         element_path = os.path.join(project, 'elements')
    
    ... ... @@ -167,6 +173,7 @@ def test_no_shell(cli, tmpdir, datafiles):
    167 173
     @pytest.mark.parametrize("path", [("/etc/pony.conf"), ("/usr/share/pony/pony.txt")])
    
    168 174
     @pytest.mark.datafiles(DATA_DIR)
    
    169 175
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    176
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    170 177
     def test_host_files(cli, tmpdir, datafiles, path):
    
    171 178
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    172 179
         ponyfile = os.path.join(project, 'files', 'shell-mount', 'pony.txt')
    
    ... ... @@ -188,6 +195,7 @@ def test_host_files(cli, tmpdir, datafiles, path):
    188 195
     @pytest.mark.parametrize("path", [("/etc"), ("/usr/share/pony")])
    
    189 196
     @pytest.mark.datafiles(DATA_DIR)
    
    190 197
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    198
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    191 199
     def test_host_files_expand_environ(cli, tmpdir, datafiles, path):
    
    192 200
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    193 201
         hostpath = os.path.join(project, 'files', 'shell-mount')
    
    ... ... @@ -234,6 +242,7 @@ def test_isolated_no_mount(cli, tmpdir, datafiles, path):
    234 242
     @pytest.mark.parametrize("optional", [("mandatory"), ("optional")])
    
    235 243
     @pytest.mark.datafiles(DATA_DIR)
    
    236 244
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    245
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    237 246
     def test_host_files_missing(cli, tmpdir, datafiles, optional):
    
    238 247
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    239 248
         ponyfile = os.path.join(project, 'files', 'shell-mount', 'horsy.txt')
    
    ... ... @@ -270,6 +279,7 @@ def test_host_files_missing(cli, tmpdir, datafiles, optional):
    270 279
     @pytest.mark.parametrize("path", [("/etc/pony.conf"), ("/usr/share/pony/pony.txt")])
    
    271 280
     @pytest.mark.datafiles(DATA_DIR)
    
    272 281
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    282
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    273 283
     def test_cli_mount(cli, tmpdir, datafiles, path):
    
    274 284
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    275 285
         ponyfile = os.path.join(project, 'files', 'shell-mount', 'pony.txt')
    
    ... ... @@ -283,6 +293,7 @@ def test_cli_mount(cli, tmpdir, datafiles, path):
    283 293
     @pytest.mark.integration
    
    284 294
     @pytest.mark.datafiles(DATA_DIR)
    
    285 295
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    296
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    286 297
     def test_workspace_visible(cli, tmpdir, datafiles):
    
    287 298
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    288 299
         workspace = os.path.join(cli.directory, 'workspace')
    
    ... ... @@ -317,6 +328,7 @@ def test_workspace_visible(cli, tmpdir, datafiles):
    317 328
     # Test that '--sysroot' works
    
    318 329
     @pytest.mark.datafiles(DATA_DIR)
    
    319 330
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    331
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    320 332
     def test_sysroot(cli, tmpdir, datafiles):
    
    321 333
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    322 334
         base_element = "base/base-alpine.bst"
    
    ... ... @@ -347,6 +359,7 @@ def test_sysroot(cli, tmpdir, datafiles):
    347 359
     # Test system integration commands can access devices in /dev
    
    348 360
     @pytest.mark.datafiles(DATA_DIR)
    
    349 361
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    362
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    350 363
     def test_integration_devices(cli, tmpdir, datafiles):
    
    351 364
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    352 365
         element_name = 'integration.bst'
    
    ... ... @@ -360,6 +373,7 @@ def test_integration_devices(cli, tmpdir, datafiles):
    360 373
     @pytest.mark.parametrize("build_shell", [("build"), ("nobuild")])
    
    361 374
     @pytest.mark.parametrize("guess_element", [True, False], ids=["guess", "no-guess"])
    
    362 375
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    376
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    363 377
     def test_integration_external_workspace(cli, tmpdir_factory, datafiles, build_shell, guess_element):
    
    364 378
         tmpdir = tmpdir_factory.mktemp("")
    
    365 379
         project = os.path.join(datafiles.dirname, datafiles.basename)
    

  • tests/integration/sockets.py
    ... ... @@ -5,7 +5,7 @@ from buildstream import _yaml
    5 5
     
    
    6 6
     from tests.testutils import cli_integration as cli
    
    7 7
     from tests.testutils.integration import assert_contains
    
    8
    -from tests.testutils.site import HAVE_BWRAP, IS_LINUX
    
    8
    +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, IS_WINDOWS
    
    9 9
     
    
    10 10
     
    
    11 11
     pytestmark = pytest.mark.integration
    
    ... ... @@ -18,6 +18,7 @@ DATA_DIR = os.path.join(
    18 18
     
    
    19 19
     @pytest.mark.datafiles(DATA_DIR)
    
    20 20
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    21
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    21 22
     def test_builddir_socket_ignored(cli, tmpdir, datafiles):
    
    22 23
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    23 24
         element_name = 'sockets/make-builddir-socket.bst'
    
    ... ... @@ -28,6 +29,7 @@ def test_builddir_socket_ignored(cli, tmpdir, datafiles):
    28 29
     
    
    29 30
     @pytest.mark.datafiles(DATA_DIR)
    
    30 31
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    32
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    31 33
     def test_install_root_socket_ignored(cli, tmpdir, datafiles):
    
    32 34
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    33 35
         element_name = 'sockets/make-install-root-socket.bst'
    

  • tests/integration/source-determinism.py
    ... ... @@ -4,7 +4,7 @@ import pytest
    4 4
     from buildstream import _yaml, utils
    
    5 5
     from tests.testutils import create_repo, ALL_REPO_KINDS
    
    6 6
     from tests.testutils import cli_integration as cli
    
    7
    -from tests.testutils.site import HAVE_BWRAP, IS_LINUX
    
    7
    +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, IS_WINDOWS
    
    8 8
     
    
    9 9
     
    
    10 10
     DATA_DIR = os.path.join(
    
    ... ... @@ -31,6 +31,7 @@ def create_test_directory(*path, mode=0o644):
    31 31
     @pytest.mark.datafiles(DATA_DIR)
    
    32 32
     @pytest.mark.parametrize("kind", [(kind) for kind in ALL_REPO_KINDS] + ['local'])
    
    33 33
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    34
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    34 35
     def test_deterministic_source_umask(cli, tmpdir, datafiles, kind, integration_cache):
    
    35 36
         project = str(datafiles)
    
    36 37
         element_name = 'list.bst'
    
    ... ... @@ -104,6 +105,7 @@ def test_deterministic_source_umask(cli, tmpdir, datafiles, kind, integration_ca
    104 105
     @pytest.mark.integration
    
    105 106
     @pytest.mark.datafiles(DATA_DIR)
    
    106 107
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    108
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    107 109
     def test_deterministic_source_local(cli, tmpdir, datafiles, integration_cache):
    
    108 110
         """Only user rights should be considered for local source.
    
    109 111
         """
    

  • tests/integration/stack.py
    ... ... @@ -4,7 +4,7 @@ import pytest
    4 4
     from buildstream import _yaml
    
    5 5
     
    
    6 6
     from tests.testutils import cli_integration as cli
    
    7
    -from tests.testutils.site import HAVE_BWRAP, IS_LINUX
    
    7
    +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, IS_WINDOWS
    
    8 8
     
    
    9 9
     
    
    10 10
     pytestmark = pytest.mark.integration
    
    ... ... @@ -18,6 +18,7 @@ DATA_DIR = os.path.join(
    18 18
     
    
    19 19
     @pytest.mark.datafiles(DATA_DIR)
    
    20 20
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    21
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    21 22
     def test_stack(cli, tmpdir, datafiles):
    
    22 23
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    23 24
         checkout = os.path.join(cli.directory, 'checkout')
    

  • tests/integration/symlinks.py
    ... ... @@ -6,7 +6,7 @@ from buildstream import _yaml
    6 6
     
    
    7 7
     from tests.testutils import cli_integration as cli
    
    8 8
     from tests.testutils.integration import assert_contains
    
    9
    -from tests.testutils.site import HAVE_BWRAP, IS_LINUX
    
    9
    +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, IS_WINDOWS
    
    10 10
     
    
    11 11
     
    
    12 12
     pytestmark = pytest.mark.integration
    
    ... ... @@ -20,6 +20,7 @@ DATA_DIR = os.path.join(
    20 20
     
    
    21 21
     @pytest.mark.datafiles(DATA_DIR)
    
    22 22
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    23
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    23 24
     def test_absolute_symlinks_made_relative(cli, tmpdir, datafiles):
    
    24 25
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    25 26
         checkout = os.path.join(cli.directory, 'checkout')
    
    ... ... @@ -44,6 +45,7 @@ def test_absolute_symlinks_made_relative(cli, tmpdir, datafiles):
    44 45
     
    
    45 46
     @pytest.mark.datafiles(DATA_DIR)
    
    46 47
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    48
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    47 49
     def test_allow_overlaps_inside_symlink_with_dangling_target(cli, tmpdir, datafiles):
    
    48 50
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    49 51
         checkout = os.path.join(cli.directory, 'checkout')
    
    ... ... @@ -61,6 +63,7 @@ def test_allow_overlaps_inside_symlink_with_dangling_target(cli, tmpdir, datafil
    61 63
     
    
    62 64
     @pytest.mark.datafiles(DATA_DIR)
    
    63 65
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    66
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    64 67
     def test_detect_symlink_overlaps_pointing_outside_sandbox(cli, tmpdir, datafiles):
    
    65 68
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    66 69
         checkout = os.path.join(cli.directory, 'checkout')
    

  • tests/integration/workspace.py
    ... ... @@ -3,7 +3,7 @@ import pytest
    3 3
     
    
    4 4
     from buildstream import _yaml
    
    5 5
     from tests.testutils import cli_integration as cli
    
    6
    -from tests.testutils.site import HAVE_BWRAP, IS_LINUX
    
    6
    +from tests.testutils.site import HAVE_BWRAP, IS_LINUX, IS_WINDOWS
    
    7 7
     from tests.testutils.integration import walk_dir
    
    8 8
     
    
    9 9
     
    
    ... ... @@ -19,6 +19,7 @@ DATA_DIR = os.path.join(
    19 19
     @pytest.mark.integration
    
    20 20
     @pytest.mark.datafiles(DATA_DIR)
    
    21 21
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    22
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    22 23
     def test_workspace_mount(cli, tmpdir, datafiles):
    
    23 24
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    24 25
         workspace = os.path.join(cli.directory, 'workspace')
    
    ... ... @@ -36,6 +37,7 @@ def test_workspace_mount(cli, tmpdir, datafiles):
    36 37
     @pytest.mark.integration
    
    37 38
     @pytest.mark.datafiles(DATA_DIR)
    
    38 39
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    40
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    39 41
     def test_workspace_commanddir(cli, tmpdir, datafiles):
    
    40 42
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    41 43
         workspace = os.path.join(cli.directory, 'workspace')
    
    ... ... @@ -54,6 +56,7 @@ def test_workspace_commanddir(cli, tmpdir, datafiles):
    54 56
     @pytest.mark.integration
    
    55 57
     @pytest.mark.datafiles(DATA_DIR)
    
    56 58
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    59
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    57 60
     def test_workspace_updated_dependency(cli, tmpdir, datafiles):
    
    58 61
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    59 62
         workspace = os.path.join(cli.directory, 'workspace')
    
    ... ... @@ -109,6 +112,7 @@ def test_workspace_updated_dependency(cli, tmpdir, datafiles):
    109 112
     @pytest.mark.integration
    
    110 113
     @pytest.mark.datafiles(DATA_DIR)
    
    111 114
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    115
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    112 116
     def test_workspace_update_dependency_failed(cli, tmpdir, datafiles):
    
    113 117
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    114 118
         workspace = os.path.join(cli.directory, 'workspace')
    
    ... ... @@ -185,6 +189,7 @@ def test_workspace_update_dependency_failed(cli, tmpdir, datafiles):
    185 189
     @pytest.mark.integration
    
    186 190
     @pytest.mark.datafiles(DATA_DIR)
    
    187 191
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    192
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    188 193
     def test_updated_dependency_nested(cli, tmpdir, datafiles):
    
    189 194
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    190 195
         workspace = os.path.join(cli.directory, 'workspace')
    
    ... ... @@ -239,6 +244,7 @@ def test_updated_dependency_nested(cli, tmpdir, datafiles):
    239 244
     @pytest.mark.integration
    
    240 245
     @pytest.mark.datafiles(DATA_DIR)
    
    241 246
     @pytest.mark.skipif(IS_LINUX and not HAVE_BWRAP, reason='Only available with bubblewrap on Linux')
    
    247
    +@pytest.mark.skipif(IS_WINDOWS, reason='Not available on Windows')
    
    242 248
     def test_incremental_configure_commands_run_only_once(cli, tmpdir, datafiles):
    
    243 249
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    244 250
         workspace = os.path.join(cli.directory, 'workspace')
    

  • tests/sandboxes/missing-command.py
    ... ... @@ -4,6 +4,7 @@ import pytest
    4 4
     from buildstream._exceptions import ErrorDomain
    
    5 5
     
    
    6 6
     from tests.testutils import cli
    
    7
    +from tests.testutils.site import IS_WINDOWS
    
    7 8
     
    
    8 9
     
    
    9 10
     DATA_DIR = os.path.join(
    
    ... ... @@ -12,6 +13,7 @@ DATA_DIR = os.path.join(
    12 13
     )
    
    13 14
     
    
    14 15
     
    
    16
    +@pytest.mark.skipif(IS_WINDOWS, reason="Sandboxes are not available on Windows")
    
    15 17
     @pytest.mark.datafiles(DATA_DIR)
    
    16 18
     def test_missing_command(cli, tmpdir, datafiles):
    
    17 19
         project = os.path.join(datafiles.dirname, datafiles.basename)
    

  • tests/sources/local.py
    ... ... @@ -3,6 +3,7 @@ import pytest
    3 3
     
    
    4 4
     from buildstream._exceptions import ErrorDomain, LoadErrorReason
    
    5 5
     from tests.testutils import cli, filetypegenerator
    
    6
    +from contextlib import contextmanager
    
    6 7
     
    
    7 8
     DATA_DIR = os.path.join(
    
    8 9
         os.path.dirname(os.path.realpath(__file__)),
    
    ... ... @@ -27,19 +28,29 @@ def test_missing_path(cli, tmpdir, datafiles):
    27 28
     @pytest.mark.datafiles(os.path.join(DATA_DIR, 'basic'))
    
    28 29
     def test_non_regular_file_or_directory(cli, tmpdir, datafiles):
    
    29 30
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    30
    -    localfile = os.path.join(project, 'file.txt')
    
    31
    -
    
    32
    -    for file_type in filetypegenerator.generate_file_types(localfile):
    
    33
    -        result = cli.run(project=project, args=[
    
    34
    -            'show', 'target.bst'
    
    35
    -        ])
    
    36
    -        if os.path.isdir(localfile) and not os.path.islink(localfile):
    
    37
    -            result.assert_success()
    
    38
    -        elif os.path.isfile(localfile) and not os.path.islink(localfile):
    
    39
    -            result.assert_success()
    
    40
    -        else:
    
    41
    -            result.assert_main_error(ErrorDomain.LOAD,
    
    42
    -                                     LoadErrorReason.PROJ_PATH_INVALID_KIND)
    
    31
    +    localfile = 'file.txt'
    
    32
    +
    
    33
    +    # Some OSes are limited to path length of ~100 characters
    
    34
    +    # when binding sockets
    
    35
    +    @contextmanager
    
    36
    +    def chdir(directory):
    
    37
    +        old_dir = os.getcwd()
    
    38
    +        os.chdir(directory)
    
    39
    +        yield
    
    40
    +        os.chdir(old_dir)
    
    41
    +
    
    42
    +    with chdir(project)
    
    43
    +        for file_type in filetypegenerator.generate_file_types(localfile):
    
    44
    +            result = cli.run(project=project, args=[
    
    45
    +                'show', 'target.bst'
    
    46
    +            ])
    
    47
    +            if os.path.isdir(localfile) and not os.path.islink(localfile):
    
    48
    +                result.assert_success()
    
    49
    +            elif os.path.isfile(localfile) and not os.path.islink(localfile):
    
    50
    +                result.assert_success()
    
    51
    +            else:
    
    52
    +                result.assert_main_error(ErrorDomain.LOAD,
    
    53
    +                                         LoadErrorReason.PROJ_PATH_INVALID_KIND)
    
    43 54
     
    
    44 55
     
    
    45 56
     @pytest.mark.datafiles(os.path.join(DATA_DIR, 'basic'))
    

  • tests/sources/patch.py
    ... ... @@ -3,6 +3,7 @@ import pytest
    3 3
     
    
    4 4
     from buildstream._exceptions import ErrorDomain, LoadErrorReason
    
    5 5
     from tests.testutils import cli, filetypegenerator
    
    6
    +from contextlib import contextmanager
    
    6 7
     
    
    7 8
     DATA_DIR = os.path.join(
    
    8 9
         os.path.dirname(os.path.realpath(__file__)),
    
    ... ... @@ -28,16 +29,26 @@ def test_missing_patch(cli, tmpdir, datafiles):
    28 29
     def test_non_regular_file_patch(cli, tmpdir, datafiles):
    
    29 30
         project = os.path.join(datafiles.dirname, datafiles.basename)
    
    30 31
     
    
    31
    -    patch_path = os.path.join(project, 'irregular_file.patch')
    
    32
    -    for file_type in filetypegenerator.generate_file_types(patch_path):
    
    33
    -        result = cli.run(project=project, args=[
    
    34
    -            'show', 'irregular.bst'
    
    35
    -        ])
    
    36
    -        if os.path.isfile(patch_path) and not os.path.islink(patch_path):
    
    37
    -            result.assert_success()
    
    38
    -        else:
    
    39
    -            result.assert_main_error(ErrorDomain.LOAD,
    
    40
    -                                     LoadErrorReason.PROJ_PATH_INVALID_KIND)
    
    32
    +    # Some OSes are limited to path length of ~100 characters
    
    33
    +    # when binding sockets
    
    34
    +    @contextmanager
    
    35
    +    def chdir(directory):
    
    36
    +        old_dir = os.getcwd()
    
    37
    +        os.chdir(directory)
    
    38
    +        yield
    
    39
    +        os.chdir(old_dir)
    
    40
    +
    
    41
    +    patch_path = 'irregular_file.patch'
    
    42
    +    with chdir(project):
    
    43
    +        for file_type in filetypegenerator.generate_file_types(patch_path):
    
    44
    +            result = cli.run(project=project, args=[
    
    45
    +                'show', 'irregular.bst'
    
    46
    +            ])
    
    47
    +            if os.path.isfile(patch_path) and not os.path.islink(patch_path):
    
    48
    +                result.assert_success()
    
    49
    +            else:
    
    50
    +                result.assert_main_error(ErrorDomain.LOAD,
    
    51
    +                                         LoadErrorReason.PROJ_PATH_INVALID_KIND)
    
    41 52
     
    
    42 53
     
    
    43 54
     @pytest.mark.datafiles(os.path.join(DATA_DIR, 'basic'))
    

  • tests/testutils/site.py
    ... ... @@ -4,6 +4,7 @@
    4 4
     import os
    
    5 5
     import subprocess
    
    6 6
     import sys
    
    7
    +import platform
    
    7 8
     
    
    8 9
     from buildstream import _site, utils, ProgramNotFoundError
    
    9 10
     from buildstream._platform import Platform
    
    ... ... @@ -56,7 +57,7 @@ try:
    56 57
     except ImportError:
    
    57 58
         HAVE_ARPY = False
    
    58 59
     
    
    59
    -IS_LINUX = os.getenv('BST_FORCE_BACKEND', sys.platform).startswith('linux')
    
    60
    -IS_WINDOWS = (os.name == 'nt')
    
    60
    +IS_WINDOWS = ('Microsoft' in platform.uname().release)
    
    61
    +IS_LINUX = os.getenv('BST_FORCE_BACKEND', sys.platform).startswith('linux') and not IS_WINDOWS
    
    61 62
     
    
    62 63
     MACHINE_ARCH = Platform.get_host_arch()



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