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

Refactoring test scripts #557

Merged
merged 34 commits into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from 32 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
119 changes: 0 additions & 119 deletions .ci/cico_minishift_nightly.sh

This file was deleted.

99 changes: 0 additions & 99 deletions .ci/cico_olm_minikube.sh

This file was deleted.

65 changes: 14 additions & 51 deletions .ci/cico_olm_openshift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,65 +9,28 @@
#

set -e

# Detect the base directory where che-operator is cloned
SCRIPT=$(readlink -f "$0")
export SCRIPT

OPERATOR_REPO=$(dirname "$(dirname "$SCRIPT")");
export OPERATOR_REPO

# ENV used by Openshift CI
ARTIFACTS_DIR="/tmp/artifacts"
export ARTIFACTS_DIR
set -x
set -u

# Component is defined in Openshift CI job configuration. See: https://github.com/openshift/release/blob/master/ci-operator/config/devfile/devworkspace-operator/devfile-devworkspace-operator-master__v4.yaml#L8
CI_COMPONENT="che-operator-catalog"
export CI_COMPONENT

CATALOG_SOURCE_IMAGE_NAME=${CI_COMPONENT}:stable
export CATALOG_SOURCE_IMAGE_NAME

# This image is builded by Openshift CI and exposed to be consumed for olm tests.
#OPENSHIFT_BUILD_NAMESPACE env var exposed by Openshift CI. More info about how images are builded in Openshift CI: https://github.com/openshift/ci-tools/blob/master/TEMPLATES.md#parameters-available-to-templates
CATALOG_SOURCE_IMAGE="che-catalog"
export CATALOG_SOURCE_IMAGE

# Choose if install Eclipse Che using an operatorsource or Custom Catalog Source
INSTALLATION_TYPE="catalog"
export INSTALLATION_TYPE
export CI_COMPONENT="che-operator-catalog"
export CATALOG_SOURCE_IMAGE_NAME=${CI_COMPONENT}:stable

# Execute olm nightly files in openshift
PLATFORM="openshift"
export PLATFORM
export OPERATOR_REPO=$(dirname $(dirname $(readlink -f "$0")));
source "${OPERATOR_REPO}"/.github/bin/common.sh

# Test nightly olm files
CHANNEL="nightly"
export CHANNEL

# Test nightly olm files
NAMESPACE="che"
export NAMESPACE
trap "catchFinish" EXIT SIGINT

# run function run the tests in ci of custom catalog source.
function run() {
function runTests() {
# see olm.sh
export OAUTH="false"
# Execute test catalog source script
source "${OPERATOR_REPO}"/olm/testCatalogSource.sh ${PLATFORM} ${CHANNEL} ${NAMESPACE} ${INSTALLATION_TYPE} ${CATALOG_SOURCE_IMAGE}

source "${OPERATOR_REPO}"/.ci/util/ci_common.sh
oc project ${NAMESPACE}

# Create and start a workspace
getCheAcessToken
chectl workspace:create --start --devfile=$OPERATOR_REPO/.ci/util/devfile-test.yaml

getCheAcessToken
chectl workspace:list
# Execute test catalog source script
source "${OPERATOR_REPO}"/olm/testCatalogSource.sh "openshift" "nightly" ${NAMESPACE} "catalog" "che-catalog"
startNewWorkspace
waitWorkspaceStart
}

run

# grab che-operator namespace events after running olm nightly tests
oc get events -n ${NAMESPACE} | tee ${ARTIFACTS_DIR}/che-operator-events.log
init
runTests
Loading