Tiago Gomes pushed to branch tiagogomes/system_tests at BuildStream / buildstream
Commits:
-
f4fe6b6a
by Tiago Gomes at 2018-08-07T13:28:30Z
-
75ee55f3
by Tiago Gomes at 2018-08-07T13:29:36Z
-
8de0181a
by Tiago Gomes at 2018-08-07T13:29:36Z
4 changed files:
- .gitlab-ci.yml
- buildstream/_artifactcache/cascache.py
- buildstream/_scheduler/jobs/elementjob.py
- buildstream/_scheduler/queues/queue.py
Changes:
... | ... | @@ -84,6 +84,8 @@ source_dist: |
84 | 84 |
- cd ../..
|
85 | 85 |
- mkdir -p coverage-linux/
|
86 | 86 |
- cp dist/buildstream/.coverage.* coverage-linux/coverage."${CI_JOB_NAME}"
|
87 |
+ except:
|
|
88 |
+ - schedules
|
|
87 | 89 |
artifacts:
|
88 | 90 |
paths:
|
89 | 91 |
- coverage-linux/
|
... | ... | @@ -125,6 +127,8 @@ tests-unix: |
125 | 127 |
- cd ../..
|
126 | 128 |
- mkdir -p coverage-unix/
|
127 | 129 |
- cp dist/buildstream/.coverage.* coverage-unix/coverage.unix
|
130 |
+ except:
|
|
131 |
+ - schedules
|
|
128 | 132 |
artifacts:
|
129 | 133 |
paths:
|
130 | 134 |
- coverage-unix/
|
... | ... | @@ -146,10 +150,46 @@ docs: |
146 | 150 |
- make BST_FORCE_SESSION_REBUILD=1 -C doc
|
147 | 151 |
- cd ../..
|
148 | 152 |
- mv dist/buildstream/doc/build/html public
|
153 |
+ except:
|
|
154 |
+ - schedules
|
|
149 | 155 |
artifacts:
|
150 | 156 |
paths:
|
151 | 157 |
- public/
|
152 | 158 |
|
159 |
+.system-tests: &system-tests-template
|
|
160 |
+ stage: test
|
|
161 |
+ variables:
|
|
162 |
+ XDG_CACHE_HOME: /cache
|
|
163 |
+ bst_ext_url: git+https://gitlab.com/BuildStream/bst-external.git
|
|
164 |
+ bst_ext_ref: 31376f750df713b3613d5348f93100c7e0ef68c0 # 0.3
|
|
165 |
+ fd_sdk_ref: 27cb7575f57e2922331facbd252dc690807c7182 # 18.08
|
|
166 |
+ expected_cache_key: 49816d4c
|
|
167 |
+ before_script:
|
|
168 |
+ - (cd dist && ./unpack.sh && cd buildstream && pip3 install .)
|
|
169 |
+ - pip3 install --user -e ${bst_ext_url}@${bst_ext_ref}#egg=bst_ext
|
|
170 |
+ - git clone https://gitlab.com/freedesktop-sdk/freedesktop-sdk.git
|
|
171 |
+ - git -C freedesktop-sdk checkout ${fd_sdk_ref}
|
|
172 |
+ #when:
|
|
173 |
+ #- schedules
|
|
174 |
+ |
|
175 |
+system-tests:
|
|
176 |
+ <<: *system-tests-template
|
|
177 |
+ script:
|
|
178 |
+ - make -C freedesktop-sdk
|
|
179 |
+ - pwd
|
|
180 |
+ - cache_key=$(bst show all.bst --deps none --format %{key})
|
|
181 |
+ - test ${cache_key} == ${expected_cache_key}
|
|
182 |
+ |
|
183 |
+system-tests-no-cache:
|
|
184 |
+ <<: *system-tests-template
|
|
185 |
+ script:
|
|
186 |
+ - sed -i '/artifacts:/,+1 d' freedesktop-sdk/bootstrap/project.conf
|
|
187 |
+ - sed -i '/artifacts:/,+1 d' freedesktop-sdk/project.conf
|
|
188 |
+ - make -C freedesktop-sdk
|
|
189 |
+ - pwd
|
|
190 |
+ - cache_key=$(bst show all.bst --deps none --format %{key})
|
|
191 |
+ - test ${cache_key} == ${expected_cache_key}
|
|
192 |
+ |
|
153 | 193 |
|
154 | 194 |
#####################################################
|
155 | 195 |
# Post stage #
|
... | ... | @@ -174,6 +214,8 @@ codequality: |
174 | 214 |
--volume "$PWD":/code
|
175 | 215 |
--volume /var/run/docker.sock:/var/run/docker.sock
|
176 | 216 |
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
|
217 |
+ except:
|
|
218 |
+ - schedules
|
|
177 | 219 |
artifacts:
|
178 | 220 |
paths: [codeclimate.json]
|
179 | 221 |
|
... | ... | @@ -199,6 +241,8 @@ analysis: |
199 | 241 |
radon raw -s -j buildstream > analysis/raw.json
|
200 | 242 |
radon raw -s buildstream
|
201 | 243 |
|
244 |
+ except:
|
|
245 |
+ - schedules
|
|
202 | 246 |
artifacts:
|
203 | 247 |
paths:
|
204 | 248 |
- analysis/
|
... | ... | @@ -223,6 +267,8 @@ coverage: |
223 | 267 |
- tests-fedora-27
|
224 | 268 |
- tests-unix
|
225 | 269 |
- source_dist
|
270 |
+ except:
|
|
271 |
+ - schedules
|
|
226 | 272 |
|
227 | 273 |
# Deploy, only for merges which land on master branch.
|
228 | 274 |
#
|
... | ... | @@ -247,3 +293,5 @@ pages: |
247 | 293 |
# See https://gitlab.com/gitlab-org/gitlab-ce/issues/35141
|
248 | 294 |
#
|
249 | 295 |
- master
|
296 |
+ except:
|
|
297 |
+ - schedules
|
... | ... | @@ -56,7 +56,9 @@ class CASCache(ArtifactCache): |
56 | 56 |
super().__init__(context)
|
57 | 57 |
|
58 | 58 |
self.casdir = os.path.join(context.artifactdir, 'cas')
|
59 |
- os.makedirs(os.path.join(self.casdir, 'tmp'), exist_ok=True)
|
|
59 |
+ |
|
60 |
+ self.tmpdir = os.path.join(context.artifactdir, 'tmp')
|
|
61 |
+ os.makedirs(self.tmpdir, exist_ok=True)
|
|
60 | 62 |
|
61 | 63 |
self._enable_push = enable_push
|
62 | 64 |
|
... | ... | @@ -394,7 +396,7 @@ class CASCache(ArtifactCache): |
394 | 396 |
try:
|
395 | 397 |
h = hashlib.sha256()
|
396 | 398 |
# Always write out new file to avoid corruption if input file is modified
|
397 |
- with tempfile.NamedTemporaryFile(dir=os.path.join(self.casdir, 'tmp')) as out:
|
|
399 |
+ with tempfile.NamedTemporaryFile(dir=self.tmpdir) as out:
|
|
398 | 400 |
# Set mode bits to 0644
|
399 | 401 |
os.chmod(out.name, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH)
|
400 | 402 |
|
... | ... | @@ -764,7 +766,7 @@ class CASCache(ArtifactCache): |
764 | 766 |
# already in local cache
|
765 | 767 |
return
|
766 | 768 |
|
767 |
- with tempfile.NamedTemporaryFile(dir=os.path.join(self.casdir, 'tmp')) as out:
|
|
769 |
+ with tempfile.NamedTemporaryFile(dir=self.tmpdir) as out:
|
|
768 | 770 |
self._fetch_blob(remote, tree, out)
|
769 | 771 |
|
770 | 772 |
directory = remote_execution_pb2.Directory()
|
... | ... | @@ -778,7 +780,7 @@ class CASCache(ArtifactCache): |
778 | 780 |
# already in local cache
|
779 | 781 |
continue
|
780 | 782 |
|
781 |
- with tempfile.NamedTemporaryFile(dir=os.path.join(self.casdir, 'tmp')) as f:
|
|
783 |
+ with tempfile.NamedTemporaryFile(dir=self.tmpdir) as f:
|
|
782 | 784 |
self._fetch_blob(remote, filenode.digest, f)
|
783 | 785 |
|
784 | 786 |
digest = self.add_object(path=f.name)
|
... | ... | @@ -109,13 +109,11 @@ class ElementJob(Job): |
109 | 109 |
data = {}
|
110 | 110 |
|
111 | 111 |
workspace = self._element._get_workspace()
|
112 |
- artifact_size = self._element._get_artifact_size()
|
|
113 |
- cache_size = self._element._get_artifact_cache().calculate_cache_size()
|
|
114 |
- |
|
115 | 112 |
if workspace is not None:
|
116 | 113 |
data['workspace'] = workspace.to_dict()
|
114 |
+ |
|
115 |
+ artifact_size = self._element._get_artifact_size()
|
|
117 | 116 |
if artifact_size is not None:
|
118 | 117 |
data['artifact_size'] = artifact_size
|
119 |
- data['cache_size'] = cache_size
|
|
120 | 118 |
|
121 | 119 |
return data
|
... | ... | @@ -300,8 +300,6 @@ class Queue(): |
300 | 300 |
# Update values that need to be synchronized in the main task
|
301 | 301 |
# before calling any queue implementation
|
302 | 302 |
self._update_workspaces(element, job)
|
303 |
- if job.child_data:
|
|
304 |
- element._get_artifact_cache().cache_size = job.child_data.get('cache_size')
|
|
305 | 303 |
|
306 | 304 |
# Give the result of the job to the Queue implementor,
|
307 | 305 |
# and determine if it should be considered as processed
|