Test custom secret setup correctly
parent
7e6d0f430f
commit
50173aa1e8
|
|
@ -8,6 +8,8 @@ describe('Cloud Runner', () => {
|
||||||
it('responds', () => {});
|
it('responds', () => {});
|
||||||
});
|
});
|
||||||
describe('Cloud Runner', () => {
|
describe('Cloud Runner', () => {
|
||||||
|
const testSecretName = 'testSecretName';
|
||||||
|
const testSecretValue = 'testSecretValue';
|
||||||
Input.cliOptions = {
|
Input.cliOptions = {
|
||||||
versioning: 'None',
|
versioning: 'None',
|
||||||
projectPath: 'test-project',
|
projectPath: 'test-project',
|
||||||
|
|
@ -16,8 +18,8 @@ describe('Cloud Runner', () => {
|
||||||
image: 'alpine'
|
image: 'alpine'
|
||||||
commands: ['printenv']
|
commands: ['printenv']
|
||||||
secrets:
|
secrets:
|
||||||
- name: 'testCustomSecret'
|
- name: '${testSecretName}'
|
||||||
value: 'VALUEXXX'
|
value: '${testSecretValue}'
|
||||||
`,
|
`,
|
||||||
};
|
};
|
||||||
Input.githubEnabled = false;
|
Input.githubEnabled = false;
|
||||||
|
|
@ -29,6 +31,7 @@ describe('Cloud Runner', () => {
|
||||||
await CloudRunner.run(buildParameter, baseImage.toString());
|
await CloudRunner.run(buildParameter, baseImage.toString());
|
||||||
const file = fs.readFileSync(`${CloudRunnerState.buildGuid}-outputfile.txt`, 'utf-8').toString();
|
const file = fs.readFileSync(`${CloudRunnerState.buildGuid}-outputfile.txt`, 'utf-8').toString();
|
||||||
expect(file).toContain(JSON.stringify(buildParameter));
|
expect(file).toContain(JSON.stringify(buildParameter));
|
||||||
|
expect(file).toContain(`${testSecretName}=${testSecretValue}`);
|
||||||
const inputKeys = Object.getOwnPropertyNames(Input);
|
const inputKeys = Object.getOwnPropertyNames(Input);
|
||||||
for (const element of inputKeys) {
|
for (const element of inputKeys) {
|
||||||
if (Input[element] !== undefined && typeof Input[element] != 'function') {
|
if (Input[element] !== undefined && typeof Input[element] != 'function') {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue