ci(gitea): split builds and retry artifact publication
This commit is contained in:
1 parent
d83f94afd5
commit
b225008476
18 files changed
+1790
-286
No files matched your search
@@ -5,7 +5,7 @@ from pathlib import Path
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
from release_artifacts import AUDIT, FEED, INSTALLER, PORTABLE, app_versions, checksum_lines, validate_artifact
|
||||
from release_artifacts import AUDIT, FEED, INSTALLER, PORTABLE, METADATA, app_versions, checksum_lines, validate_artifact, validate_metadata
|
||||
|
||||
|
||||
def fixture():
|
||||
@@ -101,6 +101,30 @@ class ReleaseArtifactTests(unittest.TestCase):
|
||||
with self.assertRaises(ValueError):
|
||||
app_versions(spec)
|
||||
|
||||
def test_compact_metadata_validates_without_binary_packages(self):
|
||||
contents = fixture()
|
||||
metadata = {name: contents[name] for name in METADATA}
|
||||
manifest = validate_metadata(metadata, '0.1.0', '0.1.0-build.2')
|
||||
self.assertIn(INSTALLER, manifest['files'])
|
||||
self.assertNotIn(INSTALLER, metadata)
|
||||
|
||||
def test_compact_metadata_rejects_missing_extra_or_tampered_files(self):
|
||||
original = {name: body for name, body in fixture().items() if name in METADATA}
|
||||
for name in METADATA:
|
||||
with self.subTest(name=name):
|
||||
metadata = dict(original)
|
||||
del metadata[name]
|
||||
with self.assertRaises(ValueError):
|
||||
validate_metadata(metadata, '0.1.0', '0.1.0-build.2')
|
||||
for name in ['SHA256SUMS', AUDIT, FEED]:
|
||||
metadata = dict(original)
|
||||
metadata[name] += b'corrupt'
|
||||
with self.assertRaises(ValueError):
|
||||
validate_metadata(metadata, '0.1.0', '0.1.0-build.2')
|
||||
metadata = dict(original, unexpected=b'file')
|
||||
with self.assertRaises(ValueError):
|
||||
validate_metadata(metadata, '0.1.0', '0.1.0-build.2')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user