forked from kubermatic/kubermatic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* OPA e2e tests * fix lint * fix prow regex and an error msg
- Loading branch information
Showing
5 changed files
with
515 additions
and
0 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 |
---|---|---|
|
@@ -1255,6 +1255,46 @@ presubmits: | |
limits: | ||
memory: 6Gi | ||
|
||
######################################################### | ||
# opa e2e tests | ||
######################################################### | ||
|
||
- name: pre-kubermatic-opa-e2e | ||
run_if_changed: "(go.mod|go.sum|pkg/|.prow.yaml)" | ||
decorate: true | ||
clone_uri: "ssh://[email protected]/kubermatic/kubermatic.git" | ||
labels: | ||
preset-digitalocean: "true" | ||
preset-kubeconfig-ci: "true" | ||
preset-docker-pull: "true" | ||
preset-docker-push: "true" | ||
preset-kind-volume-mounts: "true" | ||
preset-vault: "true" | ||
preset-goproxy: "true" | ||
spec: | ||
containers: | ||
- image: quay.io/kubermatic/e2e-kind:with-conformance-tests-v1.0.23 | ||
command: | ||
- "./hack/ci/run-opa-e2e-tests.sh" | ||
env: | ||
- name: VERSION_TO_TEST | ||
value: v1.20.2 | ||
- name: KUBERMATIC_EDITION | ||
value: ee | ||
- name: SERVICE_ACCOUNT_KEY | ||
valueFrom: | ||
secretKeyRef: | ||
name: e2e-ci | ||
key: serviceAccountSigningKey | ||
securityContext: | ||
privileged: true | ||
resources: | ||
requests: | ||
memory: 4Gi | ||
cpu: 2 | ||
limits: | ||
memory: 6Gi | ||
|
||
######################################################### | ||
# misc | ||
######################################################### | ||
|
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,66 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2021 The Kubermatic Kubernetes Platform contributors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
### This script sets up a local KKP installation in kind, deploys a | ||
### couple of test Presets and Users and then runs the OPA e2e tests. | ||
|
||
set -euo pipefail | ||
|
||
cd $(dirname $0)/../.. | ||
source hack/lib.sh | ||
|
||
TEST_NAME="Pre-warm Go build cache" | ||
echodate "Attempting to pre-warm Go build cache" | ||
|
||
beforeGocache=$(nowms) | ||
make download-gocache | ||
pushElapsed gocache_download_duration_milliseconds $beforeGocache | ||
|
||
export KIND_CLUSTER_NAME="${SEED_NAME:-kubermatic}" | ||
|
||
source hack/ci/setup-kind-cluster.sh | ||
source hack/ci/setup-kubermatic-in-kind.sh | ||
|
||
echodate "Creating UI DigitalOcean preset..." | ||
cat << EOF > preset-digitalocean.yaml | ||
apiVersion: kubermatic.k8s.io/v1 | ||
kind: Preset | ||
metadata: | ||
name: e2e-digitalocean | ||
namespace: kubermatic | ||
spec: | ||
digitalocean: | ||
token: ${DO_E2E_TESTS_TOKEN} | ||
EOF | ||
retry 2 kubectl apply -f preset-digitalocean.yaml | ||
|
||
echodate "Creating roxy2 user..." | ||
cat << EOF > user.yaml | ||
apiVersion: kubermatic.k8s.io/v1 | ||
kind: User | ||
metadata: | ||
name: c41724e256445bf133d6af1168c2d96a7533cd437618fdbe6dc2ef1fee97acd3 | ||
spec: | ||
email: [email protected] | ||
id: 1413636a43ddc27da27e47614faedff24b4ab19c9d9f2b45dd1b89d9_KUBE | ||
name: roxy2 | ||
admin: true | ||
EOF | ||
retry 2 kubectl apply -f user.yaml | ||
|
||
echodate "Running opa tests..." | ||
go test -timeout 30m -tags e2e -v ./pkg/test/e2e/opa -kubeconfig "$KUBECONFIG" | ||
echodate "Tests completed successfully!" |
Oops, something went wrong.