[Notes] [Git][BuildStream/buildstream][jonathan/wsl-tests] 2 commits: Test adding a wsl test



Title: GitLab

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

Commits:

2 changed files:

Changes:

  • .gitlab-ci.yml
    ... ... @@ -127,6 +127,20 @@ lint:
    127 127
       except:
    
    128 128
       - schedules
    
    129 129
     
    
    130
    +tests-wsl:
    
    131
    +  stage: test
    
    132
    +  variables:
    
    133
    +    LC_ALL: C.UTF-8
    
    134
    +    LANG: C.UTF-8
    
    135
    +  tags:
    
    136
    +  - wsl
    
    137
    +  before_script:
    
    138
    +  - mount
    
    139
    +  - df -h
    
    140
    +
    
    141
    +  script:
    
    142
    +  - tox
    
    143
    +
    
    130 144
     # Automatically build documentation for every commit, we want to know
    
    131 145
     # if building documentation fails even if we're not deploying it.
    
    132 146
     docs:
    

  • 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 collections 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(directory):
    
    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'))
    



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