Merge pull request #676 from crazy-max/test-fix-timeout
test: set proper timeout when downloading binaries
This commit is contained in:
@@ -37,19 +37,17 @@ describe('download', () => {
|
|||||||
['latest', true]
|
['latest', true]
|
||||||
])(
|
])(
|
||||||
'acquires %p of buildx (standalone: %p)', async (version, standalone) => {
|
'acquires %p of buildx (standalone: %p)', async (version, standalone) => {
|
||||||
const install = new Install({standalone: standalone});
|
const install = new Install({standalone: standalone});
|
||||||
const toolPath = await install.download(version);
|
const toolPath = await install.download(version);
|
||||||
expect(fs.existsSync(toolPath)).toBe(true);
|
expect(fs.existsSync(toolPath)).toBe(true);
|
||||||
let buildxBin: string;
|
let buildxBin: string;
|
||||||
if (standalone) {
|
if (standalone) {
|
||||||
buildxBin = await install.installStandalone(toolPath, tmpDir);
|
buildxBin = await install.installStandalone(toolPath, tmpDir);
|
||||||
} else {
|
} else {
|
||||||
buildxBin = await install.installPlugin(toolPath, tmpDir);
|
buildxBin = await install.installPlugin(toolPath, tmpDir);
|
||||||
}
|
}
|
||||||
expect(fs.existsSync(buildxBin)).toBe(true);
|
expect(fs.existsSync(buildxBin)).toBe(true);
|
||||||
},
|
}, 100000);
|
||||||
100000
|
|
||||||
);
|
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
test.each([
|
test.each([
|
||||||
@@ -57,26 +55,22 @@ describe('download', () => {
|
|||||||
['v0.9.0'],
|
['v0.9.0'],
|
||||||
['v0.10.5'],
|
['v0.10.5'],
|
||||||
])(
|
])(
|
||||||
'acquires %p of buildx with cache', async (version) => {
|
'acquires %p of buildx with cache', async (version) => {
|
||||||
const install = new Install({standalone: false});
|
const install = new Install({standalone: false});
|
||||||
const toolPath = await install.download(version);
|
const toolPath = await install.download(version);
|
||||||
expect(fs.existsSync(toolPath)).toBe(true);
|
expect(fs.existsSync(toolPath)).toBe(true);
|
||||||
},
|
}, 100000);
|
||||||
100000
|
|
||||||
);
|
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
test.each([
|
test.each([
|
||||||
['v0.11.2'],
|
['v0.11.2'],
|
||||||
['v0.12.0'],
|
['v0.12.0'],
|
||||||
])(
|
])(
|
||||||
'acquires %p of buildx without cache', async (version) => {
|
'acquires %p of buildx without cache', async (version) => {
|
||||||
const install = new Install({standalone: false});
|
const install = new Install({standalone: false});
|
||||||
const toolPath = await install.download(version, true);
|
const toolPath = await install.download(version, true);
|
||||||
expect(fs.existsSync(toolPath)).toBe(true);
|
expect(fs.existsSync(toolPath)).toBe(true);
|
||||||
},
|
}, 100000);
|
||||||
100000
|
|
||||||
);
|
|
||||||
|
|
||||||
// TODO: add tests for arm
|
// TODO: add tests for arm
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
@@ -90,15 +84,13 @@ describe('download', () => {
|
|||||||
['linux', 'ppc64'],
|
['linux', 'ppc64'],
|
||||||
['linux', 's390x'],
|
['linux', 's390x'],
|
||||||
])(
|
])(
|
||||||
'acquires buildx for %s/%s', async (os, arch) => {
|
'acquires buildx for %s/%s', async (os, arch) => {
|
||||||
jest.spyOn(osm, 'platform').mockImplementation(() => os as NodeJS.Platform);
|
jest.spyOn(osm, 'platform').mockImplementation(() => os as NodeJS.Platform);
|
||||||
jest.spyOn(osm, 'arch').mockImplementation(() => arch);
|
jest.spyOn(osm, 'arch').mockImplementation(() => arch);
|
||||||
const install = new Install();
|
const install = new Install();
|
||||||
const buildxBin = await install.download('latest');
|
const buildxBin = await install.download('latest');
|
||||||
expect(fs.existsSync(buildxBin)).toBe(true);
|
expect(fs.existsSync(buildxBin)).toBe(true);
|
||||||
},
|
}, 100000);
|
||||||
100000
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('build', () => {
|
describe('build', () => {
|
||||||
|
|||||||
@@ -36,20 +36,18 @@ describe('download', () => {
|
|||||||
['v2.32.4', true],
|
['v2.32.4', true],
|
||||||
['latest', true]
|
['latest', true]
|
||||||
])(
|
])(
|
||||||
'acquires %p of compose (standalone: %p)', async (version, standalone) => {
|
'acquires %p of compose (standalone: %p)', async (version, standalone) => {
|
||||||
const install = new Install({standalone: standalone});
|
const install = new Install({standalone: standalone});
|
||||||
const toolPath = await install.download(version);
|
const toolPath = await install.download(version);
|
||||||
expect(fs.existsSync(toolPath)).toBe(true);
|
expect(fs.existsSync(toolPath)).toBe(true);
|
||||||
let composeBin: string;
|
let composeBin: string;
|
||||||
if (standalone) {
|
if (standalone) {
|
||||||
composeBin = await install.installStandalone(toolPath, tmpDir);
|
composeBin = await install.installStandalone(toolPath, tmpDir);
|
||||||
} else {
|
} else {
|
||||||
composeBin = await install.installPlugin(toolPath, tmpDir);
|
composeBin = await install.installPlugin(toolPath, tmpDir);
|
||||||
}
|
}
|
||||||
expect(fs.existsSync(composeBin)).toBe(true);
|
expect(fs.existsSync(composeBin)).toBe(true);
|
||||||
},
|
}, 100000);
|
||||||
100000
|
|
||||||
);
|
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
test.each([
|
test.each([
|
||||||
@@ -57,26 +55,22 @@ describe('download', () => {
|
|||||||
['v2.31.0'],
|
['v2.31.0'],
|
||||||
['v2.32.4'],
|
['v2.32.4'],
|
||||||
])(
|
])(
|
||||||
'acquires %p of compose with cache', async (version) => {
|
'acquires %p of compose with cache', async (version) => {
|
||||||
const install = new Install({standalone: false});
|
const install = new Install({standalone: false});
|
||||||
const toolPath = await install.download(version);
|
const toolPath = await install.download(version);
|
||||||
expect(fs.existsSync(toolPath)).toBe(true);
|
expect(fs.existsSync(toolPath)).toBe(true);
|
||||||
},
|
}, 100000);
|
||||||
100000
|
|
||||||
);
|
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
test.each([
|
test.each([
|
||||||
['v2.27.1'],
|
['v2.27.1'],
|
||||||
['v2.28.0'],
|
['v2.28.0'],
|
||||||
])(
|
])(
|
||||||
'acquires %p of compose without cache', async (version) => {
|
'acquires %p of compose without cache', async (version) => {
|
||||||
const install = new Install({standalone: false});
|
const install = new Install({standalone: false});
|
||||||
const toolPath = await install.download(version, true);
|
const toolPath = await install.download(version, true);
|
||||||
expect(fs.existsSync(toolPath)).toBe(true);
|
expect(fs.existsSync(toolPath)).toBe(true);
|
||||||
},
|
}, 100000);
|
||||||
100000
|
|
||||||
);
|
|
||||||
|
|
||||||
// TODO: add tests for arm
|
// TODO: add tests for arm
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
@@ -90,15 +84,13 @@ describe('download', () => {
|
|||||||
['linux', 'ppc64'],
|
['linux', 'ppc64'],
|
||||||
['linux', 's390x'],
|
['linux', 's390x'],
|
||||||
])(
|
])(
|
||||||
'acquires compose for %s/%s', async (os, arch) => {
|
'acquires compose for %s/%s', async (os, arch) => {
|
||||||
jest.spyOn(osm, 'platform').mockImplementation(() => os as NodeJS.Platform);
|
jest.spyOn(osm, 'platform').mockImplementation(() => os as NodeJS.Platform);
|
||||||
jest.spyOn(osm, 'arch').mockImplementation(() => arch);
|
jest.spyOn(osm, 'arch').mockImplementation(() => arch);
|
||||||
const install = new Install();
|
const install = new Install();
|
||||||
const composeBin = await install.download('latest');
|
const composeBin = await install.download('latest');
|
||||||
expect(fs.existsSync(composeBin)).toBe(true);
|
expect(fs.existsSync(composeBin)).toBe(true);
|
||||||
},
|
}, 100000);
|
||||||
100000
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('getDownloadVersion', () => {
|
describe('getDownloadVersion', () => {
|
||||||
|
|||||||
@@ -36,14 +36,12 @@ describe('download', () => {
|
|||||||
['latest']
|
['latest']
|
||||||
])(
|
])(
|
||||||
'acquires %p of regclient', async (version) => {
|
'acquires %p of regclient', async (version) => {
|
||||||
const install = new Install();
|
const install = new Install();
|
||||||
const toolPath = await install.download(version);
|
const toolPath = await install.download(version);
|
||||||
expect(fs.existsSync(toolPath)).toBe(true);
|
expect(fs.existsSync(toolPath)).toBe(true);
|
||||||
const regclientBin = await install.install(toolPath, tmpDir);
|
const regclientBin = await install.install(toolPath, tmpDir);
|
||||||
expect(fs.existsSync(regclientBin)).toBe(true);
|
expect(fs.existsSync(regclientBin)).toBe(true);
|
||||||
},
|
}, 100000);
|
||||||
100000
|
|
||||||
);
|
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
test.each([
|
test.each([
|
||||||
@@ -54,7 +52,7 @@ describe('download', () => {
|
|||||||
const install = new Install();
|
const install = new Install();
|
||||||
const toolPath = await install.download(version);
|
const toolPath = await install.download(version);
|
||||||
expect(fs.existsSync(toolPath)).toBe(true);
|
expect(fs.existsSync(toolPath)).toBe(true);
|
||||||
});
|
}, 100000);
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
test.each([
|
test.each([
|
||||||
@@ -64,7 +62,7 @@ describe('download', () => {
|
|||||||
const install = new Install();
|
const install = new Install();
|
||||||
const toolPath = await install.download(version, true);
|
const toolPath = await install.download(version, true);
|
||||||
expect(fs.existsSync(toolPath)).toBe(true);
|
expect(fs.existsSync(toolPath)).toBe(true);
|
||||||
});
|
}, 100000);
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
test.each([
|
test.each([
|
||||||
@@ -77,14 +75,12 @@ describe('download', () => {
|
|||||||
['linux', 's390x'],
|
['linux', 's390x'],
|
||||||
])(
|
])(
|
||||||
'acquires regclient for %s/%s', async (os, arch) => {
|
'acquires regclient for %s/%s', async (os, arch) => {
|
||||||
jest.spyOn(osm, 'platform').mockImplementation(() => os as NodeJS.Platform);
|
jest.spyOn(osm, 'platform').mockImplementation(() => os as NodeJS.Platform);
|
||||||
jest.spyOn(osm, 'arch').mockImplementation(() => arch);
|
jest.spyOn(osm, 'arch').mockImplementation(() => arch);
|
||||||
const install = new Install();
|
const install = new Install();
|
||||||
const regclientBin = await install.download('latest');
|
const regclientBin = await install.download('latest');
|
||||||
expect(fs.existsSync(regclientBin)).toBe(true);
|
expect(fs.existsSync(regclientBin)).toBe(true);
|
||||||
},
|
}, 100000);
|
||||||
100000
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('getDownloadVersion', () => {
|
describe('getDownloadVersion', () => {
|
||||||
|
|||||||
@@ -37,14 +37,12 @@ describe('download', () => {
|
|||||||
['latest']
|
['latest']
|
||||||
])(
|
])(
|
||||||
'acquires %p of undock', async (version) => {
|
'acquires %p of undock', async (version) => {
|
||||||
const install = new Install();
|
const install = new Install();
|
||||||
const toolPath = await install.download(version);
|
const toolPath = await install.download(version);
|
||||||
expect(fs.existsSync(toolPath)).toBe(true);
|
expect(fs.existsSync(toolPath)).toBe(true);
|
||||||
const undockBin = await install.install(toolPath, tmpDir);
|
const undockBin = await install.install(toolPath, tmpDir);
|
||||||
expect(fs.existsSync(undockBin)).toBe(true);
|
expect(fs.existsSync(undockBin)).toBe(true);
|
||||||
},
|
}, 100000);
|
||||||
100000
|
|
||||||
);
|
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
test.each([
|
test.each([
|
||||||
@@ -56,7 +54,7 @@ describe('download', () => {
|
|||||||
const install = new Install();
|
const install = new Install();
|
||||||
const toolPath = await install.download(version);
|
const toolPath = await install.download(version);
|
||||||
expect(fs.existsSync(toolPath)).toBe(true);
|
expect(fs.existsSync(toolPath)).toBe(true);
|
||||||
});
|
}, 100000);
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
test.each([
|
test.each([
|
||||||
@@ -67,7 +65,7 @@ describe('download', () => {
|
|||||||
const install = new Install();
|
const install = new Install();
|
||||||
const toolPath = await install.download(version, true);
|
const toolPath = await install.download(version, true);
|
||||||
expect(fs.existsSync(toolPath)).toBe(true);
|
expect(fs.existsSync(toolPath)).toBe(true);
|
||||||
});
|
}, 100000);
|
||||||
|
|
||||||
// TODO: add tests for arm
|
// TODO: add tests for arm
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
@@ -82,14 +80,12 @@ describe('download', () => {
|
|||||||
['linux', 's390x'],
|
['linux', 's390x'],
|
||||||
])(
|
])(
|
||||||
'acquires undock for %s/%s', async (os, arch) => {
|
'acquires undock for %s/%s', async (os, arch) => {
|
||||||
jest.spyOn(osm, 'platform').mockImplementation(() => os as NodeJS.Platform);
|
jest.spyOn(osm, 'platform').mockImplementation(() => os as NodeJS.Platform);
|
||||||
jest.spyOn(osm, 'arch').mockImplementation(() => arch);
|
jest.spyOn(osm, 'arch').mockImplementation(() => arch);
|
||||||
const install = new Install();
|
const install = new Install();
|
||||||
const undockBin = await install.download('latest');
|
const undockBin = await install.download('latest');
|
||||||
expect(fs.existsSync(undockBin)).toBe(true);
|
expect(fs.existsSync(undockBin)).toBe(true);
|
||||||
},
|
}, 100000);
|
||||||
100000
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('getDownloadVersion', () => {
|
describe('getDownloadVersion', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user