[Notes] [Git][BuildStream/buildstream][chandan/tox] fast test



Title: GitLab

Chandan Singh pushed to branch chandan/tox at BuildStream / buildstream

Commits:

1 changed file:

Changes:

  • .gitlab-ci.yml
    ... ... @@ -16,49 +16,49 @@ stages:
    16 16
     
    
    17 17
     # Run premerge commits
    
    18 18
     #
    
    19
    -.linux-tests-template: &linux-tests
    
    20
    -  stage: test
    
    21
    -  variables:
    
    22
    -    PYTEST_ADDOPTS: "--color=yes"
    
    23
    -  script:
    
    24
    -  # Diagnostics
    
    25
    -  - mount
    
    26
    -  - df -h
    
    27
    -
    
    28
    -  - useradd -Um buildstream
    
    29
    -  - chown -R buildstream:buildstream .
    
    30
    -
    
    31
    -  - export INTEGRATION_CACHE="$(pwd)/cache/integration-cache"
    
    32
    -
    
    33
    -  # Run the tests from the source distribution, We run as a simple
    
    34
    -  # user to test for permission issues
    
    35
    -  - su buildstream -c tox
    
    36
    -
    
    37
    -  # Go back to the toplevel and collect our reports
    
    38
    -  - cd ../..
    
    39
    -  - mkdir -p coverage-linux/
    
    40
    -  - cp dist/buildstream/.coverage coverage-linux/coverage."${CI_JOB_NAME}"
    
    41
    -  except:
    
    42
    -  - schedules
    
    43
    -  artifacts:
    
    44
    -    paths:
    
    45
    -    - coverage-linux/
    
    46
    -
    
    47
    -tests-debian-9:
    
    48
    -  image: buildstream/testsuite-debian:9-master-119-552f5fc6
    
    49
    -  <<: *linux-tests
    
    50
    -
    
    51
    -tests-fedora-27:
    
    52
    -  image: buildstream/testsuite-fedora:27-master-119-552f5fc6
    
    53
    -  <<: *linux-tests
    
    54
    -
    
    55
    -tests-fedora-28:
    
    56
    -  image: buildstream/testsuite-fedora:28-master-119-552f5fc6
    
    57
    -  <<: *linux-tests
    
    58
    -
    
    59
    -tests-ubuntu-18.04:
    
    60
    -  image: buildstream/testsuite-ubuntu:18.04-master-119-552f5fc6
    
    61
    -  <<: *linux-tests
    
    19
    +# .linux-tests-template: &linux-tests
    
    20
    +#   stage: test
    
    21
    +#   variables:
    
    22
    +#     PYTEST_ADDOPTS: "--color=yes"
    
    23
    +#   script:
    
    24
    +#   # Diagnostics
    
    25
    +#   - mount
    
    26
    +#   - df -h
    
    27
    +#
    
    28
    +#   - useradd -Um buildstream
    
    29
    +#   - chown -R buildstream:buildstream .
    
    30
    +#
    
    31
    +#   - export INTEGRATION_CACHE="$(pwd)/cache/integration-cache"
    
    32
    +#
    
    33
    +#   # Run the tests from the source distribution, We run as a simple
    
    34
    +#   # user to test for permission issues
    
    35
    +#   - su buildstream -c tox
    
    36
    +#
    
    37
    +#   # Go back to the toplevel and collect our reports
    
    38
    +#   - cd ../..
    
    39
    +#   - mkdir -p coverage-linux/
    
    40
    +#   - cp dist/buildstream/.coverage coverage-linux/coverage."${CI_JOB_NAME}"
    
    41
    +#   except:
    
    42
    +#   - schedules
    
    43
    +#   artifacts:
    
    44
    +#     paths:
    
    45
    +#     - coverage-linux/
    
    46
    +
    
    47
    +# tests-debian-9:
    
    48
    +#   image: buildstream/testsuite-debian:9-master-119-552f5fc6
    
    49
    +#   <<: *linux-tests
    
    50
    +#
    
    51
    +# tests-fedora-27:
    
    52
    +#   image: buildstream/testsuite-fedora:27-master-119-552f5fc6
    
    53
    +#   <<: *linux-tests
    
    54
    +#
    
    55
    +# tests-fedora-28:
    
    56
    +#   image: buildstream/testsuite-fedora:28-master-119-552f5fc6
    
    57
    +#   <<: *linux-tests
    
    58
    +#
    
    59
    +# tests-ubuntu-18.04:
    
    60
    +#   image: buildstream/testsuite-ubuntu:18.04-master-119-552f5fc6
    
    61
    +#   <<: *linux-tests
    
    62 62
     
    
    63 63
     tests-unix:
    
    64 64
       # Use fedora here, to a) run a test on fedora and b) ensure that we
    
    ... ... @@ -79,10 +79,11 @@ tests-unix:
    79 79
         - dnf erase -y bubblewrap ostree
    
    80 80
     
    
    81 81
         # Since the unix platform is required to run as root, no user change required
    
    82
    +    - pip3 install tox
    
    82 83
         - tox
    
    84
    +    - find . -name '.coverage'
    
    83 85
     
    
    84 86
         # Go back to the toplevel and collect our reports
    
    85
    -    - cd ../..
    
    86 87
         - mkdir -p coverage-unix/
    
    87 88
         - cp dist/buildstream/.coverage coverage-unix/coverage.unix
    
    88 89
       except:
    
    ... ... @@ -93,159 +94,159 @@ tests-unix:
    93 94
         - logs-unix/
    
    94 95
     
    
    95 96
     
    
    96
    -# Automatically build documentation for every commit, we want to know
    
    97
    -# if building documentation fails even if we're not deploying it.
    
    98
    -# Note: We still do not enforce a consistent installation of python3-sphinx,
    
    99
    -#       as it will significantly grow the backing image.
    
    100
    -docs:
    
    101
    -  stage: test
    
    102
    -  script:
    
    103
    -  - export BST_SOURCE_CACHE="$(pwd)/cache/integration-cache/sources"
    
    104
    -  # Currently sphinx_rtd_theme does not support Sphinx >1.8, this breaks search functionality
    
    105
    -  - pip3 install sphinx==1.7.9
    
    106
    -  - pip3 install sphinx-click
    
    107
    -  - pip3 install sphinx_rtd_theme
    
    108
    -  - mv dist/buildstream/doc/build/html public
    
    109
    -  except:
    
    110
    -  - schedules
    
    111
    -  artifacts:
    
    112
    -    paths:
    
    113
    -    - public/
    
    114
    -
    
    115
    -.overnight-tests: &overnight-tests-template
    
    116
    -  stage: test
    
    117
    -  variables:
    
    118
    -    BST_EXT_URL: git+https://gitlab.com/BuildStream/bst-external.git
    
    119
    -    BST_EXT_REF: 1d6ab71151b93c8cbc0a91a36ffe9270f3b835f1 # 0.5.1
    
    120
    -    FD_SDK_REF: 88d7c22c2281b987faa02edd57df80d430eecf1f # 18.08.11-35-g88d7c22c
    
    121
    -  before_script:
    
    122
    -  - (cd dist && ./unpack.sh && cd buildstream && pip3 install .)
    
    123
    -  - pip3 install --user -e ${BST_EXT_URL}@${BST_EXT_REF}#egg=bst_ext
    
    124
    -  - git clone https://gitlab.com/freedesktop-sdk/freedesktop-sdk.git
    
    125
    -  - git -C freedesktop-sdk checkout ${FD_SDK_REF}
    
    126
    -  only:
    
    127
    -  - schedules
    
    128
    -
    
    129
    -overnight-tests:
    
    130
    -  <<: *overnight-tests-template
    
    131
    -  script:
    
    132
    -  - make -C freedesktop-sdk
    
    133
    -  tags:
    
    134
    -  - overnight-tests
    
    135
    -
    
    136
    -overnight-tests-no-cache:
    
    137
    -  <<: *overnight-tests-template
    
    138
    -  script:
    
    139
    -  - sed -i '/artifacts:/,+1 d' freedesktop-sdk/bootstrap/project.conf
    
    140
    -  - sed -i '/artifacts:/,+1 d' freedesktop-sdk/project.conf
    
    141
    -  - make -C freedesktop-sdk
    
    142
    -  tags:
    
    143
    -  - overnight-tests
    
    144
    -
    
    145
    -# Check code quality with gitlab's built-in feature.
    
    97
    +# # Automatically build documentation for every commit, we want to know
    
    98
    +# # if building documentation fails even if we're not deploying it.
    
    99
    +# # Note: We still do not enforce a consistent installation of python3-sphinx,
    
    100
    +# #       as it will significantly grow the backing image.
    
    101
    +# docs:
    
    102
    +#   stage: test
    
    103
    +#   script:
    
    104
    +#   - export BST_SOURCE_CACHE="$(pwd)/cache/integration-cache/sources"
    
    105
    +#   # Currently sphinx_rtd_theme does not support Sphinx >1.8, this breaks search functionality
    
    106
    +#   - pip3 install sphinx==1.7.9
    
    107
    +#   - pip3 install sphinx-click
    
    108
    +#   - pip3 install sphinx_rtd_theme
    
    109
    +#   - mv dist/buildstream/doc/build/html public
    
    110
    +#   except:
    
    111
    +#   - schedules
    
    112
    +#   artifacts:
    
    113
    +#     paths:
    
    114
    +#     - public/
    
    146 115
     #
    
    147
    -code_quality:
    
    148
    -  image: docker:stable
    
    149
    -  stage: test
    
    150
    -  variables:
    
    151
    -    DOCKER_DRIVER: overlay2
    
    152
    -  allow_failure: true
    
    153
    -  services:
    
    154
    -    - docker:stable-dind
    
    155
    -  script:
    
    156
    -    - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
    
    157
    -    - docker run
    
    158
    -        --env SOURCE_CODE="$PWD"
    
    159
    -        --volume "$PWD":/code
    
    160
    -        --volume /var/run/docker.sock:/var/run/docker.sock
    
    161
    -        "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
    
    162
    -  except:
    
    163
    -  - schedules
    
    164
    -  artifacts:
    
    165
    -    paths: [gl-code-quality-report.json]
    
    166
    -
    
    167
    -#####################################################
    
    168
    -#                    Post stage                     #
    
    169
    -#####################################################
    
    170
    -
    
    171
    -analysis:
    
    172
    -  stage: post
    
    173
    -  script:
    
    174
    -  - |
    
    175
    -    pip3 install radon
    
    176
    -    mkdir analysis
    
    177
    -
    
    178
    -  - |
    
    179
    -    echo "Calculating Maintainability Index"
    
    180
    -    radon mi -s -j buildstream > analysis/mi.json
    
    181
    -    radon mi -s buildstream
    
    182
    -
    
    183
    -  - |
    
    184
    -    echo "Calculating Cyclomatic Complexity"
    
    185
    -    radon cc -a -s -j buildstream > analysis/cc.json
    
    186
    -    radon cc -a -s buildstream
    
    187
    -
    
    188
    -  - |
    
    189
    -    echo "Calculating Raw Metrics"
    
    190
    -    radon raw -s -j buildstream > analysis/raw.json
    
    191
    -    radon raw -s buildstream
    
    192
    -
    
    193
    -  except:
    
    194
    -  - schedules
    
    195
    -  artifacts:
    
    196
    -    paths:
    
    197
    -    - analysis/
    
    198
    -
    
    199
    -# Collate coverage reports
    
    116
    +# .overnight-tests: &overnight-tests-template
    
    117
    +#   stage: test
    
    118
    +#   variables:
    
    119
    +#     BST_EXT_URL: git+https://gitlab.com/BuildStream/bst-external.git
    
    120
    +#     BST_EXT_REF: 1d6ab71151b93c8cbc0a91a36ffe9270f3b835f1 # 0.5.1
    
    121
    +#     FD_SDK_REF: 88d7c22c2281b987faa02edd57df80d430eecf1f # 18.08.11-35-g88d7c22c
    
    122
    +#   before_script:
    
    123
    +#   - (cd dist && ./unpack.sh && cd buildstream && pip3 install .)
    
    124
    +#   - pip3 install --user -e ${BST_EXT_URL}@${BST_EXT_REF}#egg=bst_ext
    
    125
    +#   - git clone https://gitlab.com/freedesktop-sdk/freedesktop-sdk.git
    
    126
    +#   - git -C freedesktop-sdk checkout ${FD_SDK_REF}
    
    127
    +#   only:
    
    128
    +#   - schedules
    
    200 129
     #
    
    201
    -coverage:
    
    202
    -  stage: post
    
    203
    -  coverage: '/TOTAL +\d+ +\d+ +(\d+\.\d+)%/'
    
    204
    -  script:
    
    205
    -    - cd dist && ./unpack.sh && cd buildstream
    
    206
    -    - pip3 install --no-index .
    
    207
    -    - mkdir report
    
    208
    -    - cd report
    
    209
    -    - cp ../../../coverage-unix/coverage.unix .
    
    210
    -    - cp ../../../coverage-linux/coverage.* .
    
    211
    -    - ls coverage.*
    
    212
    -    - coverage combine --rcfile=../.coveragerc -a coverage.*
    
    213
    -    - coverage report --rcfile=../.coveragerc -m
    
    214
    -  dependencies:
    
    215
    -  - tests-debian-9
    
    216
    -  - tests-fedora-27
    
    217
    -  - tests-fedora-28
    
    218
    -  - tests-unix
    
    219
    -  except:
    
    220
    -  - schedules
    
    221
    -
    
    222
    -# Deploy, only for merges which land on master branch.
    
    130
    +# overnight-tests:
    
    131
    +#   <<: *overnight-tests-template
    
    132
    +#   script:
    
    133
    +#   - make -C freedesktop-sdk
    
    134
    +#   tags:
    
    135
    +#   - overnight-tests
    
    223 136
     #
    
    224
    -pages:
    
    225
    -  stage: post
    
    226
    -  dependencies:
    
    227
    -  - docs
    
    228
    -  variables:
    
    229
    -    ACME_DIR: public/.well-known/acme-challenge
    
    230
    -  script:
    
    231
    -  - mkdir -p ${ACME_DIR}
    
    232
    -    # Required to finish the creation of the Let's Encrypt certificate,
    
    233
    -    # which allows using https://docs.buildstream.build/ for accessing
    
    234
    -    # the documentation.
    
    235
    -  - echo ${ACME_CHALLENGE} > ${ACME_DIR}/$(echo ${ACME_CHALLENGE} | cut -c1-43)
    
    236
    -  artifacts:
    
    237
    -    paths:
    
    238
    -    - public/
    
    239
    -  only:
    
    240
    -  #
    
    241
    -  # FIXME:
    
    242
    -  #
    
    243
    -  # Ideally we want to publish to a different subdir of
    
    244
    -  # pages depending on which stable branch we are building here,
    
    245
    -  # not currently automatically supported but can be worked around.
    
    246
    -  #
    
    247
    -  # See https://gitlab.com/gitlab-org/gitlab-ce/issues/35141
    
    248
    -  #
    
    249
    -  - master
    
    250
    -  except:
    
    251
    -  - schedules
    137
    +# overnight-tests-no-cache:
    
    138
    +#   <<: *overnight-tests-template
    
    139
    +#   script:
    
    140
    +#   - sed -i '/artifacts:/,+1 d' freedesktop-sdk/bootstrap/project.conf
    
    141
    +#   - sed -i '/artifacts:/,+1 d' freedesktop-sdk/project.conf
    
    142
    +#   - make -C freedesktop-sdk
    
    143
    +#   tags:
    
    144
    +#   - overnight-tests
    
    145
    +#
    
    146
    +# # Check code quality with gitlab's built-in feature.
    
    147
    +# #
    
    148
    +# code_quality:
    
    149
    +#   image: docker:stable
    
    150
    +#   stage: test
    
    151
    +#   variables:
    
    152
    +#     DOCKER_DRIVER: overlay2
    
    153
    +#   allow_failure: true
    
    154
    +#   services:
    
    155
    +#     - docker:stable-dind
    
    156
    +#   script:
    
    157
    +#     - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
    
    158
    +#     - docker run
    
    159
    +#         --env SOURCE_CODE="$PWD"
    
    160
    +#         --volume "$PWD":/code
    
    161
    +#         --volume /var/run/docker.sock:/var/run/docker.sock
    
    162
    +#         "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
    
    163
    +#   except:
    
    164
    +#   - schedules
    
    165
    +#   artifacts:
    
    166
    +#     paths: [gl-code-quality-report.json]
    
    167
    +#
    
    168
    +# #####################################################
    
    169
    +# #                    Post stage                     #
    
    170
    +# #####################################################
    
    171
    +#
    
    172
    +# analysis:
    
    173
    +#   stage: post
    
    174
    +#   script:
    
    175
    +#   - |
    
    176
    +#     pip3 install radon
    
    177
    +#     mkdir analysis
    
    178
    +#
    
    179
    +#   - |
    
    180
    +#     echo "Calculating Maintainability Index"
    
    181
    +#     radon mi -s -j buildstream > analysis/mi.json
    
    182
    +#     radon mi -s buildstream
    
    183
    +#
    
    184
    +#   - |
    
    185
    +#     echo "Calculating Cyclomatic Complexity"
    
    186
    +#     radon cc -a -s -j buildstream > analysis/cc.json
    
    187
    +#     radon cc -a -s buildstream
    
    188
    +#
    
    189
    +#   - |
    
    190
    +#     echo "Calculating Raw Metrics"
    
    191
    +#     radon raw -s -j buildstream > analysis/raw.json
    
    192
    +#     radon raw -s buildstream
    
    193
    +#
    
    194
    +#   except:
    
    195
    +#   - schedules
    
    196
    +#   artifacts:
    
    197
    +#     paths:
    
    198
    +#     - analysis/
    
    199
    +#
    
    200
    +# # Collate coverage reports
    
    201
    +# #
    
    202
    +# coverage:
    
    203
    +#   stage: post
    
    204
    +#   coverage: '/TOTAL +\d+ +\d+ +(\d+\.\d+)%/'
    
    205
    +#   script:
    
    206
    +#     - cd dist && ./unpack.sh && cd buildstream
    
    207
    +#     - pip3 install --no-index .
    
    208
    +#     - mkdir report
    
    209
    +#     - cd report
    
    210
    +#     - cp ../../../coverage-unix/coverage.unix .
    
    211
    +#     - cp ../../../coverage-linux/coverage.* .
    
    212
    +#     - ls coverage.*
    
    213
    +#     - coverage combine --rcfile=../.coveragerc -a coverage.*
    
    214
    +#     - coverage report --rcfile=../.coveragerc -m
    
    215
    +#   dependencies:
    
    216
    +#   - tests-debian-9
    
    217
    +#   - tests-fedora-27
    
    218
    +#   - tests-fedora-28
    
    219
    +#   - tests-unix
    
    220
    +#   except:
    
    221
    +#   - schedules
    
    222
    +#
    
    223
    +# # Deploy, only for merges which land on master branch.
    
    224
    +# #
    
    225
    +# pages:
    
    226
    +#   stage: post
    
    227
    +#   dependencies:
    
    228
    +#   - docs
    
    229
    +#   variables:
    
    230
    +#     ACME_DIR: public/.well-known/acme-challenge
    
    231
    +#   script:
    
    232
    +#   - mkdir -p ${ACME_DIR}
    
    233
    +#     # Required to finish the creation of the Let's Encrypt certificate,
    
    234
    +#     # which allows using https://docs.buildstream.build/ for accessing
    
    235
    +#     # the documentation.
    
    236
    +#   - echo ${ACME_CHALLENGE} > ${ACME_DIR}/$(echo ${ACME_CHALLENGE} | cut -c1-43)
    
    237
    +#   artifacts:
    
    238
    +#     paths:
    
    239
    +#     - public/
    
    240
    +#   only:
    
    241
    +#   #
    
    242
    +#   # FIXME:
    
    243
    +#   #
    
    244
    +#   # Ideally we want to publish to a different subdir of
    
    245
    +#   # pages depending on which stable branch we are building here,
    
    246
    +#   # not currently automatically supported but can be worked around.
    
    247
    +#   #
    
    248
    +#   # See https://gitlab.com/gitlab-org/gitlab-ce/issues/35141
    
    249
    +#   #
    
    250
    +#   - master
    
    251
    +#   except:
    
    252
    +#   - schedules



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