Skip to content

Commit

Permalink
Merge pull request #602 from ecordell/slightly-mame-gitlab
Browse files Browse the repository at this point in the history
feat(ci): remove e2e tests from gitlab
  • Loading branch information
ecordell authored Dec 5, 2018
2 parents 3b14002 + 85584db commit 7afcd1e
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 195 deletions.
31 changes: 0 additions & 31 deletions .gitlab-ci.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ local stages_list = [
'docker_base',
'docker_build',
'deploy_preview',
'wait_in_queue',
'test_setup',
'tests',
'test_teardown',
Expand Down Expand Up @@ -82,36 +81,6 @@ local jobs = {
only: ['tags'],
},

'wait-in-queue': baseJob.WaitInQueue {
stage: stages.wait_in_queue,
},

'e2e-setup': baseJob.Deploy {
local _vars = self.localvars,
localvars+:: {
namespace: "e2e-%s" % "${CI_COMMIT_REF_SLUG}-${SHA8}",
catalog_namespace: "e2e-%s" % "${CI_COMMIT_REF_SLUG}-${SHA8}",
},
stage: stages.test_setup,
},

'e2e-teardown': baseJob.DeployStop {
local _vars = self.localvars,
localvars+:: {
namespace: "e2e-%s" % "${CI_COMMIT_REF_SLUG}-${SHA8}",
catalog_namespace: "e2e-%s" % "${CI_COMMIT_REF_SLUG}-${SHA8}",
},
stage: stages.test_teardown,
},

// End2End tests
local integration_test = baseJob.EndToEndTest {
stage: stages.tests,
},

e2e_tests: integration_test {
},

"deploy-preview": baseJob.Deploy {
local _vars = self.localvars,
localvars+:: {
Expand Down
80 changes: 0 additions & 80 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,83 +185,10 @@ deploy-staging:
variables:
ALM_DOMAIN: alm-staging.k8s.devtable.com
K8S_NAMESPACE: ci-alm-staging
e2e-setup:
before_script:
- 'echo "version: 1.0.0-${CI_COMMIT_REF_SLUG}-pre" >> deploy/chart/Chart.yaml'
- 'echo "{\"catalog.image.ref\": \"quay.io/coreos/olm-ci:${CI_COMMIT_REF_SLUG}-pre\", \"catalog_namespace\": \"e2e-${CI_COMMIT_REF_SLUG}-${SHA8}\", \"namespace\": \"e2e-${CI_COMMIT_REF_SLUG}-${SHA8}\",
\"olm.image.ref\": \"quay.io/coreos/olm-ci:${CI_COMMIT_REF_SLUG}-pre\", \"package.image.ref\": \"quay.io/coreos/olm-ci:${CI_COMMIT_REF_SLUG}-pre\", \"watchedNamespaces\": \"e2e-${CI_COMMIT_REF_SLUG}-${SHA8}\"}"
> params.json'
- cat params.json
environment:
name: review/e2e-${CI_COMMIT_REF_SLUG}-${SHA8}
url: https://olm-${CI_COMMIT_REF_SLUG}.k8s.devtable.com
image: quay.io/coreos/alm-ci-build:latest
script:
- echo $CD_KUBECONFIG | base64 -d > kubeconfig
- export KUBECONFIG=./kubeconfig
- charttmpdir=`mktemp -d 2>/dev/null || mktemp -d -t 'charttmpdir'`;mkdir -p ${charttmpdir};helm template -n olm --set namespace=e2e-${CI_COMMIT_REF_SLUG}-${SHA8} deploy/chart --set catalog.image.ref=quay.io/coreos/olm-ci:${CI_COMMIT_REF_SLUG}-pre
--set catalog_namespace=e2e-${CI_COMMIT_REF_SLUG}-${SHA8} --set namespace=e2e-${CI_COMMIT_REF_SLUG}-${SHA8} --set olm.image.ref=quay.io/coreos/olm-ci:${CI_COMMIT_REF_SLUG}-pre --set package.image.ref=quay.io/coreos/olm-ci:${CI_COMMIT_REF_SLUG}-pre
--set watchedNamespaces=e2e-${CI_COMMIT_REF_SLUG}-${SHA8} --output-dir ${charttmpdir};chartfilenames=$(ls ${charttmpdir}/olm/templates/*.yaml);echo ${chartfilenames};for f in ${chartfilenames};do if
[[ $f == *.configmap.yaml ]];then kubectl replace --force -f ${f};else kubectl apply -f ${f};fi;done;
- kubectl create secret docker-registry coreos-pull-secret --docker-server quay.io --docker-username $DOCKER_USER --docker-password $DOCKER_PASS --docker-email ignored@example.com --namespace=e2e-${CI_COMMIT_REF_SLUG}-${SHA8}
|| true
- kubectl rollout status -w deployment/olm-operator --namespace=e2e-${CI_COMMIT_REF_SLUG}-${SHA8}
- kubectl rollout status -w deployment/catalog-operator --namespace=e2e-${CI_COMMIT_REF_SLUG}-${SHA8}
- kubectl rollout status -w deployment/package-server --namespace=e2e-${CI_COMMIT_REF_SLUG}-${SHA8}
stage: test_setup
tags:
- kubernetes
variables:
ALM_DOMAIN: olm-${CI_COMMIT_REF_SLUG}.k8s.devtable.com
K8S_NAMESPACE: e2e-${CI_COMMIT_REF_SLUG}-${SHA8}
e2e-teardown:
before_script: []
environment:
action: stop
name: review/e2e-${CI_COMMIT_REF_SLUG}-${SHA8}
url: https://olm-${CI_COMMIT_REF_SLUG}.k8s.devtable.com
image: quay.io/coreos/alm-ci-build:latest
script:
- echo $CD_KUBECONFIG | base64 -d > kubeconfig
- export KUBECONFIG=./kubeconfig
- kubectl delete apiservice v1alpha1.packages.apps.redhat.com --ignore-not-found=true
- kubectl delete ns --ignore-not-found=true e2e-${CI_COMMIT_REF_SLUG}-${SHA8}
- kubectl get pods -o wide -n e2e-${CI_COMMIT_REF_SLUG}-${SHA8}
stage: test_teardown
tags:
- kubernetes
variables:
ALM_DOMAIN: olm-${CI_COMMIT_REF_SLUG}.k8s.devtable.com
GIT_STRATEGY: none
K8S_NAMESPACE: e2e-${CI_COMMIT_REF_SLUG}-${SHA8}
e2e_tests:
image: quay.io/coreos/alm-ci-build:latest
script:
- echo $CD_KUBECONFIG | base64 -d > kubeconfig
- export KUBECONFIG=./kubeconfig
- kubectl create secret docker-registry coreos-pull-secret --docker-server quay.io --docker-username $DOCKER_USER --docker-password $DOCKER_PASS --docker-email ignored@example.com --namespace=e2e-${CI_COMMIT_REF_SLUG}-${SHA8}
|| true
- 'kubectl -n e2e-${CI_COMMIT_REF_SLUG}-${SHA8} patch serviceaccount default -p ''{"imagePullSecrets": [{"name": "coreos-pull-secret"}]}'' || true'
- kubectl -n e2e-${CI_COMMIT_REF_SLUG}-${SHA8} create rolebinding e2e-admin-rb --clusterrole=cluster-admin --serviceaccount=e2e-${CI_COMMIT_REF_SLUG}-${SHA8}:default --namespace=e2e-${CI_COMMIT_REF_SLUG}-${SHA8}
|| true
- charttmpdir=`mktemp -d 2>/dev/null || mktemp -d -t 'charttmpdir'`;mkdir -p ${charttmpdir};helm template -n olm-e2e --set namespace=e2e-${CI_COMMIT_REF_SLUG}-${SHA8} test/e2e/chart --set e2e.image.ref=quay.io/coreos/olm-e2e:${CI_COMMIT_REF_SLUG}-${SHA8}
--set job_name=e2e-${CI_COMMIT_REF_SLUG}-${SHA8} --set namespace=e2e-${CI_COMMIT_REF_SLUG}-${SHA8} --output-dir ${charttmpdir};chartfilenames=$(ls ${charttmpdir}/olm-e2e/templates/*.yaml);echo ${chartfilenames};for
f in ${chartfilenames};do if [[ $f == *.configmap.yaml ]];then kubectl replace --force -f ${f};else kubectl apply -f ${f};fi;done;
- until kubectl -n e2e-${CI_COMMIT_REF_SLUG}-${SHA8} logs job/e2e-${CI_COMMIT_REF_SLUG}-${SHA8} | grep -v 'ContainerCreating'; do echo 'waiting for job to run' && sleep 1; done
- kubectl -n e2e-${CI_COMMIT_REF_SLUG}-${SHA8} logs job/e2e-${CI_COMMIT_REF_SLUG}-${SHA8} -f
- kubectl -n e2e-${CI_COMMIT_REF_SLUG}-${SHA8} logs job/e2e-${CI_COMMIT_REF_SLUG}-${SHA8} > e2e.log
- if cat e2e.log | grep -q '^not'; then echo 'err' && exit 1; else echo 'no err' && exit 0; fi
stage: tests
tags:
- kubernetes
variables:
K8S_NAMESPACE: e2e-${CI_COMMIT_REF_SLUG}-${SHA8}
NAMESPACE: e2e-${CI_COMMIT_REF_SLUG}-${SHA8}
stages:
- docker_base
- docker_build
- deploy_preview
- wait_in_queue
- test_setup
- tests
- test_teardown
Expand Down Expand Up @@ -318,10 +245,3 @@ tag-release:
variables:
FAILFASTCI_NAMESPACE: operator-framework
GET_SOURCES_ATTEMPTS: '10'
wait-in-queue:
image: quay.io/coreos/olm-e2e:${CI_COMMIT_REF_SLUG}-${SHA8}
script:
- . ${CI_PROJECT_DIR}/scripts/wait_in_queue.sh $CI_PROJECT_URL $CI_PIPELINE_ID
stage: wait_in_queue
tags:
- kubernetes
53 changes: 0 additions & 53 deletions .gitlab-ci/base_jobs.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -20,59 +20,6 @@ local appr = utils.appr;
],
} + job_tags,

WaitInQueue: {
image: vars.images.e2e.name,
script:
[
". ${CI_PROJECT_DIR}/scripts/wait_in_queue.sh $CI_PROJECT_URL $CI_PIPELINE_ID",
],
} + job_tags,


EndToEndTest: {
local _vars = self.localvars,
localvars:: {
appname: self.namespace,
namespace: "e2e-%s" % "${CI_COMMIT_REF_SLUG}-${SHA8}",
jobname: "e2e-%s" % "${CI_COMMIT_REF_SLUG}-${SHA8}",
chart: "test/e2e/chart",
appversion: "1.0.0-e2e-%s" % self.image.olm.tag,
helm_opts: [],
params: {
namespace: _vars.namespace,
"e2e.image.ref": vars.images.e2e.name,
job_name: _vars.jobname,
},
patch: "{\"imagePullSecrets\": [{\"name\": \"coreos-pull-secret\"}]}",
},
image: "quay.io/coreos/alm-ci-build:latest",
script:
k8s.setKubeConfig("$CD_KUBECONFIG") +
k8s.createPullSecret("coreos-pull-secret",
_vars.namespace,
"quay.io",
"$DOCKER_USER",
"$DOCKER_PASS") +
[
'kubectl -n %s patch serviceaccount default -p %s || true' % [_vars.namespace, std.escapeStringBash(_vars.patch)],
] +
[
'kubectl -n %s create rolebinding e2e-admin-rb --clusterrole=cluster-admin --serviceaccount=%s:default --namespace=%s || true' % [_vars.namespace, _vars.namespace, _vars.namespace],
] +
helm.templateApply("olm-e2e", _vars.chart, _vars.namespace, _vars.params) +
[
"until kubectl -n %s logs job/%s | grep -v 'ContainerCreating'; do echo 'waiting for job to run' && sleep 1; done" % [_vars.namespace, _vars.jobname],
"kubectl -n %s logs job/%s -f" % [_vars.namespace, _vars.jobname],
"kubectl -n %s logs job/%s > e2e.log" % [_vars.namespace, _vars.jobname],
"if cat e2e.log | grep -q '^not'; then echo 'err' && exit 1; else echo 'no err' && exit 0; fi",
],

variables: {
NAMESPACE: _vars.namespace,
K8S_NAMESPACE: _vars.namespace,
},
} + job_tags,

Deploy: {
local this = self,
local _vars = self.localvars,
Expand Down
31 changes: 0 additions & 31 deletions scripts/wait_in_queue.sh

This file was deleted.

0 comments on commit 7afcd1e

Please sign in to comment.