Skip to content

Commit b63b1af

Browse files
Aneesh-M-Bhatsavitaashture
authored andcommitted
tests are all good now & release changes
1 parent f508a22 commit b63b1af

File tree

4 files changed

+38
-20
lines changed

4 files changed

+38
-20
lines changed

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ prepare-release:
5555
hack/release.sh $(RELEASE_DIR)
5656

5757
.PHONY: release
58-
release: prepare-release
58+
release: ${CATALOGCD} prepare-release
5959
pushd ${RELEASE_DIR} && \
6060
$(CATALOGCD) release \
6161
--output release \
@@ -97,6 +97,14 @@ test-integration:
9797
test-e2e: install
9898
$(BATS_CORE) $(BATS_FLAGS) $(ARGS) $(E2E_TESTS)
9999

100+
.PHONY: test-e2e-git-clone
101+
test-e2e-git-clone: E2E_TESTS=./test/e2e/*clone.bats
102+
test-e2e-git-clone: test-e2e
103+
104+
.PHONY: test-e2e-git-cli
105+
test-e2e-git-cli: E2E_TESTS=./test/e2e/*cli.bats
106+
test-e2e-git-cli: test-e2e
107+
100108
# Run all the end-to-end tests against the current openshift context.
101109
# It is used mainly by the CI and ideally shouldn't differ that much from test-e2e
102110
.PHONY: prepare-e2e-openshift

hack/release.sh

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,32 @@ release() {
4242
[[ ! -d "${RELEASE_DIR}" ]] &&
4343
panic "Release dir is not found '${RELEASE_DIR}'!"
4444

45-
# releasing task-git (it's the only task)
46-
# See task-containers if there is more than one task to support.
47-
declare task_name=task-git
48-
declare task_doc=README.md
49-
declare task_dir="${RELEASE_DIR}/tasks/${task_name}"
50-
[[ ! -d "${task_dir}" ]] &&
51-
mkdir -p "${task_dir}"
45+
# releasing all task templates using the following glob expression
46+
for t in $(ls -1 templates/task-*.yaml); do
47+
declare task_name=$(extract_name ${t})
48+
[[ -z "${task_name}" ]] &&
49+
panic "Unable to extract Task name from '${t}'!"
5250

53-
# rendering the helm template for the specific file, using the resource name for the
54-
# filename respectively
55-
echo "# Rendering '${task_name}' at '${task_dir}'..."
56-
helm template . >${task_dir}/${task_name}.yaml ||
57-
panic "Unable to render '${task_name}'!"
51+
declare task_doc="$(find_doc ${task_name})"
52+
[[ -z "${task_doc}" ]] &&
53+
panic "Unable to find documentation file for '${task_name}'!"
5854

59-
# finds the respective documentation file copying as "README.md", on the same
60-
# directory where the respective task is located
61-
echo "# Copying '${task_name}' documentation file '${task_doc}'..."
62-
cp -v -f ${task_doc} "${task_dir}/README.md" ||
63-
panic "Unable to copy '${task_doc}' into '${task_dir}'"
55+
declare task_dir="${RELEASE_DIR}/tasks/${task_name}"
56+
[[ ! -d "${task_dir}" ]] &&
57+
mkdir -p "${task_dir}"
58+
59+
# rendering the helm template for the specific file, using the resource name for the
60+
# filename respectively
61+
echo "# Rendering '${task_name}' at '${task_dir}'..."
62+
helm template --show-only=${t} . >${task_dir}/${task_name}.yaml ||
63+
panic "Unable to render '${t}'!"
64+
65+
# finds the respective documentation file copying as "README.md", on the same
66+
# directory where the respective task is located
67+
echo "# Copying '${task_name}' documentation file '${task_doc}'..."
68+
cp -v -f ${task_doc} "${task_dir}/README.md" ||
69+
panic "Unable to copy '${task_doc}' into '${task_dir}'"
70+
done
6471
}
6572

6673
release

test/e2e/e2e-git-cli.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ source ./test/helper/helper.sh
1818
sleep 30
1919

2020
# assering the taskrun status, making sure all steps have been successful
21-
assert_tekton_resource "taskrun" --regexp $'\S+.\nCOMMIT=6c073b08f7987018cbb2cb9a5747c84913b3608e'
21+
assert_tekton_resource "taskrun" --regexp $'\S+\nCOMMIT=6c073b08f7987018cbb2cb9a5747c84913b3608e'
2222
assert_tekton_resource "pipelinerun" --partial '(Failed: 0, Cancelled 0), Skipped: 0'
2323
}

test/e2e/e2e-git-clone.bats

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ source ./test/helper/helper.sh
1818
--showlog >&3
1919
assert_success
2020

21+
# waiting a few seconds before asserting results
22+
sleep 30
23+
2124
#
2225
# Asserting Results
2326
#
2427

25-
assert_tekton_resource "taskrun" --regexp $'\S+.\nCOMMIT=\S+.\nCOMMITTER_DATE=\S+.\nURL=\S+*'
28+
assert_tekton_resource "taskrun" --regexp $'\S+\nCOMMIT=\S+\nCOMMITTER_DATE=\S+\nURL=\S+'
2629
}

0 commit comments

Comments
 (0)