Skip to content

Commit ad03f78

Browse files
committed
tests
1 parent 986ece1 commit ad03f78

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

src/utils/manifest.test.js

+22-14
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,31 @@ for (const [branch, manifestUrl] of Object.entries(config.manifests)) {
3030
for (const image of images) {
3131
describe(`${image.name} image`, async () => {
3232
test('xz archive', () => {
33-
expect(image.archiveFileName, 'archive to be in xz format').toContain('.xz')
34-
expect(image.archiveUrl, 'archive url to be in xz format').toContain('.xz')
35-
})
36-
37-
if (image.name === 'system') {
38-
const fileNameSkipChunks = image.fileName.includes('-skip-chunks-');
39-
const archiveUrlSkipChunks = image.archiveUrl.includes('-skip-chunks-');
40-
expect(fileNameSkipChunks, 'file name and archive url to match').toBe(archiveUrlSkipChunks);
33+
expect(image.fileName, 'file to be uncompressed').not.toContain('.xz')
34+
if (image.name === 'system') {
35+
const fileNameSkipChunks = image.fileName.includes('-skip-chunks-');
36+
const archiveUrlSkipChunks = image.archiveUrl.includes('-skip-chunks-');
37+
expect(fileNameSkipChunks, 'file name and archive url to match').toBe(archiveUrlSkipChunks);
38+
39+
if (fileNameSkipChunks || archiveUrlSkipChunks) {
40+
// pre AGNOS 11 assumption
41+
expect(image.sparse, 'system image to be sparse').toBe(true)
42+
} else {
43+
// post AGNOS 11 assumption
44+
expect(image.sparse, 'system image to not be sparse').toBe(false)
45+
}
4146

42-
if (fileNameSkipChunks || archiveUrlSkipChunks) {
43-
// pre AGNOS 11 assumption
44-
expect(image.sparse, 'system image to be sparse').toBe(true)
47+
if (image.compressed) {
48+
expect(image.fileName, 'not to equal archive name').not.toEqual(image.archiveFileName)
49+
expect(image.archiveFileName, 'archive to be in xz format').toContain('.xz')
50+
expect(image.archiveUrl, 'archive url to be in xz format').toContain('.xz')
51+
}
4552
} else {
46-
// post AGNOS 11 assumption
47-
expect(image.sparse, 'system image to not be sparse').toBe(false)
53+
expect(image.compressed, 'image to be compressed').toBe(true)
54+
expect(image.archiveFileName, 'archive to be in xz format').toContain('.xz')
55+
expect(image.archiveUrl, 'archive url to be in xz format').toContain('.xz')
4856
}
49-
}
57+
})
5058

5159
test('image and checksum', async () => {
5260
const imageWorkerFileHandler = {

0 commit comments

Comments
 (0)