Skip to content

Commit

Permalink
Test 'latest' docker images against the chart plus refactoring (#37)
Browse files Browse the repository at this point in the history
* Merge connection tests into one file

* Small comment in the connection test yaml to explain what's going on

* Simplify the mongo ci values file to clarify what's being tested

* A test to pull the 'latest' docker images rather than the version fixed to the chart

* Newline to appease the linter

* Futher linter pacification

* Chart version increase
  • Loading branch information
tico24 authored Feb 3, 2021
1 parent 9f1ad34 commit 7b28cdf
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 237 deletions.
2 changes: 1 addition & 1 deletion charts/sorry-cypress/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: sorry-cypress
description: A Helm chart for Sorry Cypress
type: application
version: 0.1.31
version: 0.1.32
appVersion: 0.6.1
home: https://sorry-cypress.dev/
sources:
Expand Down
19 changes: 19 additions & 0 deletions charts/sorry-cypress/ci/latest-image-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Pulls the latest docker image and tests that the chart still works with them.

api:
image:
repository: agoldis/sorry-cypress-api
pullPolicy: Always
tag: "latest"

dashboard:
image:
repository: agoldis/sorry-cypress-dashboard
pullPolicy: Always
tag: "latest"

director:
image:
repository: agoldis/sorry-cypress-director
pullPolicy: Always
tag: "latest"
2 changes: 2 additions & 0 deletions charts/sorry-cypress/ci/minio-values.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# Enables minio for testing

minio:
enabled: true
215 changes: 1 addition & 214 deletions charts/sorry-cypress/ci/mongo-values.yaml
Original file line number Diff line number Diff line change
@@ -1,220 +1,7 @@
# Default values for sorry-cypress-helm.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

api:
image:
repository: agoldis/sorry-cypress-api
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
# tag: "latest"

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

service:
port: 4000

# Set annotations for pods
podAnnotations: {}

# Additional pod labels
podLabels: {}

ingress:
labels: {}
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: api.chart-example.local
path: /
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

dashboard:
image:
repository: agoldis/sorry-cypress-dashboard
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
# tag: "latest"

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

# https://sorry-cypress.dev/dashboard#configuration
environmentVariables:
graphQlClientCredentials: ""
graphQlSchemaUrl: ""
ciUrl: ""

service:
port: 8080

# Set annotations for pods
podAnnotations: {}

# Additional pod labels
podLabels: {}

ingress:
enabled: true
labels: {}
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: dashboard.chart-example.local
path: /
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

# Enables mongo for testing
director:
image:
repository: agoldis/sorry-cypress-director
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
# tag: "latest"

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

environmentVariables:
# The "Run URL" in the Cypress client
dashboardUrl: ""

# In memory, or Mongo.
# Valid options are:
# "../execution/in-memory"
# "../execution/mongo/driver"
executionDriver: "../execution/mongo/driver"

# Dummy or S3
# Valid options are:
# "../screenshots/dummy.driver"
# "../screenshots/s3.driver"
screenshotsDriver: "../screenshots/dummy.driver"

# https://sorry-cypress.dev/director/configuration
allowedKeys: ""

# Set annotations for pods
podAnnotations: {}

# Additional pod labels
podLabels: {}

service:
port: 1234

ingress:
enabled: true
labels: {}
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: director.chart-example.local
path: /
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

mongo:
# You need to ensure that director.environmentVariables.executionDriver is set to "../execution/mongo/driver" if you want mongo.enabled to be true.
enabled: true

mongoDatabase: "sorry-cypress"

# Ignored if mongo.enabled is set to true
mongoServer: ""

image:
repository: mongo
pullPolicy: Always
tag: "4.0"

persistence:
enabled: false
accessMode: "ReadWriteOnce"
size: "1Gi"

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

# Set annotations for pods
podAnnotations: {}

# Additional pod labels
podLabels: {}

service:
port: 27017

s3:
bucketName: example-bucket
region: us-east-1
accessKeyId: ""
secretAccessKey: ""
acl: "public-read"
readUrlPrefix: ""

ingress:
# When enabling ingress, an ExternalName service will be also created to expose the bucket.
enabled: false
labels: {}
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
# nginx.ingress.kubernetes.io/upstream-vhost: <bucket>.s3-website-<region>.amazonaws.com
# nginx.ingress.kubernetes.io/enable-cors: "true"
# nginx.ingress.kubernetes.io/cors-allow-origin: "*"
# nginx.ingress.kubernetes.io/cors-allow-methods: "POST, GET, PUT, DELETE, HEAD"
hosts:
- host: static.chart-example.local
path: /
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
20 changes: 0 additions & 20 deletions charts/sorry-cypress/templates/test/minio-connect.yaml

This file was deleted.

26 changes: 24 additions & 2 deletions charts/sorry-cypress/templates/test/test-connections.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# A very basic set of tests to query that the appropriate services work and connect to a pod as long as they are enabled in the Vales.yaml file

apiVersion: v1
kind: Pod
metadata:
Expand Down Expand Up @@ -50,5 +52,25 @@ spec:
args: ['{{ include "sorry-cypress-helm.fullname" . }}-mongo:{{ .Values.mongo.service.port }}']
restartPolicy: Never
{{- end }}

# Note. Not testing API yet.. can't do a 'get' on that unless there's a nice secret healthz path hidden somewhere.
---
{{- if .Values.minio.enabled }}
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "sorry-cypress-helm.fullname" . }}-test-minio-connection"
labels:
app.kubernetes.io/name: "{{ include "sorry-cypress-helm.fullname" . }}-test-minio-connection"
annotations:
"helm.sh/hook": test-success
"helm.sh/hook-delete-policy": hook-succeeded
spec:
containers:
- name: wget
image: busybox
command:
- wget
- "-U Mozilla"
- "{{ include "sorry-cypress-helm.fullname" . }}-minio:9000/minio/login"
restartPolicy: Never
{{- end }}
# Note. Not testing API yet.. can't do a 'get' on that unless there's a nice secret healthz path hidden somewhere.

0 comments on commit 7b28cdf

Please sign in to comment.