[Notes] [Git][BuildStream/buildstream][tristan/detox-tests] 5 commits: Another try



Title: GitLab

Tristan Van Berkom pushed to branch tristan/detox-tests at BuildStream / buildstream

Commits:

3 changed files:

Changes:

  • .gitignore
    ... ... @@ -13,11 +13,12 @@ tests/**/*.pyc
    13 13
     integration-cache/
    
    14 14
     tmp
    
    15 15
     .coverage
    
    16
    +.coverage-reports/
    
    16 17
     .coverage.*
    
    17 18
     .cache
    
    18 19
     .pytest_cache/
    
    19 20
     *.bst/
    
    20
    -.tox
    
    21
    +.tox/
    
    21 22
     
    
    22 23
     # Pycache, in case buildstream is ran directly from within the source
    
    23 24
     # tree
    

  • .gitlab-ci.yml
    ... ... @@ -13,7 +13,7 @@ variables:
    13 13
       PYTEST_ADDOPTS: "--color=yes"
    
    14 14
       INTEGRATION_CACHE: "${CI_PROJECT_DIR}/cache/integration-cache"
    
    15 15
       TEST_COMMAND: "tox -- --color=yes --integration"
    
    16
    -  COVERAGE_DIR: "${CI_PROJECT_DIR}/coverage"
    
    16
    +  COVERAGE_DIR: "${CI_PROJECT_DIR}/coverage-reports"
    
    17 17
       COVERAGE_PREFIX: "${CI_JOB_NAME}"
    
    18 18
     
    
    19 19
     
    
    ... ... @@ -39,9 +39,6 @@ variables:
    39 39
       - su buildstream -c "${TEST_COMMAND}"
    
    40 40
     
    
    41 41
       after_script:
    
    42
    -  # Collect our reports
    
    43
    -  - mkdir -p ${COVERAGE_DIR}
    
    44
    -  - cp .coverage.* ${COVERAGE_DIR}
    
    45 42
       except:
    
    46 43
       - schedules
    
    47 44
       artifacts:
    
    ... ... @@ -237,18 +234,12 @@ coverage:
    237 234
       stage: post
    
    238 235
       coverage: '/TOTAL +\d+ +\d+ +(\d+\.\d+)%/'
    
    239 236
       script:
    
    240
    -    - pip3 install -r requirements/requirements.txt -r requirements/dev-requirements.txt
    
    241
    -    - pip3 install --no-index .
    
    242
    -    - mkdir report
    
    243
    -    - cp ./coverage/* report/
    
    244
    -    - cd report
    
    245
    -    - ls coverage.*
    
    246
    -    - coverage combine --rcfile=../.coveragerc -a coverage.*
    
    247
    -    - coverage report --rcfile=../.coveragerc -m
    
    237
    +    - tox -e coverage
    
    248 238
       dependencies:
    
    249 239
       - tests-debian-9
    
    250 240
       - tests-fedora-27
    
    251 241
       - tests-fedora-28
    
    242
    +  - tests-ubuntu-18.04
    
    252 243
       - tests-unix
    
    253 244
       except:
    
    254 245
       - schedules
    

  • tox.ini
    1
    +#
    
    2
    +# Tox global configuration
    
    3
    +#
    
    1 4
     [tox]
    
    2 5
     envlist = py35,py36,py37
    
    3 6
     skip_missing_interpreters = true
    
    4 7
     
    
    5
    -[testenv]
    
    6
    -# We change directory so that pycoverage stores it's temporary report
    
    7
    -# files in separate directories, which helps if the environments are
    
    8
    -# being tested in parallel.
    
    9 8
     #
    
    10
    -# After the test is run we place the coverage file in the project root
    
    11
    -changedir = {envdir}
    
    9
    +# Defaults for all environments
    
    10
    +#
    
    11
    +# Anything specified here is iherited by the sections
    
    12
    +#
    
    13
    +[testenv]
    
    12 14
     commands =
    
    13 15
         pytest --basetemp {envtmpdir} {posargs} {toxinidir}
    
    14
    -    cp $COVERAGE_FILE {toxinidir}
    
    16
    +    mkdir -p {toxinidir}/.coverage-reports
    
    17
    +    cp .coverage.{env:COVERAGE_PREFIX:}{envname} {toxinidir}/.coverage-reports
    
    15 18
     deps =
    
    16 19
         -rrequirements/requirements.txt
    
    17 20
         -rrequirements/dev-requirements.txt
    
    ... ... @@ -20,9 +23,30 @@ passenv =
    20 23
         BST_FORCE_BACKEND
    
    21 24
         GI_TYPELIB_PATH
    
    22 25
         INTEGRATION_CACHE
    
    26
    +
    
    27
    +changedir =
    
    28
    +    py{35,36,37}: {envdir}
    
    29
    +setenv =
    
    30
    +    py{35,36,37}: COVERAGE_FILE = .coverage.{env:COVERAGE_PREFIX:}{envname}
    
    31
    +whitelist_externals =
    
    32
    +    py{35,36,37}: cp
    
    33
    +
    
    34
    +#
    
    35
    +# Coverage reporting
    
    36
    +#
    
    37
    +[testenv:coverage]
    
    38
    +commands =
    
    39
    +    coverage combine --rcfile={toxinidir}/.coveragerc --append {toxinidir}/.coverage-reports/
    
    40
    +    coverage report --rcfile={toxinidir}/.coveragerc -m
    
    41
    +deps =
    
    42
    +    -rrequirements/requirements.txt
    
    43
    +    -rrequirements/dev-requirements.txt
    
    23 44
     setenv =
    
    24
    -    COVERAGE_FILE = .coverage.{env:COVERAGE_PREFIX:}{envname}
    
    45
    +    COVERAGE_FILE = {toxinidir}/.coverage-reports/.coverage
    
    25 46
     
    
    47
    +#
    
    48
    +# Running linters
    
    49
    +#
    
    26 50
     [testenv:lint]
    
    27 51
     commands =
    
    28 52
         pycodestyle
    
    ... ... @@ -32,6 +56,9 @@ deps =
    32 56
         -rrequirements/dev-requirements.txt
    
    33 57
         -rrequirements/plugin-requirements.txt
    
    34 58
     
    
    59
    +#
    
    60
    +# Building documentation
    
    61
    +#
    
    35 62
     [testenv:docs]
    
    36 63
     commands =
    
    37 64
         make -C doc
    



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