Skip to content

Commit

Permalink
chore(v2): e2e test multiple upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh committed Jan 31, 2025
1 parent 84dd073 commit 85ae514
Show file tree
Hide file tree
Showing 6 changed files with 281 additions and 74 deletions.
176 changes: 129 additions & 47 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,72 @@ jobs:
echo "K0S_VERSION=\"$K0S_VERSION\""
echo "k0s_version=$K0S_VERSION" >> "$GITHUB_OUTPUT"
build-upgrade-2:
name: Build upgrade 2
runs-on: embedded-cluster-2
needs:
- git-sha
outputs:
k0s_version: ${{ steps.export.outputs.k0s_version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cache embedded bins
uses: actions/cache@v4
with:
path: |
output/bins
key: bins-cache

- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: "**/*.sum"

- name: Install dagger
run: |
curl -fsSL https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=v0.14.0 sh
sudo mv ./bin/dagger /usr/local/bin/dagger
- name: Build
env:
APP_CHANNEL_ID: 2cHXb1RCttzpR0xvnNWyaZCgDBP
APP_CHANNEL_SLUG: ci
RELEASE_YAML_DIR: e2e/kots-release-upgrade
S3_BUCKET: "tf-staging-embedded-cluster-bin"
USES_DEV_BUCKET: "0"
AWS_ACCESS_KEY_ID: ${{ secrets.STAGING_EMBEDDED_CLUSTER_UPLOAD_IAM_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.STAGING_EMBEDDED_CLUSTER_UPLOAD_IAM_SECRET }}
AWS_REGION: "us-east-1"
USE_CHAINGUARD: "1"
UPLOAD_BINARIES: "1"
SKIP_RELEASE: "1"
MANGLE_METADATA: "1"
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export K0S_VERSION=$(make print-K0S_VERSION)
export EC_VERSION=$(git describe --tags --abbrev=4 --match='[0-9]*.[0-9]*.[0-9]*')-upgrade2
export APP_VERSION=appver-dev-${{ needs.git-sha.outputs.git_sha }}-upgrade2
# avoid rate limiting
export FIO_VERSION=$(gh release list --repo axboe/fio --json tagName,isLatest | jq -r '.[] | select(.isLatest==true)|.tagName' | cut -d- -f2)
./scripts/build-and-release.sh
cp output/bin/embedded-cluster output/bin/embedded-cluster-upgrade2
- name: Upload release
uses: actions/upload-artifact@v4
with:
name: upgrade-2-release
path: |
output/bin/embedded-cluster-upgrade2
- name: Export k0s version
id: export
run: |
K0S_VERSION="$(make print-K0S_VERSION)"
echo "K0S_VERSION=\"$K0S_VERSION\""
echo "k0s_version=$K0S_VERSION" >> "$GITHUB_OUTPUT"
check-images:
name: Check images
runs-on: ubuntu-latest
Expand Down Expand Up @@ -521,6 +587,7 @@ jobs:
- build-legacydr
- build-previous-k0s
- build-upgrade
- build-upgrade-2
- find-previous-stable
steps:
- name: Checkout
Expand Down Expand Up @@ -584,12 +651,18 @@ jobs:
export RELEASE_YAML_DIR=e2e/kots-release-install
./scripts/ci-release-app.sh
# and finally an app upgrade
# an app upgrade
export EC_VERSION="$(git describe --tags --abbrev=4 --match='[0-9]*.[0-9]*.[0-9]*')-upgrade"
export APP_VERSION="appver-${SHORT_SHA}-upgrade"
export RELEASE_YAML_DIR=e2e/kots-release-upgrade
./scripts/ci-release-app.sh
# and finally a second app upgrade
export EC_VERSION="$(git describe --tags --abbrev=4 --match='[0-9]*.[0-9]*.[0-9]*')-upgrade2"
export APP_VERSION="appver-${SHORT_SHA}-upgrade2"
export RELEASE_YAML_DIR=e2e/kots-release-upgrade
./scripts/ci-release-app.sh
- name: Create airgap releases
env:
REPLICATED_APP: "embedded-cluster-smoke-test-staging-app"
Expand Down Expand Up @@ -624,12 +697,18 @@ jobs:
export RELEASE_YAML_DIR=e2e/kots-release-install-legacydr
./scripts/ci-release-app.sh
# and finally an app upgrade
# an app upgrade
export EC_VERSION="$(git describe --tags --abbrev=4 --match='[0-9]*.[0-9]*.[0-9]*')-upgrade"
export APP_VERSION="appver-${SHORT_SHA}-upgrade"
export RELEASE_YAML_DIR=e2e/kots-release-upgrade
./scripts/ci-release-app.sh
# and finally a second app upgrade
export EC_VERSION="$(git describe --tags --abbrev=4 --match='[0-9]*.[0-9]*.[0-9]*')-upgrade2"
export APP_VERSION="appver-${SHORT_SHA}-upgrade2"
export RELEASE_YAML_DIR=e2e/kots-release-upgrade
./scripts/ci-release-app.sh
- name: Create download link message text
if: github.event_name == 'pull_request'
run: |
Expand Down Expand Up @@ -666,43 +745,44 @@ jobs:
- build-legacydr
- build-previous-k0s
- build-upgrade
- build-upgrade-2
- find-previous-stable
- release-app
- export-version-specifier
strategy:
fail-fast: false
matrix:
test:
- TestPreflights
- TestMaterialize
- TestHostPreflightCustomSpec
- TestHostPreflightInBuiltSpec
# - TestPreflights
# - TestMaterialize
# - TestHostPreflightCustomSpec
# - TestHostPreflightInBuiltSpec
- TestSingleNodeInstallation
- TestSingleNodeInstallationAlmaLinux8
- TestSingleNodeInstallationDebian11
- TestSingleNodeInstallationDebian12
- TestSingleNodeInstallationCentos9Stream
# - TestSingleNodeInstallationAlmaLinux8
# - TestSingleNodeInstallationDebian11
# - TestSingleNodeInstallationDebian12
# - TestSingleNodeInstallationCentos9Stream
- TestSingleNodeUpgradePreviousStable
- TestInstallFromReplicatedApp
- TestUpgradeFromReplicatedApp
# - TestInstallFromReplicatedApp
# - TestUpgradeFromReplicatedApp
- TestUpgradeEC18FromReplicatedApp
- TestResetAndReinstall
- TestOldVersionUpgrade
- TestInstallSnapshotFromReplicatedApp
- TestMultiNodeInstallation
- TestMultiNodeHAInstallation
- TestSingleNodeDisasterRecovery
- TestSingleNodeLegacyDisasterRecovery
- TestSingleNodeResumeDisasterRecovery
- TestMultiNodeHADisasterRecovery
- TestSingleNodeInstallationNoopUpgrade
- TestCustomCIDR
- TestLocalArtifactMirror
- TestMultiNodeReset
- TestCollectSupportBundle
- TestUnsupportedOverrides
- TestHostCollectSupportBundleInCluster
- TestInstallWithConfigValues
# - TestResetAndReinstall
# - TestOldVersionUpgrade
# - TestInstallSnapshotFromReplicatedApp
# - TestMultiNodeInstallation
# - TestMultiNodeHAInstallation
# - TestSingleNodeDisasterRecovery
# - TestSingleNodeLegacyDisasterRecovery
# - TestSingleNodeResumeDisasterRecovery
# - TestMultiNodeHADisasterRecovery
# - TestSingleNodeInstallationNoopUpgrade
# - TestCustomCIDR
# - TestLocalArtifactMirror
# - TestMultiNodeReset
# - TestCollectSupportBundle
# - TestUnsupportedOverrides
# - TestHostCollectSupportBundleInCluster
# - TestInstallWithConfigValues
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -765,6 +845,7 @@ jobs:
- build-legacydr
- build-previous-k0s
- build-upgrade
- build-upgrade-2
- find-previous-stable
- release-app
- export-version-specifier
Expand All @@ -775,29 +856,29 @@ jobs:
- TestVersion
- TestCommandsRequireSudo
- TestResetAndReinstallAirgap
- TestSingleNodeAirgapUpgrade
- TestSingleNodeAirgapUpgradeConfigValues
- TestSingleNodeAirgapUpgradeCustomCIDR
- TestSingleNodeDisasterRecoveryWithProxy
- TestProxiedEnvironment
- TestProxiedCustomCIDR
- TestInstallWithPrivateCAs
- TestInstallWithMITMProxy
# - TestSingleNodeAirgapUpgrade
# - TestSingleNodeAirgapUpgradeConfigValues
# - TestSingleNodeAirgapUpgradeCustomCIDR
# - TestSingleNodeDisasterRecoveryWithProxy
# - TestProxiedEnvironment
# - TestProxiedCustomCIDR
# - TestInstallWithPrivateCAs
# - TestInstallWithMITMProxy
include:
- test: TestMultiNodeAirgapUpgrade
runner: embedded-cluster-2
- test: TestMultiNodeAirgapUpgradeSameK0s
runner: embedded-cluster-2
# - test: TestMultiNodeAirgapUpgrade
# runner: embedded-cluster-2
# - test: TestMultiNodeAirgapUpgradeSameK0s
# runner: embedded-cluster-2
- test: TestMultiNodeAirgapUpgradePreviousStable
runner: embedded-cluster-2
- test: TestAirgapUpgradeFromEC18
runner: embedded-cluster-2
- test: TestSingleNodeAirgapDisasterRecovery
runner: embedded-cluster-2
- test: TestMultiNodeAirgapHAInstallation
runner: embedded-cluster-2
- test: TestMultiNodeAirgapHADisasterRecovery
runner: embedded-cluster-2
# - test: TestSingleNodeAirgapDisasterRecovery
# runner: embedded-cluster-2
# - test: TestMultiNodeAirgapHAInstallation
# runner: embedded-cluster-2
# - test: TestMultiNodeAirgapHADisasterRecovery
# runner: embedded-cluster-2
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -833,6 +914,7 @@ jobs:
- build-legacydr
- build-previous-k0s
- build-upgrade
- build-upgrade-2
- find-previous-stable
- release-app
- export-version-specifier
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/release-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,18 @@ jobs:
export RELEASE_YAML_DIR=e2e/kots-release-install
./scripts/ci-release-app.sh
# and finally an app upgrade
# an app upgrade
export EC_VERSION="${{ github.ref_name }}"
export APP_VERSION="appver-${{ github.ref_name }}-upgrade"
export RELEASE_YAML_DIR=e2e/kots-release-upgrade
./scripts/ci-release-app.sh
# and finally a second app upgrade
export EC_VERSION="${{ github.ref_name }}"
export APP_VERSION="appver-${{ github.ref_name }}-upgrade2"
export RELEASE_YAML_DIR=e2e/kots-release-upgrade
./scripts/ci-release-app.sh
- name: Create airgap releases
env:
REPLICATED_APP: "embedded-cluster-smoke-test-staging-app"
Expand All @@ -343,9 +349,15 @@ jobs:
export RELEASE_YAML_DIR=e2e/kots-release-install
./scripts/ci-release-app.sh
# and finally an app upgrade
# an app upgrade
export EC_VERSION="${{ github.ref_name }}"
export APP_VERSION="appver-${{ github.ref_name }}-upgrade"
export RELEASE_YAML_DIR=e2e/kots-release-upgrade
./scripts/ci-release-app.sh
# and finally a second app upgrade
export EC_VERSION="${{ github.ref_name }}"
export APP_VERSION="appver-${{ github.ref_name }}-upgrade2"
export RELEASE_YAML_DIR=e2e/kots-release-upgrade
./scripts/ci-release-app.sh
Expand Down
6 changes: 6 additions & 0 deletions e2e/cluster/lxd/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ type ClusterInput struct {
EmbeddedClusterReleaseBuilderPath string // used to replace the release in the binary
AirgapInstallBundlePath string
AirgapUpgradeBundlePath string
AirgapUpgrade2BundlePath string
Image string
network string
T *testing.T
Expand Down Expand Up @@ -464,6 +465,11 @@ func CopyFilesToNode(in *ClusterInput, node string) {
DestPath: "/assets/ec-release-upgrade.tgz",
Mode: 0755,
},
{
SourcePath: in.AirgapUpgrade2BundlePath,
DestPath: "/assets/ec-release-upgrade2.tgz",
Mode: 0755,
},
}
files = append(files, in.AdditionalFiles...)
for _, file := range files {
Expand Down
Loading

0 comments on commit 85ae514

Please sign in to comment.