diff --git a/spec/hack/build-acceptable-bundles_spec.sh b/spec/hack/build-acceptable-bundles_spec.sh deleted file mode 100644 index 75b2de7692..0000000000 --- a/spec/hack/build-acceptable-bundles_spec.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/opt/homebrew/bin/bash - -eval "$(shellspec - -c) exit 1" - -Describe 'Testing build-acceptable-bundles.sh' - - BeforeEach 'setup' - AfterEach 'cleanup' - - setup() { - echo "quay.io/konflux-ci/image1:0.1-1234@sha256:abcd1234" > test_input.txt - echo "quay.io/konflux-ci/image2:0.1-1234@sha256:abcd1234" >> test_input.txt - echo "quay.io/konflux-ci/image3:0.1-1234@sha256:abcd1234" >> test_input.txt - echo "quay.io/konflux-ci/image1:task-0.1-1234" >> test_input.txt - - export GIT_URL="https://my-url/org/repo" - export REVISION="abcd1234" - export DATA_BUNDLE_REPO="quay.io/konflux-ci/tekton-catalog/data-acceptable-bundles" - export OUTPUT_TASK_BUNDLE_LIST="test_output.csv" - } - - cleanup() { - rm -f test_input.txt test_output.csv - } - - Mock git - echo "task/task1/task1.yaml\ntask/task2/task2.yaml" - End - - Mock ec - End - - Mock skopeo - End - - It 'processes the bundles and generates the correct output file' - When call hack/build-acceptable-bundles.sh test_input.txt - The status should be success - The path test_output.csv should be file - The contents of file "test_output.csv" should equal "quay.io/konflux-ci/image1:0.1-1234@sha256:abcd1234,quay.io/konflux-ci/image1:0.1 -quay.io/konflux-ci/image2:0.1-1234@sha256:abcd1234,quay.io/konflux-ci/image2:0.1 -quay.io/konflux-ci/image3:0.1-1234@sha256:abcd1234,quay.io/konflux-ci/image3:0.1 -quay.io/konflux-ci/image1:task-0.1-1234,quay.io/konflux-ci/image1:task-0.1" - End - - It 'checks the correct BUNDLES output' - When call hack/build-acceptable-bundles.sh test_input.txt - The status should be success - The stdout should include "Bundles to be added:" - The stdout should include "quay.io/konflux-ci/image1:0.1" - The stdout should include "quay.io/konflux-ci/image2:0.1" - The stdout should include "quay.io/konflux-ci/image3:0.1" - End -End diff --git a/spec/hack/build-and-push_spec.sh b/spec/hack/build-and-push_spec.sh deleted file mode 100755 index db78b5d063..0000000000 --- a/spec/hack/build-and-push_spec.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/opt/homebrew/bin/bash - -set -o errexit -set -o pipefail -set -o nounset - -eval "$(shellspec - -c) exit 1" - -check_lines() { - while read -r line; do - if [[ "$line" == quay.io/* ]] && [[ ! "$line" =~ ([0-9]+\.[0-9]-1234)?@sha256:5678$ ]]; then - return 1 - fi - done -} - -Describe "push to registry" - It "pushes tekton bundles on push" - - Mock skopeo - # Make the skopeo inspect command fail - if [ "$1" = "inspect" ]; then - return 1 - fi - End - - Mock tkn - echo "${5}@sha256:5678" - End - - Mock sha256sum - echo "1234" - End - - Mock git - echo "1234" - End - - export QUAY_NAMESPACE=konflux-ci - export SKIP_BUILD=true - - When call "hack/build-and-push.sh" - # each task and pipeline bundle ends with file checksum @ digest - The output should satisfy check_lines - End -End diff --git a/spec/hack/bundles_spec.sh b/spec/hack/bundles_spec.sh index 5ee5cc1fb1..3fe2a2925d 100644 --- a/spec/hack/bundles_spec.sh +++ b/spec/hack/bundles_spec.sh @@ -1,4 +1,5 @@ #!/bin/bash +# this spec file tests creating Tekton bundles and the acceptable bundles list set -o errexit set -o pipefail @@ -62,11 +63,13 @@ Describe "Creating new acceptable bundles" export SKIP_BUILD=true When call "hack/build-and-push.sh" + The status should be success # each task and pipeline bundle ends with file checksum @ digest The output should satisfy check_tkn_push_url End It 'processes the bundles and generates the correct output file' + # this is only used for the task_records var which is unused in this test Mock git echo "task/task1/task1.yaml\ntask/task2/task2.yaml" End @@ -89,6 +92,7 @@ quay.io/konflux-ci/task-task2:0.1-1234@sha256:5678,quay.io/konflux-ci/task-task2 It "copies to the right image locations" export OUTPUT_TASK_BUNDLE_LIST="test-task-bundle-list.csv" When call "hack/push-and-tag.sh" + The status should be success The output should include "Copying from quay.io/konflux-ci/task-task1:0.1-1234@sha256:5678 to quay.io/konflux-ci/task-task1:0.1" The output should include "Copying from quay.io/konflux-ci/task-task2:0.1-1234@sha256:5678 to quay.io/konflux-ci/task-task2:0.1" End diff --git a/spec/hack/push-and-tag_spec.sh b/spec/hack/push-and-tag_spec.sh deleted file mode 100644 index 6bf9382688..0000000000 --- a/spec/hack/push-and-tag_spec.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/opt/homebrew/bin/bash - -set -o errexit -set -o pipefail -set -o nounset - -eval "$(shellspec - -c) exit 1" - -Describe "push to registry" - create_test_data() { - cat < task-bundle-list -quay.io/konflux-ci/bundles:0.1-1234@sha256:5678,quay.io/konflux-ci/bundles:0.1 -quay.io/konflux-ci/bundles:1.0-abcdef@sha256:1234abcd5678,quay.io/konflux-ci/bundles:1.0 -EOF -} - BeforeEach 'create_test_data' - It "copies to the right image locations" - - Mock skopeo - End - - When call "hack/push-and-tag.sh" - The output should include "Copying from quay.io/konflux-ci/bundles:0.1-1234@sha256:5678 to quay.io/konflux-ci/bundles:0.1" - The output should include "Copying from quay.io/konflux-ci/bundles:1.0-abcdef@sha256:1234abcd5678 to quay.io/konflux-ci/bundles:1.0" - End -End \ No newline at end of file