-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: (CCIE-3082) add unit testing to GHA #64
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0df68d8
ignore test files
dtsai-czi 65c59e5
label helmignore
dtsai-czi e4de753
enable a service for testing
dtsai-czi 51b3432
dedicated test values
dtsai-czi 535e960
point to test values
dtsai-czi 4996c4b
add gha
dtsai-czi dbc8f68
use set instead of value file
dtsai-czi e73d442
fix typo
dtsai-czi 428d1b9
remove test value file
dtsai-czi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Unit testing | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
unittest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: d3adb5/helm-unittest-action@v2 | ||
with: | ||
helm-version: v3.8.0 | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
|
@@ -21,3 +21,5 @@ | |
.idea/ | ||
*.tmproj | ||
.vscode/ | ||
# testing | ||
tests |
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,24 @@ | ||
suite: test deployment | ||
templates: | ||
- deployment.yaml | ||
tests: | ||
- it: should work | ||
values: | ||
- values.yaml | ||
asserts: | ||
- isKind: | ||
of: Deployment | ||
- isSubset: | ||
path: spec | ||
content: | ||
revisionHistoryLimit: 3 | ||
any: true | ||
- containsDocument: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
|
||
# path: metadata.name | ||
# pattern: -my-chart$ | ||
# - equal: | ||
# path: spec.template.spec.containers[0].image | ||
# value: nginx:latest |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be removed now, right? |
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,219 @@ | ||
# Service defaults | ||
global: | ||
deploymentStage: "" | ||
replicaCount: 1 | ||
|
||
# Settings for the primary container | ||
image: | ||
repository: nginx | ||
pullPolicy: IfNotPresent | ||
tag: "latest" | ||
|
||
args: [] | ||
command: [] | ||
|
||
imagePullSecrets: [] | ||
nameOverride: "" | ||
fullnameOverride: "" | ||
|
||
dnsPolicy: ClusterFirst | ||
restartPolicy: Always | ||
|
||
# Probes for the primary container | ||
livenessProbe: | ||
failureThreshold: 3 | ||
httpGet: | ||
path: / | ||
port: http | ||
scheme: HTTP | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
timeoutSeconds: 1 | ||
initialDelaySeconds: 30 | ||
readinessProbe: | ||
failureThreshold: 3 | ||
httpGet: | ||
path: / | ||
port: http | ||
scheme: HTTP | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
timeoutSeconds: 1 | ||
initialDelaySeconds: 30 | ||
startupProbe: | ||
enabled: false | ||
failureThreshold: 3 | ||
successThreshold: 1 | ||
initialDelaySeconds: 0 | ||
timeoutSeconds: 1 | ||
periodSeconds: 10 | ||
exec: | ||
command: | ||
- ps | ||
- "-ef" | ||
|
||
progressDeadlineSeconds: 600 | ||
|
||
resources: | ||
limits: | ||
cpu: "1" | ||
memory: "1Gi" | ||
requests: | ||
cpu: "100m" | ||
memory: "128Mi" | ||
|
||
service: | ||
type: ClusterIP | ||
port: 80 | ||
|
||
initContainers: [] | ||
sidecars: [] | ||
|
||
appContext: | ||
envContextConfigMapName: "" # App environment level configuration configmap name | ||
stackContextConfigMapName: "" # Stack level configuration configmap name | ||
|
||
appSecrets: | ||
envSecret: # App environment level configuration secret | ||
secretName: "" | ||
secretKey: "" | ||
stackSecret: # Stack level configuration secret | ||
secretName: "" | ||
secretKey: "" | ||
|
||
# Global annotations to add to all resources | ||
annotations: {} | ||
# Labels to add to pods | ||
podLabels: {} | ||
|
||
serviceAccount: | ||
# Specifies whether a service account should be created | ||
create: false | ||
# Automatically mount a ServiceAccount's API credentials? | ||
automount: true | ||
# Annotations to add to the service account | ||
annotations: {} | ||
# The name of the service account to use. | ||
# If not set and create is true, a name is generated using the fullname template | ||
name: "" | ||
|
||
podSecurityContext: | ||
{} | ||
# fsGroup: 2000 | ||
|
||
securityContext: | ||
{} | ||
# capabilities: | ||
# drop: | ||
# - ALL | ||
# readOnlyRootFilesystem: true | ||
# runAsNonRoot: true | ||
# runAsUser: 1000 | ||
|
||
ingress: | ||
enabled: true | ||
className: nginx | ||
host: chart-example.local | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
rules: [] | ||
annotations: | ||
infra: "true" | ||
external-dns.alpha.kubernetes.io/exclude: "true" | ||
cert-manager.io/cluster-issue: nginx-issuer | ||
nginx.ingress.kubernetes.io/proxy-connect-timeout: "60" | ||
nginx.ingress.kubernetes.io/proxy-send-timeout: "60" | ||
nginx.ingress.kubernetes.io/proxy-read-timeout: "60" | ||
nginx.ingress.kubernetes.io/affinity: "cookie" | ||
nginx.ingress.kubernetes.io/session-cookie-name: "argus_sticky_session" | ||
nginx.ingress.kubernetes.io/session-cookie-max-age: "600" | ||
tls: [] | ||
# - secretName: chart-example-tls | ||
# hosts: | ||
# - chart-example.local | ||
nodeSelector: | ||
kubernetes.io/arch: arm64 | ||
|
||
# Annotations to add to pods | ||
podAnnotations: | ||
linkerd.io/inject: enabled | ||
config.linkerd.io/skip-outbound-ports: 3306,5432,6379,9300,11211,4444,4567,4568,587,25,2525,465,2465 | ||
|
||
autoscaling: | ||
enabled: true | ||
minReplicas: 1 | ||
maxReplicas: 10 | ||
targetCPUUtilizationPercentage: 80 | ||
targetMemoryUtilizationPercentage: 80 | ||
|
||
# Additional volumes on the output Deployment definition. | ||
volumes: [] | ||
# - name: foo | ||
# secret: | ||
# secretName: mysecret | ||
# optional: false | ||
|
||
# Additional volumeMounts on the output Deployment definition. | ||
volumeMounts: [] | ||
# - name: foo | ||
# mountPath: "/etc/foo" | ||
# readOnly: true | ||
|
||
tolerations: [] | ||
|
||
affinity: {} | ||
|
||
topologySpreadConstraints: [] | ||
|
||
env: [] | ||
envFrom: [] | ||
|
||
# Service overrides | ||
services: | ||
# {} | ||
service1: | ||
args: ["arg1", "arg2"] | ||
command: ["command1", "command2"] | ||
autoscaling: | ||
enabled: true | ||
minReplicas: 2 | ||
maxReplicas: 10 | ||
maxUnavailable: 1 | ||
replicaCount: 2 | ||
sidecars: | ||
- name: sidecar1 | ||
image: "sidecar1:latest" | ||
- name: sidecar2 | ||
image: "sidecar2:latest" | ||
initContainers: | ||
- name: initContainer1 | ||
image: "alpine:latest" | ||
command: ["echo", "Hello World"] | ||
# service2: | ||
# startupProbe: | ||
# enabled: true | ||
# autoscaling: | ||
# enabled: true | ||
# minReplicas: 2 | ||
# maxReplicas: 10 | ||
# maxUnavailable: 1 | ||
# replicaCount: 2 | ||
# sidecars: | ||
# - name: sidecar3 | ||
# image: sidecar3:latest | ||
# - name: sidecar4 | ||
# image: sidecar4:latest | ||
|
||
cronJobs: | ||
{} | ||
# cronJob1: | ||
# concurrencyPolicy: Forbid | ||
# schedule: "* * * * *" | ||
# image: | ||
# repository: nginx | ||
# pullPolicy: IfNotPresent | ||
# tag: "latest" | ||
# command: ["command1", "command2"] | ||
# args: ["arg1", "arg2"] | ||
# bump5 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use
set
instead ofvalues
for this test so we can just get a minimal test running