Skip to content

Commit

Permalink
run online ci tests against tagged releases (#1486)
Browse files Browse the repository at this point in the history
* give build-previous-stable a better name

* do not run build-previous-stable on large runners

* disable CI

* add online multinode custom-cidr proxy test

* download from custom hostname, use correct binary name

* actually download the binary

* rename tasks

* add more online tests

* tests again

* disable CI again

* rearrange app promotions

* f

* reenable all tests again
  • Loading branch information
laverya authored Nov 12, 2024
1 parent 39a600f commit 088bf8d
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 24 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@ jobs:
echo "K0S_VERSION=\"$K0S_VERSION\""
echo "k0s_version=$K0S_VERSION" >> "$GITHUB_OUTPUT"
build-previous-stable:
name: Build previous stable
runs-on: embedded-cluster
find-previous-stable:
name: Determine previous stable version
runs-on: ubuntu-latest
needs:
- git-sha
outputs:
Expand Down Expand Up @@ -441,7 +441,7 @@ jobs:
- build-current
- build-previous-k0s
- build-upgrade
- build-previous-stable
- find-previous-stable
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -475,7 +475,7 @@ jobs:
replicated release promote 11615 2eAqMYG1IEtX8cwpaO1kgNV6EB3 --version "${APP_VERSION}"
# promote a release containing the previous stable version of embedded-cluster to test upgrades
export EC_VERSION="${{ needs.build-previous-stable.outputs.ec_version }}"
export EC_VERSION="${{ needs.find-previous-stable.outputs.ec_version }}"
export APP_VERSION="appver-${SHORT_SHA}-previous-stable"
export RELEASE_YAML_DIR=e2e/kots-release-install-stable
./scripts/ci-release-app.sh
Expand Down Expand Up @@ -515,7 +515,7 @@ jobs:
export SHORT_SHA=dev-${{ needs.git-sha.outputs.git_sha }}
# promote a release containing the previous stable version of embedded-cluster to test upgrades
export EC_VERSION="${{ needs.build-previous-stable.outputs.ec_version }}"
export EC_VERSION="${{ needs.find-previous-stable.outputs.ec_version }}"
export APP_VERSION="appver-${SHORT_SHA}-previous-stable"
export RELEASE_YAML_DIR=e2e/kots-release-install-stable
./scripts/ci-release-app.sh
Expand Down Expand Up @@ -573,7 +573,7 @@ jobs:
- build-current
- build-previous-k0s
- build-upgrade
- build-previous-stable
- find-previous-stable
- release-app
- export-version-specifier
strategy:
Expand Down Expand Up @@ -650,7 +650,7 @@ jobs:
DR_AWS_SECRET_ACCESS_KEY: ${{ secrets.TESTIM_AWS_SECRET_ACCESS_KEY }}
EXPECT_K0S_VERSION: ${{ needs.build-current.outputs.k0s_version }}
EXPECT_K0S_VERSION_PREVIOUS: ${{ needs.build-previous-k0s.outputs.k0s_version }}
EXPECT_K0S_VERSION_PREVIOUS_STABLE: ${{ needs.build-previous-stable.outputs.k0s_version }}
EXPECT_K0S_VERSION_PREVIOUS_STABLE: ${{ needs.find-previous-stable.outputs.k0s_version }}
run: |
make e2e-test TEST_NAME=${{ matrix.test }}
- name: Troubleshoot
Expand All @@ -666,7 +666,7 @@ jobs:
- build-current
- build-previous-k0s
- build-upgrade
- build-previous-stable
- find-previous-stable
- release-app
- export-version-specifier
strategy:
Expand Down Expand Up @@ -724,7 +724,7 @@ jobs:
dr-aws-secret-access-key: ${{ secrets.TESTIM_AWS_SECRET_ACCESS_KEY }}
k0s-version: ${{ needs.build-current.outputs.k0s_version }}
k0s-version-previous: ${{ needs.build-previous-k0s.outputs.k0s_version }}
k0s-version-previous-stable: ${{ needs.build-previous-stable.outputs.k0s_version }}
k0s-version-previous-stable: ${{ needs.find-previous-stable.outputs.k0s_version }}
version-specifier: ${{ needs.export-version-specifier.outputs.version_specifier }}

# this job will validate that all the tests passed
Expand Down
65 changes: 51 additions & 14 deletions .github/workflows/release-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ jobs:
build/*.tgz
build/metadata.json
build-previous-stable:
name: Build previous stable
runs-on: embedded-cluster
find-previous-stable:
name: Determine previous stable version
runs-on: ubuntu-latest
needs:
- get-tag
outputs:
Expand Down Expand Up @@ -254,7 +254,7 @@ jobs:
needs:
- release
- get-tag
- build-previous-stable
- find-previous-stable
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -275,13 +275,19 @@ jobs:
APP_CHANNEL: CI
USES_DEV_BUCKET: "0"
run: |
# re-promote a release containing an old version of embedded-cluster to test upgrades
export APP_VERSION="appver-${{ needs.get-tag.outputs.tag-name }}-1.8.0-k8s-1.28"
replicated release promote 11615 2cHXb1RCttzpR0xvnNWyaZCgDBP --version "${APP_VERSION}"
replicated release promote 11615 2eAqMYG1IEtX8cwpaO1kgNV6EB3 --version "${APP_VERSION}"
# install the current k0s version
export EC_VERSION="${{ needs.get-tag.outputs.tag-name }}"
export APP_VERSION="appver-${{ needs.get-tag.outputs.tag-name }}"
export RELEASE_YAML_DIR=e2e/kots-release-install
./scripts/ci-release-app.sh
# and finally an app upgrade
export EC_VERSION="${{ needs.get-tag.outputs.tag-name }}-upgrade"
export EC_VERSION="${{ needs.get-tag.outputs.tag-name }}"
export APP_VERSION="appver-${{ needs.get-tag.outputs.tag-name }}-upgrade"
export RELEASE_YAML_DIR=e2e/kots-release-upgrade
./scripts/ci-release-app.sh
Expand All @@ -293,13 +299,8 @@ jobs:
APP_CHANNEL: CI-airgap
USES_DEV_BUCKET: "0"
run: |
# re-promote a release containing an old version of embedded-cluster to test upgrades
export APP_VERSION="appver-${{ needs.get-tag.outputs.tag-name }}-1.8.0-k8s-1.28"
replicated release promote 11615 2cHXb1RCttzpR0xvnNWyaZCgDBP --version "${APP_VERSION}"
replicated release promote 11615 2eAqMYG1IEtX8cwpaO1kgNV6EB3 --version "${APP_VERSION}"
# promote a release containing the previous stable version of embedded-cluster to test upgrades
export EC_VERSION="${{ needs.build-previous-stable.outputs.ec_version }}"
export EC_VERSION="${{ needs.find-previous-stable.outputs.ec_version }}"
export APP_VERSION="appver-${{ needs.get-tag.outputs.tag-name }}-previous-stable"
export RELEASE_YAML_DIR=e2e/kots-release-install-stable
./scripts/ci-release-app.sh
Expand All @@ -318,20 +319,52 @@ jobs:
export APP_VERSION="appver-${{ needs.get-tag.outputs.tag-name }}-upgrade"
export RELEASE_YAML_DIR=e2e/kots-release-upgrade
./scripts/ci-release-app.sh
download-current:
name: Download the current release binary
runs-on: ubuntu-latest
needs:
- release-app
- get-tag
steps:
- name: Download current binary
env:
LICENSE_ID: ${{ secrets.STAGING_EMBEDDED_CLUSTER_LICENSE_ID }}
run: |
export APP_VERSION="appver-${{ needs.get-tag.outputs.tag-name }}"
curl -L "https://ec-e2e-replicated-app.testcluster.net/embedded/embedded-cluster-smoke-test-staging-app/ci/${APP_VERSION}" -H "Authorization: $LICENSE_ID" -o embedded-cluster-smoke-test-staging-app-ci.tgz
tar -xzf embedded-cluster-smoke-test-staging-app-ci.tgz
mv embedded-cluster-smoke-test-staging-app embedded-cluster
mkdir -p output/bin
mv embedded-cluster output/bin
- name: Upload release
uses: actions/upload-artifact@v4
with:
name: current-release
path: |
output/bin/embedded-cluster
e2e:
name: E2E
runs-on: ${{ matrix.runner || 'ubuntu-22.04' }}
needs:
- release
- release-app
- get-tag
- build-previous-stable
- download-current
- find-previous-stable
strategy:
fail-fast: false
matrix:
test:
- TestResetAndReinstallAirgap
- TestSingleNodeAirgapUpgrade
- TestSingleNodeDisasterRecoveryWithProxy
- TestProxiedEnvironment
- TestProxiedCustomCIDR
- TestInstallWithPrivateCAs
- TestInstallWithMITMProxy
include:
- test: TestMultiNodeAirgapUpgrade
runner: embedded-cluster
Expand All @@ -342,6 +375,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download current binary
uses: actions/download-artifact@v4
with:
name: current-release
path: output/bin

- uses: ./.github/actions/e2e
with:
Expand All @@ -359,11 +397,10 @@ jobs:

k0s-version: ${{ needs.get-tag.outputs.k0s_version }}
k0s-version-previous: ${{ needs.get-tag.outputs.k0s_version }} # we do not run k8s upgrade tests on release
k0s-version-previous-stable: ${{ needs.build-previous-stable.outputs.k0s_version }}
k0s-version-previous-stable: ${{ needs.find-previous-stable.outputs.k0s_version }}
upgrade-target-ec-version: ${{ needs.get-tag.outputs.tag-name }}

# this job will validate that all the tests passed
# it is used for the github branch protection rule
validate-release-success:
name: Validate success
runs-on: ubuntu-20.04
Expand Down

0 comments on commit 088bf8d

Please sign in to comment.