UNCLASSIFIED

Commit 1cd042c5 authored by Branden Cobb's avatar Branden Cobb Committed by kevin.wilder
Browse files

helm-tests

parent c2b52a1e
# Changelog
## [29.1.0-bb.3] - 2021-06-08
### Modified
- Modified CI tests to use new library and infrastructure
### Added
- Network policy for helm-tests to save artifacts
## [29.1.0-bb.2]
# Added
* default-deny-all network policy
......
dependencies:
- name: gluon
repository: oci://registry.dso.mil/platform-one/big-bang/apps/library-charts/gluon
version: 0.1.1
digest: sha256:cf1107c00a11cde8074a39624643312fe85ee11250bb7d9380e3787bde0af0f7
generated: "2021-06-08T09:04:25.9101709-06:00"
apiVersion: v2
name: nexus-repository-manager
version: 29.1.0-bb.2
version: 29.1.0-bb.3
appVersion: 3.29.0
description: Sonatype Nexus Repository Manager - Universal Binary repository
type: application
......@@ -22,3 +22,7 @@ sources:
maintainers:
- email: support@sonatype.com
name: Sonatype
dependencies:
- name: gluon
version: "0.1.1"
repository: "oci://registry.dso.mil/platform-one/big-bang/apps/library-charts/gluon"
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $.Values.ingress.hostRepo }}{{ . }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $.Values.ingress.hostDocker }}{{ . }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $.Values.ingress.hostRepo }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $.Values.ingress.hostDocker }}
{{- else if contains "NodePort" .Values.service.serviceType }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "nexus.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
......
{{- $bbtests := .Values.bbtests | default dict -}}
{{- $enabled := (hasKey $bbtests "enabled") -}}
{{- if $enabled }}
{{- if and .Values.networkPolicies.enabled .Values.bbtests.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-helm-test-egress
namespace: {{ .Release.Namespace }}
spec:
podSelector:
matchLabels:
helm-test: enabled
policyTypes:
- Egress
egress:
- {}
{{- end }}
{{- end }}
{{- if .Values.networkPolicies.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-in-ns
namespace: {{ .Release.Namespace }}
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress
ingress:
- from:
- podSelector: {}
egress:
- to:
- podSelector: {}
{{- end }}
{{- include "gluon.tests.cypress-configmap.overrides" (list . "nexus-test.cypress-configmap") }}
{{- define "nexus-test.cypress-configmap" }}
metadata:
labels:
app.kubernetes.io/name: {{ include "nexus.name" . }}
helm.sh/chart: {{ include "nexus.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: nexus-repository-manager
app.kubernetes.io/component: {{ include "nexus.name" . }}
{{- end }}
---
{{- include "gluon.tests.cypress-runner.overrides" (list . "nexus-test.cypress-runner") -}}
{{- define "nexus-test.cypress-runner" -}}
metadata:
labels:
app.kubernetes.io/name: {{ include "nexus.name" . }}
helm.sh/chart: {{ include "nexus.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: nexus-repository-manager
app.kubernetes.io/component: {{ include "nexus.name" . }}
{{- end }}
......@@ -2,9 +2,6 @@
"pluginsFile": false,
"supportFile": false,
"fixturesFolder": false,
"env": {
"nexus_url": "nexus.bigbang.dev"
"fixturesFolder": false
}
}
describe('Basic Nexus', function() {
it('Visit the Nexus sign in page', function() {
cy.visit(Cypress.env('nexus_url'))
cy.contains("Sign in").click()
cy.get('input[name="username"]').type(Cypress.env('nexus_user'))
cy.get('input[name="password"]').type(Cypress.env('nexus_pass'))
cy.get('a[class="x-btn x-unselectable x-box-item x-toolbar-item x-btn-nx-primary-small"]').click()
cy.contains("Next").click()
cy.get('input[name="password"]').type(Cypress.env('nexus_pass_new'))
cy.get('input[name*="nx-password"]').type(Cypress.env('nexus_pass_new'))
cy.contains("Next").click({ force: true })
cy.contains("Disable anonymous access").click({ force: true })
cy.contains("Next").click({ force: true })
cy.contains("Finish").click()
cy.visit(`${Cypress.env('nexus_url')}/#admin/support/status`)
})
})
......@@ -46,7 +46,7 @@ sso:
# -- End of BigBang Additions
ingress:
enabled: true
enabled: false
annotations: {kubernetes.io/ingress.class: nginx}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
......@@ -129,7 +129,8 @@ nexus:
# hostnames:
# - "example.com"
# - "www.example.com"
imagePullSecrets: []
imagePullSecrets:
- name: private-registry
nameOverride: ""
fullnameOverride: ""
......
Cypress tests run headless calling the script cy-run.sh
\ No newline at end of file
describe('Basic prometheus', function() {
it('Visits the prometheus sign in page', function() {
cy.visit(Cypress.env('nexus_url'))
})
})
apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
name: main
namespace: istio-system
spec:
selector:
istio: ingressgateway
servers:
- hosts:
- '*'
port:
name: http
number: 80
protocol: HTTP
tls:
httpsRedirect: true
- hosts:
- '*.bigbang.dev'
port:
name: https
number: 443
protocol: HTTPS
tls:
credentialName: wildcard-cert
mode: SIMPLE
istio:
bbtests:
enabled: true
nexus:
imagePullSecrets:
- name: private-registry-mil
cypress:
artifacts: true
envs:
cypress_nexus_url: "http://nexus-nexus-repository-manager:8081"
cypress_nexus_user: "admin"
cypress_nexus_pass_new: "new_admin_password"
secretEnvs:
- name: cypress_nexus_pass
valueFrom:
secretKeyRef:
name: nexus-repository-manager-secret
key: admin.password
networkPolicies:
enabled: true
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment