UNCLASSIFIED

Commit 4efb432e authored by Branden Cobb's avatar Branden Cobb
Browse files

Merge branch 'helm-test' into 'main'

Helm Tests

See merge request !26
parents 541b4ccc 79c67188
Pipeline #275465 passed with stages
in 3 minutes and 58 seconds
dependencies:
- name: postgresql
repository: file://./deps/postgresql
version: 8.6.4
digest: sha256:ee20a56a481163f172694703dccf40e88ca9f8a5a4b1637f8dce3361f592aed2
generated: "2021-05-07T13:46:34.5689816-06:00"
dependencies: dependencies:
- name: postgresql - name: postgresql
version: 8.6.4 version: 8.6.4
repository: file://charts/postgresql repository: file://./deps/postgresql
condition: postgresql.enabled condition: postgresql.enabled
{{- include "bb-test-lib.cypress-configmap.overrides" (list . "sonarqube-test.cypress-configmap") }}
{{- define "sonarqube-test.cypress-configmap" }}
metadata:
labels:
helm.sh/chart: {{ include "sonarqube.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: sonarqube
{{- end }}
---
{{- include "bb-test-lib.cypress-runner.overrides" (list . "sonarqube-test.cypress-runner") -}}
{{- define "sonarqube-test.cypress-runner" -}}
metadata:
labels:
helm.sh/chart: {{ include "sonarqube.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: sonarqube
{{- end }}
{{- if .Values.tests.enabled -}}
apiVersion: v1
kind: Pod
metadata:
name: "{{ .Release.Name }}-ui-test"
annotations:
"helm.sh/hook": test-success
labels:
app: {{ template "sonarqube.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
initContainers:
- name: "bats"
image: "registry.dso.mil/platform-one/big-bang/apps/developer-tools/sonarqube/bats:1.2.1"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["bash", "-c"]
args:
- |-
set -ex
cp -R /opt/bats /tools/bats/
volumeMounts:
- mountPath: /tools
name: tools
containers:
- name: {{ .Release.Name }}-ui-test
image: {{ default "registry.dso.mil/platform-one/big-bang/apps/developer-tools/sonarqube/minideb-extras:latest" .Values.tests.image }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: [
"/tools/bats/bin/bats",
"--tap",
"/tests/run.sh"]
volumeMounts:
- mountPath: /tests
name: tests
readOnly: true
- mountPath: /tools
name: tools
volumes:
- name: tests
configMap:
name: {{ template "sonarqube.fullname" . }}-tests
- name: tools
emptyDir: {{ toYaml .Values.emptyDir | nindent 6 }}
restartPolicy: Never
{{- end -}}
{
"pluginsFile": false,
"supportFile": false,
"fixturesFolder": false
}
// needs to be fixed
describe('Basic Sonarqube', function() {
it('Check Sonarqube is accessible', function() {
cy.visit(Cypress.env('url'))
cy.get('input[name="login"]').type(Cypress.env('user'))
cy.get('input[name="password"]').type(Cypress.env('password'))
cy.contains("Log in").click()
cy.contains('Update your password')
cy.get('input[name="old_password"]').type(Cypress.env('password'))
cy.get('input[name="password"]').type(Cypress.env('newpassword'))
cy.get('input[name="password_confirmation"]').type(Cypress.env('newpassword'))
cy.get('button[id="change-password"]').click()
cy.scrollTo('topRight')
cy.get('a[class="dropdown-toggle navbar-avatar"]').click()
cy.contains("My Account").click()
cy.contains("Security").click()
cy.get('input[class="input-large spacer-right"]').type('Test Token')
cy.get('button[class="button js-generate-token"]').click()
})
})
...@@ -23,7 +23,8 @@ image: ...@@ -23,7 +23,8 @@ image:
tag: 8.7.1-community-bb tag: 8.7.1-community-bb
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
# If using a private repository, the name of the imagePullSecret to use # If using a private repository, the name of the imagePullSecret to use
pullSecret: [] pullSecret: private-registry
# Set security context for sonarqube pod # Set security context for sonarqube pod
securityContext: securityContext:
......
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