Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run scenarios as presubmit tests #11801

Merged
merged 1 commit into from
Jun 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tests/e2e/kubetest2-kops/deployer/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,19 @@ func (d *deployer) verifyKopsFlags() error {
return errors.New("missing required --kops-binary-path when --kops-version-marker is not used")
}

// when we use a binary path, we want to use the corresponding nodeup et.al
if d.KopsBinaryPath != "" {
baseUrl := os.Getenv("KOPS_BASE_URL")
if baseUrl == "" {
stageLocation, err := defaultStageLocation(d.KopsRoot)
if err != nil {
return err
}
d.KopsBaseURL = strings.Replace(stageLocation, "gs://", "https://storage.googleapis.com/", 1)
}

}

switch d.CloudProvider {
case "aws":
case "gce":
Expand Down
3 changes: 1 addition & 2 deletions tests/e2e/scenarios/addon-resource-tracking/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ ${KUBETEST2} \
haveds

# Upgrade to a version that should adopt existing resources and apply the change below
KOPS_BASE_URL="$(curl -s https://storage.googleapis.com/kops-ci/bin/latest-ci-updown-green.txt)"
KOPS=$(kops-download-from-base)
KOPS=$(kops-acquire-latest)

cp "${KOPS}" "${WORKSPACE}/kops"

Expand Down
4 changes: 1 addition & 3 deletions tests/e2e/scenarios/aws-ebs-csi/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
REPO_ROOT=$(git rev-parse --show-toplevel);
source "${REPO_ROOT}"/tests/e2e/scenarios/lib/common.sh

export KOPS_BASE_URL
KOPS_BASE_URL="$(curl -s https://storage.googleapis.com/kops-ci/bin/latest-ci-updown-green.txt)"
KOPS=$(kops-download-from-base)
KOPS=$(kops-acquire-latest)

OVERRIDES="${OVERRIDES-} --override=cluster.spec.cloudConfig.awsEBSCSIDriver.enabled=true"
OVERRIDES="$OVERRIDES --override=cluster.spec.snapshotController.enabled=true"
Expand Down
21 changes: 16 additions & 5 deletions tests/e2e/scenarios/lib/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ set -o xtrace
echo "CLOUD_PROVIDER=${CLOUD_PROVIDER}"
echo "CLUSTER_NAME=${CLUSTER_NAME}"

if [[ -n "${KOPS_BASE_URL-}" ]]; then
unset KOPS_BASE_URL
fi

if [[ -z "${WORKSPACE-}" ]]; then
export WORKSPACE
WORKSPACE=$(mktemp -dt kops.XXXXXXXXX)
Expand Down Expand Up @@ -61,7 +57,7 @@ if [[ -z "${AWS_SSH_PUBLIC_KEY_FILE-}" ]]; then
export AWS_SSH_PUBLIC_KEY_FILE="${HOME}/.ssh/id_rsa.pub"
fi

KUBETEST2="kubetest2 kops -v=2 --cloud-provider=${CLOUD_PROVIDER} --cluster-name=${CLUSTER_NAME:-}"
KUBETEST2="kubetest2 kops -v=2 --cloud-provider=${CLOUD_PROVIDER} --cluster-name=${CLUSTER_NAME:-} --kops-root=${REPO_ROOT}"
KUBETEST2="${KUBETEST2} --admin-access=${ADMIN_ACCESS:-} --env=KOPS_FEATURE_FLAGS=${KOPS_FEATURE_FLAGS}"

# Always tear-down the cluster when we're done
Expand Down Expand Up @@ -97,6 +93,21 @@ function kops-base-from-marker() {
fi
}

# This function will download the latest kops if in a periodic job, otherwise build from the current tree
function kops-acquire-latest() {
if [[ "${JOB_TYPE-}" == "periodic" ]]; then
export KOPS_BASE_URL
KOPS_BASE_URL="$(curl -s https://storage.googleapis.com/kops-ci/bin/latest-ci-updown-green.txt)"
kops-download-from-base
else
if [[ -n "${KOPS_BASE_URL-}" ]]; then
unset KOPS_BASE_URL
fi
$KUBETEST2 --build >&2
echo .bazelbuild/dist/linux/amd64/kops
fi
}

function kops-up() {
local create_args
create_args="--networking ${NETWORKING} ${OVERRIDES-}"
Expand Down