Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
Run KafkaSource smokes in upgrade test
Browse files Browse the repository at this point in the history
  • Loading branch information
cardil committed Apr 8, 2021
1 parent bc84841 commit 2fae962
Show file tree
Hide file tree
Showing 22 changed files with 687 additions and 442 deletions.
38 changes: 33 additions & 5 deletions test/e2e-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,40 @@ function install_consolidated_channel_crds {
wait_until_pods_running "${SYSTEM_NAMESPACE}"
}

function install_released_consolidated_source {
install_consolidated_sources_crds latest-release
}

function install_head_consolidated_source {
install_consolidated_sources_crds HEAD
}

function install_consolidated_sources_crds() {
echo "Installing consolidated Kafka Source CRD"
rm -rf "${KAFKA_SOURCE_CRD_CONFIG_DIR}" && mkdir -p "${KAFKA_SOURCE_CRD_CONFIG_DIR}"
cp "${KAFKA_SOURCE_TEMPLATE_DIR}/"*yaml "${KAFKA_SOURCE_CRD_CONFIG_DIR}"
sed -i "s/namespace: knative-eventing/namespace: ${SYSTEM_NAMESPACE}/g" "${KAFKA_SOURCE_CRD_CONFIG_DIR}/"*yaml
ko apply -f "${KAFKA_SOURCE_CRD_CONFIG_DIR}" || return 1
local source url ver release_yaml
source="${1:-HEAD}"
if [[ "${source}" == 'HEAD' ]]; then
echo "Installing consolidated Kafka Source CRD (from HEAD)"
rm -rf "${KAFKA_SOURCE_CRD_CONFIG_DIR}" && mkdir -p "${KAFKA_SOURCE_CRD_CONFIG_DIR}"
cp "${KAFKA_SOURCE_TEMPLATE_DIR}/"*yaml "${KAFKA_SOURCE_CRD_CONFIG_DIR}"
sed -i "s/namespace: knative-eventing/namespace: ${SYSTEM_NAMESPACE}/g" "${KAFKA_SOURCE_CRD_CONFIG_DIR}/"*yaml
ko apply -f "${KAFKA_SOURCE_CRD_CONFIG_DIR}" || return $?
elif [[ "${source}" == 'latest-release' ]]; then
ver="${LATEST_RELEASE_VERSION}"
echo "Installing consolidated Kafka Source CRD (from latest release: ${ver})"
# Download the latest release of Knative Eventing Kafka.
url="${EVENTING_KAFKA_REPO}/releases/download/${ver}/source.yaml"
release_yaml="${ARTIFACTS}/source-${ver}.yaml"

curl -Lo "${release_yaml}" "${url}"
sed -i "s/namespace: knative-eventing/namespace: ${SYSTEM_NAMESPACE}/g" \
"${release_yaml}"
echo "Applying: ${release_yaml}"
kubectl apply -f "${release_yaml}"
else
fail_test "Unsupported source of installation: ${source}"
return 56
fi

run_postinstall_jobs
wait_until_pods_running "${EVENTING_NAMESPACE}" || fail_test "Failed to install the consolidated Kafka Source CRD"
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e-upgrade-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ TIMEOUT=${TIMEOUT:-60m}
GO_TEST_VERBOSITY="${GO_TEST_VERBOSITY:-standard-verbose}"

go_test_e2e -v \
-tags=upgrade \
-tags=upgrade,source \
-timeout="${TIMEOUT}" \
./test/upgrade \
|| fail_test
Expand Down
Loading

0 comments on commit 2fae962

Please sign in to comment.