Custom step file support
parent
a807b8dff6
commit
5cc23daf7c
|
|
@ -4460,10 +4460,11 @@ class CloudRunnerCustomSteps {
|
|||
});
|
||||
}
|
||||
static ParseSteps(steps) {
|
||||
var _a;
|
||||
if (steps === '') {
|
||||
return [];
|
||||
}
|
||||
if (cloud_runner_1.default.buildParameters.cloudRunnerIntegrationTests) {
|
||||
if ((_a = cloud_runner_1.default.buildParameters) === null || _a === void 0 ? void 0 : _a.cloudRunnerIntegrationTests) {
|
||||
cloud_runner_logger_1.default.log(`Parsing build steps: ${steps}`);
|
||||
}
|
||||
const isArray = steps[0] === `-`;
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -48,7 +48,7 @@ export class CloudRunnerCustomSteps {
|
|||
if (steps === '') {
|
||||
return [];
|
||||
}
|
||||
if (CloudRunner.buildParameters.cloudRunnerIntegrationTests) {
|
||||
if (CloudRunner.buildParameters?.cloudRunnerIntegrationTests) {
|
||||
CloudRunnerLogger.log(`Parsing build steps: ${steps}`);
|
||||
}
|
||||
const isArray = steps[0] === `-`;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,15 @@ describe('Cloud Runner Custom Hooks', () => {
|
|||
it('Responds', () => {});
|
||||
setups();
|
||||
it('Check for pre and post custom hooks run contents', async () => {
|
||||
CloudRunnerLogger.log(JSON.stringify(CloudRunnerCustomSteps.GetCustomStepsFromFiles(`before`), undefined, 4));
|
||||
const yamlString = `hook: before
|
||||
commands: echo "test"`;
|
||||
const stringObject = CloudRunnerCustomSteps.ParseSteps(yamlString);
|
||||
const getCustomStepsFromFiles = CloudRunnerCustomSteps.GetCustomStepsFromFiles(`before`);
|
||||
CloudRunnerLogger.log(yamlString);
|
||||
CloudRunnerLogger.log(JSON.stringify(stringObject, undefined, 4));
|
||||
CloudRunnerLogger.log(JSON.stringify(getCustomStepsFromFiles, undefined, 4));
|
||||
expect(stringObject.length).toBe(1);
|
||||
expect(stringObject[0].hook).toBe(`before`);
|
||||
});
|
||||
if (CloudRunnerOptions.cloudRunnerTests && CloudRunnerOptions.cloudRunnerCluster !== `k8s`) {
|
||||
it('Check for pre and post custom hooks run contents', async () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue