Skip to content

Commit

Permalink
Create a test suite for kubevirt plugin
Browse files Browse the repository at this point in the history
Additionally, add a generic script to run test suites.
The script is essential for kubevirt-plugin gating.

Add a dummy test for kubevirt-plugin for the test suite.

Signed-off-by: Ido Rosenzwig <irosenzw@redhat.com>
  • Loading branch information
irosenzw committed Jun 8, 2020
1 parent ab42522 commit a007f03
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
3 changes: 3 additions & 0 deletions frontend/integration-tests/protractor.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ const testSuites = {
'../packages/operator-lifecycle-manager/integration-tests/scenarios/global-installmode.scenario.ts',
'../packages/operator-lifecycle-manager/integration-tests/scenarios/single-installmode.scenario.ts',
]),
kubevirtPlugin: suite([
'../packages/kubevirt-plugin/integration-tests/tests/example.scenario.ts',
]),
performance: suite(['tests/performance.scenario.ts']),
serviceCatalog: suite([
'tests/service-catalog/service-catalog.scenario.ts',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export KUBEVIRT_VERSION=$(curl -s https://github.com/kubevirt/kubevirt/releases/latest | grep -o "v[0-9]\.[0-9]*\.[0-9]*")
export CDI_VERSION=$(curl -s https://github.com/kubevirt/containerized-data-importer/releases/latest | grep -o "v[0-9]\.[0-9]*\.[0-9]*")

# Create openshift-cnv namespace for Integration Tests
oc create namespace openshift-cnv

# Deploy Kubevirt, Storage, CDI Pods
oc create -f https://github.com/kubevirt/kubevirt/releases/download/$KUBEVIRT_VERSION/kubevirt-operator.yaml

oc create -f https://github.com/kubevirt/kubevirt/releases/download/$KUBEVIRT_VERSION/kubevirt-cr.yaml

oc create -f https://raw.githubusercontent.com/kubevirt/kubevirt.github.io/master/labs/manifests/storage-setup.yml

oc create -f https://github.com/kubevirt/containerized-data-importer/releases/download/$CDI_VERSION/cdi-operator.yaml

oc create -f https://github.com/kubevirt/containerized-data-importer/releases/download/$CDI_VERSION/cdi-cr.yaml

# Deploy Common Templates
oc project openshift
oc create -f https://raw.githubusercontent.com/MarSik/kubevirt-ssp-operator/master/roles/KubevirtCommonTemplatesBundle/files/common-templates-v0.11.0.yaml
oc project default
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { browser } from 'protractor';
import { isLoaded } from '@console/internal-integration-tests/views/crud.view';
import { appHost, testName } from '@console/internal-integration-tests/protractor.conf';

// This is an dummy test - for development only.
describe('Successful example test', () => {
it('Navigate to virtualization page', async () => {
await browser.get(`${appHost}/k8s/ns/${testName}/virtualization`);
await isLoaded();
});
});
13 changes: 13 additions & 0 deletions test-suites.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

set -e

# Usage:
# Run the script providing suite names as arguments as they appear in
# frontend/integration-tests/protractor.conf.ts

cd frontend
for suite in "$@"
do
yarn run test-suite --suite "${suite}" --params.openshift true
done

0 comments on commit a007f03

Please sign in to comment.