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/
|