finnball pushed to branch finn/debian-stable at BuildGrid / buildgrid
Commits:
3 changed files:
Changes:
... | ... | @@ -24,6 +24,18 @@ tests-fedora: |
24 | 24 |
paths:
|
25 | 25 |
- coverage/
|
26 | 26 |
|
27 |
+tests-debian:
|
|
28 |
+ stage: test
|
|
29 |
+ image: buildstream/buildstream-debian
|
|
30 |
+ variables:
|
|
31 |
+ PYTEST_ADDOPTS: "--color=yes"
|
|
32 |
+ script:
|
|
33 |
+ - python3 setup.py test
|
|
34 |
+ - mkdir -p coverage/
|
|
35 |
+ - cp .coverage.* coverage/coverage."${CI_JOB_NAME}"
|
|
36 |
+ artifacts:
|
|
37 |
+ paths:
|
|
38 |
+ - coverage/
|
|
27 | 39 |
|
28 | 40 |
tests-dummy-job-fedora:
|
29 | 41 |
stage: test
|
... | ... | @@ -32,14 +32,14 @@ class DiskStorage(StorageABC): |
32 | 32 |
|
33 | 33 |
def __init__(self, path):
|
34 | 34 |
self._path = pathlib.Path(path)
|
35 |
- os.makedirs(self._path / "temp", exist_ok=True)
|
|
35 |
+ os.makedirs(str(self._path / "temp"), exist_ok=True)
|
|
36 | 36 |
|
37 | 37 |
def has_blob(self, digest):
|
38 | 38 |
return (self._path / (digest.hash + "_" + str(digest.size_bytes))).exists()
|
39 | 39 |
|
40 | 40 |
def get_blob(self, digest):
|
41 | 41 |
try:
|
42 |
- return open(self._path / (digest.hash + "_" + str(digest.size_bytes)), 'rb')
|
|
42 |
+ return (self._path / (digest.hash + "_" + str(digest.size_bytes))).open('rb')
|
|
43 | 43 |
except FileNotFoundError:
|
44 | 44 |
return None
|
45 | 45 |
|
... | ... | @@ -49,7 +49,7 @@ class DiskStorage(StorageABC): |
49 | 49 |
def commit_write(self, digest, write_session):
|
50 | 50 |
# Atomically move the temporary file into place.
|
51 | 51 |
path = self._path / (digest.hash + "_" + str(digest.size_bytes))
|
52 |
- os.replace(write_session.name, path)
|
|
52 |
+ os.replace(write_session.name, str(path))
|
|
53 | 53 |
try:
|
54 | 54 |
write_session.close()
|
55 | 55 |
except FileNotFoundError:
|
... | ... | @@ -83,7 +83,7 @@ def test_bytestream_read(data_to_read, instance): |
83 | 83 |
request = bytestream_pb2.ReadRequest()
|
84 | 84 |
if instance != "":
|
85 | 85 |
request.resource_name = instance + "/"
|
86 |
- request.resource_name += f"blobs/{HASH(data_to_read).hexdigest()}/{len(data_to_read)}"
|
|
86 |
+ request.resource_name += "blobs/{}/{}".format(HASH(data_to_read).hexdigest(), len(data_to_read))
|
|
87 | 87 |
|
88 | 88 |
data = b""
|
89 | 89 |
for response in servicer.Read(request, None):
|
... | ... | @@ -101,7 +101,7 @@ def test_bytestream_read_many(instance): |
101 | 101 |
request = bytestream_pb2.ReadRequest()
|
102 | 102 |
if instance != "":
|
103 | 103 |
request.resource_name = instance + "/"
|
104 |
- request.resource_name += f"blobs/{HASH(data_to_read).hexdigest()}/{len(data_to_read)}"
|
|
104 |
+ request.resource_name += "blobs/{}/{}".format(HASH(data_to_read).hexdigest(), len(data_to_read))
|
|
105 | 105 |
|
106 | 106 |
data = b""
|
107 | 107 |
for response in servicer.Read(request, None):
|
... | ... | @@ -119,7 +119,7 @@ def test_bytestream_write(instance, extra_data): |
119 | 119 |
if instance != "":
|
120 | 120 |
resource_name = instance + "/"
|
121 | 121 |
hash_ = HASH(b'abcdef').hexdigest()
|
122 |
- resource_name += f"uploads/UUID-HERE/blobs/{hash_}/6"
|
|
122 |
+ resource_name += "uploads/UUID-HERE/blobs/{}/6".format(hash_)
|
|
123 | 123 |
resource_name += extra_data
|
124 | 124 |
requests = [
|
125 | 125 |
bytestream_pb2.WriteRequest(resource_name=resource_name, data=b'abc'),
|
... | ... | @@ -139,7 +139,7 @@ def test_bytestream_write_rejects_wrong_hash(): |
139 | 139 |
|
140 | 140 |
data = b'some data'
|
141 | 141 |
wrong_hash = HASH(b'incorrect').hexdigest()
|
142 |
- resource_name = f"uploads/UUID-HERE/blobs/{wrong_hash}/9"
|
|
142 |
+ resource_name = "uploads/UUID-HERE/blobs/{}/9".format(wrong_hash)
|
|
143 | 143 |
requests = [
|
144 | 144 |
bytestream_pb2.WriteRequest(resource_name=resource_name, data=data, finish_write=True)
|
145 | 145 |
]
|