Fixing label values of workflow names with spaces (#134)

This commit is contained in:
Koushik Dey
2021-05-05 15:55:02 +05:30
committed by GitHub
parent d332939666
commit ac49626466
3 changed files with 11 additions and 8 deletions
+3 -3
View File
@@ -436,9 +436,9 @@ test("deployment - deploy() - Annotate & label resources", async () => {
});
test("deployment - deploy() - Annotate & label resources for a new workflow", async () => {
process.env.GITHUB_WORKFLOW = '.github/workflows/NewWorkflow.yml';
process.env.GITHUB_WORKFLOW = '.github/workflows/New Workflow.yml';
let deploymentConfig: utility.DeploymentConfig = { manifestFilePaths: ['manifests/deployment.yaml'], helmChartFilePaths: [], dockerfilePaths: {} }
let annotationKeyValStr = getWorkflowAnnotationKeyLabel(process.env.GITHUB_WORKFLOW) + '=' + getWorkflowAnnotationsJson('NA', '.github/workflows/NewWorkflow.yml', deploymentConfig);
let annotationKeyValStr = getWorkflowAnnotationKeyLabel(process.env.GITHUB_WORKFLOW) + '=' + getWorkflowAnnotationsJson('NA', '.github/workflows/New Workflow.yml', deploymentConfig);
const KubernetesManifestUtilityMock = mocked(KubernetesManifestUtility, true);
KubernetesManifestUtilityMock.checkManifestStability = jest.fn().mockReturnValue("");
const KubernetesObjectUtilityMock = mocked(KubernetesObjectUtility, true);
@@ -464,7 +464,7 @@ test("deployment - deploy() - Annotate & label resources for a new workflow", as
expect(kubeCtl.annotateFiles).toBeCalledWith(["~/Deployment_testapp_currentTimestamp/deployment.yaml"], annotationKeyValStr);
expect(kubeCtl.annotate).toBeCalledTimes(2);
expect(kubeCtl.labelFiles).toBeCalledWith(["~/Deployment_testapp_currentTimestamp/deployment.yaml"],
[`workflowFriendlyName=NewWorkflow.yml`, `workflow=${getWorkflowAnnotationKeyLabel(process.env.GITHUB_WORKFLOW)}`]);
[`workflowFriendlyName=New_Workflow.yml`, `workflow=${getWorkflowAnnotationKeyLabel(process.env.GITHUB_WORKFLOW)}`]);
});
test("deployment - deploy() - Annotate resources failed", async () => {