diff --git a/tasks/internal/update-fbc-catalog-task/tests/test-update-fbc-catalog-error.yaml b/tasks/internal/update-fbc-catalog-task/tests/test-update-fbc-catalog-error.yaml index 86d38192d..db71b5661 100644 --- a/tasks/internal/update-fbc-catalog-task/tests/test-update-fbc-catalog-error.yaml +++ b/tasks/internal/update-fbc-catalog-task/tests/test-update-fbc-catalog-error.yaml @@ -4,7 +4,7 @@ kind: Pipeline metadata: name: test-update-fbc-catalog-error spec: - description: Test + description: Tests a production FBC release, but in a failure scenario tasks: - name: run-task taskRef: @@ -22,8 +22,6 @@ spec: value: "[]" - name: iibServiceAccountSecret value: "iib-service-account-secret" - - name: subdirectory - value: $(context.pipelineRun.uid) - name: check-result params: - name: jsonBuildInfo @@ -66,14 +64,18 @@ spec: exit 1 fi - # shellcheck disable=SC2046 + # shellcheck disable=SC2046 # (warning): Quote this to prevent word splitting + # reason: wrapping the tekton parameters in the following line with double quotes is adding unwanted + # quotes to the contained json, breaking jq. state="$(jq -cr '.state' <<< $(params.buildState))" if [ "$state" != "failed" ]; then echo "The task did not save a completed IIB build in buildState result" exit 1 fi - # shellcheck disable=SC2046 + # shellcheck disable=SC2046 # (warning): Quote this to prevent word splitting + # reason: wrapping the tekton parameters in the following line with double quotes is adding unwanted + # quotes to the contained json, breaking jq. genericResult=$(jq -r \ '. |[.fbc_opt_in, .overwrite_fromindex_image, .publish_index_image,.sign_index_image] |@csv' \ <<< $(params.genericResult)) diff --git a/tasks/internal/update-fbc-catalog-task/tests/test-update-fbc-catalog-hotfix.yaml b/tasks/internal/update-fbc-catalog-task/tests/test-update-fbc-catalog-hotfix.yaml index a74d85e36..e58461821 100644 --- a/tasks/internal/update-fbc-catalog-task/tests/test-update-fbc-catalog-hotfix.yaml +++ b/tasks/internal/update-fbc-catalog-task/tests/test-update-fbc-catalog-hotfix.yaml @@ -4,7 +4,7 @@ kind: Pipeline metadata: name: test-update-fbc-catalog-hotfix spec: - description: Test + description: Tests a hotfix FBC release tasks: - name: run-task taskRef: @@ -24,8 +24,6 @@ spec: value: "iib-service-account-secret" - name: hotfix value: true - - name: subdirectory - value: $(context.pipelineRun.uid) - name: check-result params: - name: jsonBuildInfo @@ -68,7 +66,9 @@ spec: exit 1 fi - # shellcheck disable=SC2046 + # shellcheck disable=SC2046 # (warning): Quote this to prevent word splitting + # reason: wrapping the tekton parameters in the following line with double quotes is adding unwanted + # quotes to the contained json, breaking jq. state="$(jq -cr '.state' <<< $(params.buildState))" if [ "$state" != "complete" ]; then echo "The task did not save a completed IIB build in buildState result" @@ -86,7 +86,9 @@ spec: exit 1 fi - # shellcheck disable=SC2046 + # shellcheck disable=SC2046 # (warning): Quote this to prevent word splitting + # reason: wrapping the tekton parameters in the following line with double quotes is adding unwanted + # quotes to the contained json, breaking jq. genericResult=$(jq -r \ '. |[.fbc_opt_in, .overwrite_fromindex_image, .publish_index_image, .sign_index_image] |@csv' \ <<< $(params.genericResult)) diff --git a/tasks/internal/update-fbc-catalog-task/tests/test-update-fbc-catalog-default.yaml b/tasks/internal/update-fbc-catalog-task/tests/test-update-fbc-catalog-prod.yaml similarity index 84% rename from tasks/internal/update-fbc-catalog-task/tests/test-update-fbc-catalog-default.yaml rename to tasks/internal/update-fbc-catalog-task/tests/test-update-fbc-catalog-prod.yaml index 51cf97661..ae7c8ae07 100644 --- a/tasks/internal/update-fbc-catalog-task/tests/test-update-fbc-catalog-default.yaml +++ b/tasks/internal/update-fbc-catalog-task/tests/test-update-fbc-catalog-prod.yaml @@ -2,9 +2,9 @@ apiVersion: tekton.dev/v1 kind: Pipeline metadata: - name: test-update-fbc-catalog-default + name: test-update-fbc-catalog-prod spec: - description: Test + description: Tests a production FBC release tasks: - name: run-task taskRef: @@ -22,8 +22,6 @@ spec: value: "[]" - name: iibServiceAccountSecret value: "iib-service-account-secret" - - name: subdirectory - value: $(context.pipelineRun.uid) - name: check-result params: - name: jsonBuildInfo @@ -66,14 +64,18 @@ spec: exit 1 fi - # shellcheck disable=SC2046 + # shellcheck disable=SC2046 # (warning): Quote this to prevent word splitting + # reason: wrapping the tekton parameters in the following line with double quotes is adding unwanted + # quotes to the contained json, breaking jq. state="$(jq -cr '.state' <<< $(params.buildState))" if [ "$state" != "complete" ]; then echo "The task did not save a completed IIB build in buildState result" exit 1 fi - # shellcheck disable=SC2046 + # shellcheck disable=SC2046 # (warning): Quote this to prevent word splitting + # reason: wrapping the tekton parameters in the following line with double quotes is adding unwanted + # quotes to the contained json, breaking jq. genericResult=$(jq -r \ '. |[.fbc_opt_in, .overwrite_fromindex_image, .publish_index_image,.sign_index_image] |@csv' \ <<< $(params.genericResult)) diff --git a/tasks/internal/update-fbc-catalog-task/tests/test-update-fbc-catalog-staged-index.yaml b/tasks/internal/update-fbc-catalog-task/tests/test-update-fbc-catalog-staged-index.yaml index 4ea2a6af3..a631ed811 100644 --- a/tasks/internal/update-fbc-catalog-task/tests/test-update-fbc-catalog-staged-index.yaml +++ b/tasks/internal/update-fbc-catalog-task/tests/test-update-fbc-catalog-staged-index.yaml @@ -4,7 +4,7 @@ kind: Pipeline metadata: name: test-update-fbc-catalog-staged-index spec: - description: Test + description: Tests a stage FBC release tasks: - name: run-task taskRef: @@ -24,8 +24,6 @@ spec: value: "iib-service-account-secret" - name: stagedIndex value: true - - name: subdirectory - value: $(context.pipelineRun.uid) - name: check-result params: - name: jsonBuildInfo @@ -68,14 +66,18 @@ spec: exit 1 fi - # shellcheck disable=SC2046 + # shellcheck disable=SC2046 # (warning): Quote this to prevent word splitting + # reason: wrapping the tekton parameters in the following line with double quotes is adding unwanted + # quotes to the contained json, breaking jq. state="$(jq -cr '.state' <<< $(params.buildState))" if [ "$state" != "complete" ]; then echo "The task did not save a completed IIB build in buildState result" exit 1 fi - # shellcheck disable=SC2046 + # shellcheck disable=SC2046 # (warning): Quote this to prevent word splitting + # reason: wrapping the tekton parameters in the following line with double quotes is adding unwanted + # quotes to the contained json, breaking jq. genericResult=$(jq -r \ '. |[.fbc_opt_in, .overwrite_fromindex_image, .publish_index_image,.sign_index_image] |@csv' \ <<< $(params.genericResult)) diff --git a/tasks/internal/update-fbc-catalog-task/tests/test-update-fbc-catalog-timeout.yaml b/tasks/internal/update-fbc-catalog-task/tests/test-update-fbc-catalog-timeout.yaml index 0731c2f31..42e888a71 100644 --- a/tasks/internal/update-fbc-catalog-task/tests/test-update-fbc-catalog-timeout.yaml +++ b/tasks/internal/update-fbc-catalog-task/tests/test-update-fbc-catalog-timeout.yaml @@ -4,7 +4,7 @@ kind: Pipeline metadata: name: test-update-fbc-catalog-timeout spec: - description: Test + description: Test a timed out FBC release tasks: - name: run-task taskRef: @@ -22,8 +22,6 @@ spec: value: "[]" - name: iibServiceAccountSecret value: "iib-service-account-secret" - - name: subdirectory - value: $(context.pipelineRun.uid) - name: buildTimeoutSeconds value: 1 - name: check-result