[Notes] [Git][BuildStream/buildstream][chandan/toxify-1.2] 3 commits: Add tox.ini from master branch



Title: GitLab

Chandan Singh pushed to branch chandan/toxify-1.2 at BuildStream / buildstream

Commits:

3 changed files:

Changes:

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

  • .gitlab-ci.yml
    1
    -image: buildstream/testsuite-debian:9-master-114-4cab18e3
    
    1
    +image: buildstream/testsuite-debian:9-5da27168-32c47d1c
    
    2 2
     
    
    3 3
     cache:
    
    4 4
       key: "$CI_JOB_NAME-"
    
    ... ... @@ -6,49 +6,13 @@ cache:
    6 6
         - cache/
    
    7 7
     
    
    8 8
     stages:
    
    9
    -  - prepare
    
    10 9
       - test
    
    11 10
       - post
    
    12 11
     
    
    13
    -#####################################################
    
    14
    -#                  Prepare stage                    #
    
    15
    -#####################################################
    
    16
    -
    
    17
    -# Create a source distribution
    
    18
    -#
    
    19
    -source_dist:
    
    20
    -  stage: prepare
    
    21
    -  script:
    
    22
    -
    
    23
    -  # Generate the source distribution tarball
    
    24
    -  #
    
    25
    -  - python3 setup.py sdist
    
    26
    -  - tar -ztf dist/*
    
    27
    -  - tarball=$(cd dist && echo $(ls *))
    
    28
    -
    
    29
    -  # Create an installer script
    
    30
    -  - |
    
    31
    -    cat > dist/install.sh << EOF
    
    32
    -    #!/bin/sh
    
    33
    -    tar -zxf ${tarball}
    
    34
    -    cd ${tarball%.tar.gz}
    
    35
    -    pip3 install --no-index .
    
    36
    -    EOF
    
    37
    -
    
    38
    -  # unpack tarball as `dist/buildstream` directory
    
    39
    -  - |
    
    40
    -    cat > dist/unpack.sh << EOF
    
    41
    -    #!/bin/sh
    
    42
    -    tar -zxf ${tarball}
    
    43
    -    mv ${tarball%.tar.gz} buildstream
    
    44
    -    EOF
    
    45
    -
    
    46
    -  # Make our helpers executable
    
    47
    -  - chmod +x dist/install.sh
    
    48
    -  - chmod +x dist/unpack.sh
    
    49
    -  artifacts:
    
    50
    -    paths:
    
    51
    -    - dist/
    
    12
    +variables:
    
    13
    +  INTEGRATION_CACHE: "${CI_PROJECT_DIR}/cache/integration-cache"
    
    14
    +  TEST_COMMAND: "tox -- --color=yes --integration"
    
    15
    +  COVERAGE_PREFIX: "${CI_JOB_NAME}."
    
    52 16
     
    
    53 17
     
    
    54 18
     #####################################################
    
    ... ... @@ -57,66 +21,53 @@ source_dist:
    57 21
     
    
    58 22
     # Run premerge commits
    
    59 23
     #
    
    60
    -.linux-tests-template: &linux-tests
    
    24
    +.tests-template: &tests
    
    61 25
       stage: test
    
    62
    -  variables:
    
    63
    -    PYTEST_ADDOPTS: "--color=yes"
    
    64
    -  script:
    
    26
    +
    
    27
    +  before_script:
    
    65 28
       # Diagnostics
    
    66 29
       - mount
    
    67 30
       - df -h
    
    68 31
     
    
    32
    +  script:
    
    33
    +  - mkdir -p "${INTEGRATION_CACHE}"
    
    69 34
       - useradd -Um buildstream
    
    70 35
       - chown -R buildstream:buildstream .
    
    71 36
     
    
    72
    -  - export INTEGRATION_CACHE="$(pwd)/cache/integration-cache"
    
    73
    -
    
    74
    -  # Unpack and get into dist/buildstream
    
    75
    -  - cd dist && ./unpack.sh
    
    76
    -  - chown -R buildstream:buildstream buildstream
    
    77
    -  - cd buildstream
    
    78
    -
    
    79
    -  # Run the tests from the source distribution, We run as a simple
    
    80
    -  # user to test for permission issues
    
    81
    -  - su buildstream -c 'python3 setup.py test --index-url invalid://uri --addopts --integration'
    
    37
    +  # Run the tests as a simple user to test for permission issues
    
    38
    +  - su buildstream -c "${TEST_COMMAND}"
    
    82 39
     
    
    83
    -  # Go back to the toplevel and collect our reports
    
    84
    -  - cd ../..
    
    85
    -  - mkdir -p coverage-linux/
    
    86
    -  - cp dist/buildstream/.coverage.* coverage-linux/coverage."${CI_JOB_NAME}"
    
    87 40
       except:
    
    88 41
       - schedules
    
    89 42
       artifacts:
    
    90 43
         paths:
    
    91
    -    - coverage-linux/
    
    44
    +    - .coverage-reports
    
    92 45
     
    
    93 46
     tests-debian-9:
    
    94
    -  image: buildstream/testsuite-debian:9-master-117-aa3a33b3
    
    95
    -  <<: *linux-tests
    
    47
    +  image: buildstream/testsuite-debian:9-5da27168-32c47d1c
    
    48
    +  <<: *tests
    
    96 49
     
    
    97 50
     tests-fedora-27:
    
    98
    -  image: buildstream/testsuite-fedora:27-master-117-aa3a33b3
    
    99
    -  <<: *linux-tests
    
    51
    +  image: buildstream/testsuite-fedora:27-5da27168-32c47d1c
    
    52
    +  <<: *tests
    
    100 53
     
    
    101 54
     tests-fedora-28:
    
    102
    -  image: buildstream/testsuite-fedora:28-master-117-aa3a33b3
    
    103
    -  <<: *linux-tests
    
    55
    +  image: buildstream/testsuite-fedora:28-5da27168-32c47d1c
    
    56
    +  <<: *tests
    
    104 57
     
    
    105 58
     tests-ubuntu-18.04:
    
    106
    -  image: buildstream/testsuite-ubuntu:18.04-master-117-aa3a33b3
    
    107
    -  <<: *linux-tests
    
    59
    +  image: buildstream/testsuite-ubuntu:18.04-5da27168-32c47d1c
    
    60
    +  <<: *tests
    
    108 61
     
    
    109 62
     tests-unix:
    
    110 63
       # Use fedora here, to a) run a test on fedora and b) ensure that we
    
    111 64
       # can get rid of ostree - this is not possible with debian-8
    
    112
    -  image: buildstream/testsuite-fedora:27-master-117-aa3a33b3
    
    113
    -  stage: test
    
    65
    +  image: buildstream/testsuite-fedora:27-5da27168-32c47d1c
    
    66
    +  <<: *tests
    
    114 67
       variables:
    
    115 68
         BST_FORCE_BACKEND: "unix"
    
    116
    -    PYTEST_ADDOPTS: "--color=yes"
    
    117
    -  script:
    
    118 69
     
    
    119
    -    - export INTEGRATION_CACHE="$(pwd)/cache/integration-cache"
    
    70
    +  script:
    
    120 71
     
    
    121 72
         # We remove the Bubblewrap and OSTree packages here so that we catch any
    
    122 73
         # codepaths that try to use them. Removing OSTree causes fuse-libs to
    
    ... ... @@ -124,39 +75,19 @@ tests-unix:
    124 75
         - dnf mark install fuse-libs
    
    125 76
         - dnf erase -y bubblewrap ostree
    
    126 77
     
    
    127
    -    # Unpack and get into dist/buildstream
    
    128
    -    - cd dist && ./unpack.sh && cd buildstream
    
    129
    -
    
    130 78
         # Since the unix platform is required to run as root, no user change required
    
    131
    -    - python3 setup.py test --index-url invalid://uri --addopts --integration
    
    132
    -
    
    133
    -    # Go back to the toplevel and collect our reports
    
    134
    -    - cd ../..
    
    135
    -    - mkdir -p coverage-unix/
    
    136
    -    - cp dist/buildstream/.coverage.* coverage-unix/coverage.unix
    
    137
    -  except:
    
    138
    -  - schedules
    
    139
    -  artifacts:
    
    140
    -    paths:
    
    141
    -    - coverage-unix/
    
    142
    -    - logs-unix/
    
    79
    +    - ${TEST_COMMAND}
    
    143 80
     
    
    144 81
     
    
    145 82
     # Automatically build documentation for every commit, we want to know
    
    146 83
     # if building documentation fails even if we're not deploying it.
    
    147
    -# Note: We still do not enforce a consistent installation of python3-sphinx,
    
    148
    -#       as it will significantly grow the backing image.
    
    149 84
     docs:
    
    150 85
       stage: test
    
    86
    +  variables:
    
    87
    +    BST_FORCE_SESSION_REBUILD: 1
    
    151 88
       script:
    
    152
    -  - export BST_SOURCE_CACHE="$(pwd)/cache/integration-cache/sources"
    
    153
    -  - pip3 install sphinx
    
    154
    -  - pip3 install sphinx-click
    
    155
    -  - pip3 install sphinx_rtd_theme
    
    156
    -  - cd dist && ./unpack.sh && cd buildstream
    
    157
    -  - make BST_FORCE_SESSION_REBUILD=1 -C doc
    
    158
    -  - cd ../..
    
    159
    -  - mv dist/buildstream/doc/build/html public
    
    89
    +  - env BST_SOURCE_CACHE="$(pwd)/cache/integration-cache/sources" tox -e docs
    
    90
    +  - mv doc/build/html public
    
    160 91
       except:
    
    161 92
       - schedules
    
    162 93
       artifacts:
    
    ... ... @@ -170,7 +101,8 @@ docs:
    170 101
         bst_ext_ref: 1d6ab71151b93c8cbc0a91a36ffe9270f3b835f1 # 0.5.1
    
    171 102
         fd_sdk_ref: 88d7c22c2281b987faa02edd57df80d430eecf1f # 18.08.12
    
    172 103
       before_script:
    
    173
    -  - (cd dist && ./unpack.sh && cd buildstream && pip3 install .)
    
    104
    +  - pip3 install -r requirements/requirements.txt -r requirements/plugin-requirements.txt
    
    105
    +  - pip3 install --no-index .
    
    174 106
       - pip3 install --user -e ${bst_ext_url}@${bst_ext_ref}#egg=bst_ext
    
    175 107
       - git clone https://gitlab.com/freedesktop-sdk/freedesktop-sdk.git
    
    176 108
       - git -C freedesktop-sdk checkout ${fd_sdk_ref}
    
    ... ... @@ -253,21 +185,15 @@ coverage:
    253 185
       stage: post
    
    254 186
       coverage: '/TOTAL +\d+ +\d+ +(\d+\.\d+)%/'
    
    255 187
       script:
    
    256
    -    - cd dist && ./unpack.sh && cd buildstream
    
    257
    -    - pip3 install --no-index .
    
    258
    -    - mkdir report
    
    259
    -    - cd report
    
    260
    -    - cp ../../../coverage-unix/coverage.unix .
    
    261
    -    - cp ../../../coverage-linux/coverage.* .
    
    262
    -    - ls coverage.*
    
    263
    -    - coverage combine --rcfile=../.coveragerc -a coverage.*
    
    264
    -    - coverage report --rcfile=../.coveragerc -m
    
    188
    +    - cp -a .coverage-reports/ ./coverage-sources
    
    189
    +    - tox -e coverage
    
    190
    +    - cp -a .coverage-reports/ ./coverage-report
    
    265 191
       dependencies:
    
    266 192
       - tests-debian-9
    
    267 193
       - tests-fedora-27
    
    268 194
       - tests-fedora-28
    
    195
    +  - tests-ubuntu-18.04
    
    269 196
       - tests-unix
    
    270
    -  - source_dist
    
    271 197
       except:
    
    272 198
       - schedules
    
    273 199
     
    
    ... ... @@ -276,7 +202,6 @@ coverage:
    276 202
     pages:
    
    277 203
       stage: post
    
    278 204
       dependencies:
    
    279
    -  - source_dist
    
    280 205
       - docs
    
    281 206
       script:
    
    282 207
       - find public/
    

  • tox.ini
    1
    +#
    
    2
    +# Tox global configuration
    
    3
    +#
    
    4
    +[tox]
    
    5
    +envlist = py35,py36,py37
    
    6
    +skip_missing_interpreters = true
    
    7
    +
    
    8
    +#
    
    9
    +# Defaults for all environments
    
    10
    +#
    
    11
    +# Anything specified here is iherited by the sections
    
    12
    +#
    
    13
    +[testenv]
    
    14
    +commands =
    
    15
    +    pytest --basetemp {envtmpdir} {posargs}
    
    16
    +    mkdir -p .coverage-reports
    
    17
    +    mv {envtmpdir}/.coverage {toxinidir}/.coverage-reports/.coverage.{env:COVERAGE_PREFIX:}{envname}
    
    18
    +deps =
    
    19
    +    -rrequirements/requirements.txt
    
    20
    +    -rrequirements/dev-requirements.txt
    
    21
    +    -rrequirements/plugin-requirements.txt
    
    22
    +passenv =
    
    23
    +    BST_FORCE_BACKEND
    
    24
    +    GI_TYPELIB_PATH
    
    25
    +    INTEGRATION_CACHE
    
    26
    +
    
    27
    +#
    
    28
    +# These keys are not inherited by any other sections
    
    29
    +#
    
    30
    +setenv =
    
    31
    +    py{35,36,37}: COVERAGE_FILE = {envtmpdir}/.coverage
    
    32
    +whitelist_externals =
    
    33
    +    py{35,36,37}:
    
    34
    +        mv
    
    35
    +        mkdir
    
    36
    +
    
    37
    +#
    
    38
    +# Coverage reporting
    
    39
    +#
    
    40
    +[testenv:coverage]
    
    41
    +commands =
    
    42
    +    - coverage combine --rcfile={toxinidir}/.coveragerc {toxinidir}/.coverage-reports/
    
    43
    +    coverage report --rcfile={toxinidir}/.coveragerc -m
    
    44
    +deps =
    
    45
    +    -rrequirements/requirements.txt
    
    46
    +    -rrequirements/dev-requirements.txt
    
    47
    +setenv =
    
    48
    +    COVERAGE_FILE = {toxinidir}/.coverage-reports/.coverage
    
    49
    +
    
    50
    +#
    
    51
    +# Building documentation
    
    52
    +#
    
    53
    +[testenv:docs]
    
    54
    +commands =
    
    55
    +    make -C doc
    
    56
    +# sphinx_rtd_theme < 0.4.2 breaks search functionality for Sphinx >= 1.8
    
    57
    +deps =
    
    58
    +    sphinx
    
    59
    +    sphinx-click
    
    60
    +    sphinx_rtd_theme >= 0.4.2
    
    61
    +    -rrequirements/requirements.txt
    
    62
    +    -rrequirements/plugin-requirements.txt
    
    63
    +passenv =
    
    64
    +    BST_FORCE_SESSION_REBUILD
    
    65
    +    BST_SOURCE_CACHE
    
    66
    +    HOME
    
    67
    +    LANG
    
    68
    +    LC_ALL
    
    69
    +whitelist_externals =
    
    70
    +    make



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