-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Che rollback after update integration test Signed-off-by: Mykola Morhun <[email protected]>
- Loading branch information
Showing
6 changed files
with
192 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# | ||
# Copyright (c) 2012-2021 Red Hat, Inc. | ||
# This program and the accompanying materials are made | ||
# available under the terms of the Eclipse Public License 2.0 | ||
# which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
# Contributors: | ||
# Red Hat, Inc. - initial API and implementation | ||
name: Minikube E2E | ||
on: pull_request | ||
jobs: | ||
minikube-e2e-olm-rollback: | ||
name: OLM installer rollback update | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Start minikube cluster | ||
id: run-minikube | ||
uses: che-incubator/setup-minikube-action@next | ||
with: | ||
minikube-version: v1.21.0 | ||
- name: Install chectl dependencies | ||
run: yarn | ||
- name: Install OLM | ||
run: | | ||
export OLM_VERSION=v0.17.0 | ||
curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/${OLM_VERSION}/install.sh | bash -s ${OLM_VERSION} | ||
sleep 60 | ||
- name: Run OLM e2e rollback tests | ||
run: | | ||
export PLATFORM=minikube | ||
export INSTALLER=olm | ||
yarn test --coverage=false --forceExit --testRegex=test/e2e/e2e-rollback.test.ts | ||
- uses: actions/upload-artifact@v2 | ||
if: ${{ always() }} | ||
with: | ||
name: test-artifacts | ||
path: /tmp/logs/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/********************************************************************* | ||
* Copyright (c) 2021 Red Hat, Inc. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
**********************************************************************/ | ||
|
||
// tslint:disable: no-console | ||
import { E2eHelper, NAMESPACE } from './util' | ||
|
||
const helper = new E2eHelper() | ||
jest.setTimeout(1000000) | ||
|
||
const binChectl = E2eHelper.getChectlBinaries() | ||
|
||
const PLATFORM = process.env.PLATFORM || 'minikube' | ||
|
||
const INSTALLER = 'olm' | ||
const OLM_CHANNEL = 'stable' | ||
|
||
const CHE_VERSION_TIMEOUT_MS = 12 * 60 * 1000 | ||
const CHE_BACKUP_TIMEOUT_MS = 2 * 60 * 1000 | ||
|
||
describe('Test rollback Che update', () => { | ||
let previousCheVersion: string | ||
let latestCheVersion: string | ||
|
||
describe('Prepare pre-latest stable Che', () => { | ||
it(`Deploy Che using ${INSTALLER} installer from ${OLM_CHANNEL} channel`, async () => { | ||
// Retrieve pre-latest and latest stable Che version | ||
[previousCheVersion, latestCheVersion] = await helper.getTwoLatestReleasedVersions() | ||
|
||
const deployCommand = `${binChectl} server:deploy --batch --platform=${PLATFORM} --installer=${INSTALLER} --olm-channel=${OLM_CHANNEL} --version=${previousCheVersion} --chenamespace=${NAMESPACE} --telemetry=off --che-operator-cr-patch-yaml=test/e2e/resources/cr-patch.yaml` | ||
await helper.runCliCommand(deployCommand) | ||
|
||
await helper.waitForVersionInCheCR(previousCheVersion, CHE_VERSION_TIMEOUT_MS) | ||
}) | ||
}) | ||
|
||
describe('Update Che to the latest stable version', () => { | ||
it('Update Eclipse Che Version to the latest', async () => { | ||
console.log(`Updating from ${previousCheVersion} to ${latestCheVersion}`) | ||
|
||
await helper.runCliCommand(binChectl, ['server:update', '-y', `-n ${NAMESPACE}`, '--telemetry=off']) | ||
}) | ||
|
||
it('Wait backup done', async () => { | ||
const backupCrName = 'backup-before-update-to-' + latestCheVersion.replace(/\./g, '-') | ||
await helper.waitForSuccessfulBackup(backupCrName, CHE_BACKUP_TIMEOUT_MS) | ||
}) | ||
|
||
it('Wait updated Che version', async () => { | ||
await helper.waitForVersionInCheCR(latestCheVersion, CHE_VERSION_TIMEOUT_MS) | ||
// Wait some time to reconcile old resources | ||
await helper.sleep(60 * 1000) | ||
}) | ||
}) | ||
|
||
describe('Rollback Che update', () => { | ||
it('Rollback Che to the previous version', async () => { | ||
console.log(`Rolling back from ${latestCheVersion} to ${previousCheVersion}`) | ||
|
||
await helper.runCliCommandVerbose(binChectl, ['server:restore', '--batch', '--rollback', '-n', NAMESPACE, '--telemetry=off']) | ||
}) | ||
|
||
it('Wait previous Che', async () => { | ||
// It is possible to reduce awaiting timeout, because rollback itself waits for the restore to complete. | ||
await helper.waitForVersionInCheCR(previousCheVersion, 2 * 60 * 1000) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters