Update metadata

This commit is contained in:
Imran Ismail
2019-09-05 12:08:20 +08:00
parent 6e5c237523
commit 56c04146d7
1454 changed files with 204046 additions and 234789 deletions

View File

@@ -11,7 +11,7 @@ process.env['RUNNER_TEMP'] = tempDir;
import * as installer from '../src/installer';
const IS_WINDOWS = process.platform === 'win32';
const IS_WINDOWS = os.platform() === 'win32';
describe('installer tests', () => {
beforeAll(async () => {
@@ -24,9 +24,9 @@ describe('installer tests', () => {
await io.rmRF(tempDir);
}, 100000);
it('Acquires version of kustomize if no matching version is installed', async () => {
await installer.getKustomize('3.1.0');
const kustomizeDir = path.join(toolDir, 'kustomize', '3.1.0', os.arch());
it('Acquires kustomize version 3.2.0 successfully', async () => {
await installer.getKustomize('3.2.0');
const kustomizeDir = path.join(toolDir, 'kustomize', '3.2.0', os.arch());
expect(fs.existsSync(`${kustomizeDir}.complete`)).toBe(true);
@@ -37,6 +37,32 @@ describe('installer tests', () => {
}
}, 100000);
it ('Acquires kustomize version 3.2.1 successfully', async () => {
await installer.getKustomize('3.2.1');
const kustomizeDir = path.join(toolDir, 'kustomize', '3.2.1', os.arch());
expect(fs.existsSync(`${kustomizeDir}.complete`)).toBe(true);
if (IS_WINDOWS) {
expect(fs.existsSync(path.join(kustomizeDir, 'kustomize.exe'))).toBe(true);
} else {
expect(fs.existsSync(path.join(kustomizeDir, 'kustomize'))).toBe(true);
}
}, 100000)
it ('Acquires kustomize version 3.3.0 successfully', async () => {
await installer.getKustomize('3.3.0');
const kustomizeDir = path.join(toolDir, 'kustomize', '3.3.0', os.arch());
expect(fs.existsSync(`${kustomizeDir}.complete`)).toBe(true);
if (IS_WINDOWS) {
expect(fs.existsSync(path.join(kustomizeDir, 'kustomize.exe'))).toBe(true);
} else {
expect(fs.existsSync(path.join(kustomizeDir, 'kustomize'))).toBe(true);
}
}, 100000)
it('Throws if no location contains correct kustomize version', async () => {
let thrown = false;
@@ -45,6 +71,7 @@ describe('installer tests', () => {
} catch {
thrown = true;
}
expect(thrown).toBe(true);
});
@@ -60,33 +87,15 @@ describe('installer tests', () => {
return;
});
it('Doesnt use version of kustomize that was only partially installed in cache', async () => {
const kustomizeDir: string = path.join(toolDir, 'kustomize', '3.3.0', os.arch());
await io.mkdirP(kustomizeDir);
let thrown = false;
try {
await installer.getKustomize('3.3.0');
} catch {
thrown = true;
}
expect(thrown).toBe(true);
return;
});
it('Resolves semantic versions of kustomize installed in cache', async () => {
const kustomizeDir: string = path.join(toolDir, 'kustomize', '3.4.0', os.arch());
const kustomizeDir: string = path.join(toolDir, 'kustomize', '3.0.0', os.arch());
await io.mkdirP(kustomizeDir);
fs.writeFileSync(`${kustomizeDir}.complete`, 'hello');
await installer.getKustomize('3.4.0');
await installer.getKustomize('3');
await installer.getKustomize('3.x');
await installer.getKustomize('3.0.0');
// await installer.getKustomize('3.0');
await installer.getKustomize('3.0');
});
});