ci: share Linux restore artifacts before builds [CI]
This commit is contained in:
1 parent
a6f9759238
commit
806493567b
13 files changed
+211
-82
No files matched your search
@@ -61,6 +61,10 @@ class LinuxBuildTests(unittest.TestCase):
|
||||
self.assertEqual(left, right)
|
||||
self.assertTrue(all(mtime == module.FIXED_MTIME for _, mtime in left.values()))
|
||||
self.assertTrue((second / 'source/packaging/native/msquic/linux-musl-arm64/libmsquic.a').is_file())
|
||||
traversal = (first / 'source/backend/Agent.Native.proj').read_text()
|
||||
self.assertIn('Targets="Restore" BuildInParallel="false"', traversal)
|
||||
self.assertIn('Targets="Build" BuildInParallel="false"', traversal)
|
||||
self.assertIn('RuntimeIdentifier=$(RuntimeIdentifier);SelfContained=$(SelfContained)', traversal)
|
||||
|
||||
def test_retention_removes_only_expired_layers_without_pruning_package_caches(self):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
@@ -69,7 +73,7 @@ class LinuxBuildTests(unittest.TestCase):
|
||||
buildah.write_text('''#!/usr/bin/env bash
|
||||
set -eu
|
||||
case "$1" in
|
||||
images) printf 'old %s <none>:<none>\nrecent %s <none>:<none>\nversion %s localhost/moshiro-agent:1.0.0-amd64\nactive %s localhost/moshiro-agent:ci-dev-amd64\n' "$OLD_TIME" "$RECENT_TIME" "$OLD_TIME" "$OLD_TIME" ;;
|
||||
images) printf 'old %s <none>:<none>\nrecent %s <none>:<none>\nversion %s localhost/moshiro-agent:1.0.0-amd64\nrestore %s localhost/moshiro-agent-restore:0123456789abcdef0123456789abcdef01234567-linux-x64\nactive %s localhost/moshiro-agent:ci-dev-amd64\n' "$OLD_TIME" "$RECENT_TIME" "$OLD_TIME" "$OLD_TIME" "$OLD_TIME" ;;
|
||||
rmi) printf '%s\n' "$*" >> "$FIXTURE/removed" ;;
|
||||
unshare) exit 0 ;;
|
||||
*) exit 9 ;;
|
||||
@@ -80,7 +84,7 @@ esac
|
||||
OLD_TIME=str(int(time.time()) - 8 * 86400), RECENT_TIME=str(int(time.time())),
|
||||
CONTAINERS_STORAGE_CONF=str(base / 'moshiro-storage.conf'))
|
||||
subprocess.run(['bash', str(ROOT / 'ci/cleanup-build-cache.sh')], env=env, check=True, capture_output=True)
|
||||
self.assertEqual((base / 'removed').read_text(), 'rmi localhost/moshiro-agent-binaries:linux-musl-x64\nrmi old\nrmi version\n')
|
||||
self.assertEqual((base / 'removed').read_text(), 'rmi localhost/moshiro-agent-binaries:linux-musl-x64\nrmi old\nrmi version\nrmi restore\n')
|
||||
|
||||
def test_export_requires_one_unshare_session_and_cleans_up_on_copy_failure(self):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
|
||||
Reference in new issue
Block a user