Skip to content

Commit

Permalink
ci: use ktf for ct related tests (Kong#865)
Browse files Browse the repository at this point in the history

Co-authored-by: Travis Raines <[email protected]>
  • Loading branch information
pmalek and rainest authored Aug 17, 2023
1 parent 13fe3b5 commit 7395df1
Show file tree
Hide file tree
Showing 16 changed files with 28 additions and 47 deletions.
23 changes: 8 additions & 15 deletions .github/workflows/main-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ jobs:

lint-test:
runs-on: ubuntu-latest
env:
# Specify this here because these tests rely on ktf to run kind for cluster creation.
KIND_VERSION: v0.20.0
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -61,23 +64,13 @@ jobs:
- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed)
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Run chart-testing (lint)
run: ct lint --check-version-increment=false

- name: Create kind cluster
uses: helm/[email protected]
# if: steps.list-changed.outputs.changed == 'true'
# TODO for some reason, the earlier chart-testing logic is never seeing any changes, though running it locally
# does show changes. This remains a mystery between a lack of any debug logging, but simply running tests
# always is fine
- name: setup testing environment (kind-cluster)
env:
KUBERNETES_VERSION: ${{ matrix.kubernetes-version }}
run: ./scripts/test-env.sh

- name: Run chart-testing (install)
run: ct install --charts charts/kong
Expand All @@ -86,7 +79,7 @@ jobs:
runs-on: ubuntu-latest
env:
# Specify this here because these tests rely on ktf to run kind for cluster creation.
KIND_VERSION: v0.19.0
KIND_VERSION: v0.20.0
strategy:
matrix:
kubernetes-version:
Expand Down
18 changes: 18 additions & 0 deletions charts/kong/ci/admin-api-service-clusterip-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
admin:
enabled: true
type: ClusterIP

# Stub config to make the instance become ready
dblessConfig:
config: |
_format_version: "1.1"
services:
- name: example.com
url: http://example.com
routes:
- name: example
paths:
- "/example"
ingressController:
enabled: false
6 changes: 0 additions & 6 deletions charts/kong/ci/admin-api-service-clusterip.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

# install chart with some extra labels

extraLabels:
acme.com/some-key: some-value

3 changes: 0 additions & 3 deletions charts/kong/ci/default-values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# install chart with default values
proxy:
type: NodePort

env:
anonymous_reports: "off"
ingressController:
Expand Down
1 change: 0 additions & 1 deletion charts/kong/ci/kong-ingress-1-values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# CI test for empty hostname including tls secret using string
proxy:
type: NodePort
ingress:
enabled: true
tls: "kong.proxy.example.secret"
Expand Down
1 change: 0 additions & 1 deletion charts/kong/ci/kong-ingress-2-values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# CI test for hostname including tls secret using string
proxy:
type: NodePort
ingress:
enabled: true
hostname: "proxy.kong.example"
Expand Down
1 change: 0 additions & 1 deletion charts/kong/ci/kong-ingress-3-values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# CI test for using ingress hosts configuration
proxy:
type: NodePort
ingress:
enabled: true
hosts:
Expand Down
1 change: 0 additions & 1 deletion charts/kong/ci/kong-ingress-4-values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# CI test for testing combined ingress hostname and hosts configuration including tls configuraion using slice
proxy:
type: NodePort
ingress:
enabled: true
hostname: "proxy.kong.example"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
# use single image strings instead of repository/tag

image:
unifiedRepoTag: kong:2.6
proxy:
type: NodePort
unifiedRepoTag: kong:3.3

env:
anonymous_reports: "off"
ingressController:
env:
anonymous_reports: "false"
image:
unifiedRepoTag: kong/kubernetes-ingress-controller:2.0.2
unifiedRepoTag: kong/kubernetes-ingress-controller:2.11
3 changes: 0 additions & 3 deletions charts/kong/ci/test-enterprise-version-3.4.0.0-values.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
ingressController:
enabled: false

proxy:
type: NodePort

image:
repository: kong/kong-gateway
tag: "3.4.0.0"
Expand Down
2 changes: 0 additions & 2 deletions charts/kong/ci/test1-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@ podLabels:
environment: test
# - ingress resources are created with hosts
admin:
type: NodePort
ingress:
enabled: true
hostname: admin.kong.example
annotations: {}
path: /
proxy:
type: NodePort
ingress:
enabled: true
hostname: proxy.kong.example
Expand Down
2 changes: 0 additions & 2 deletions charts/kong/ci/test2-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ env:
database: "postgres"
# - ingress resources are created without hosts
admin:
type: NodePort
ingress:
enabled: true
hosts: []
path: /
proxy:
type: NodePort
ingress:
enabled: true
hostname: proxy.kong.example
Expand Down
2 changes: 0 additions & 2 deletions charts/kong/ci/test3-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ env:
database: "off"
postgresql:
enabled: false
proxy:
type: NodePort
deployment:
initContainers:
- name: "bash"
Expand Down
1 change: 0 additions & 1 deletion charts/kong/ci/test4-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ env:
postgresql:
enabled: false
proxy:
type: NodePort
# - add stream listens
stream:
- containerPort: 9000
Expand Down
2 changes: 0 additions & 2 deletions charts/kong/ci/test5-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@ customEnv:
client_id: "exampleId"
# - ingress resources are created without hosts
admin:
type: NodePort
ingress:
enabled: true
hosts: []
path: /
proxy:
type: NodePort
ingress:
enabled: true
hostname: proxy.kong.example
Expand Down

0 comments on commit 7395df1

Please sign in to comment.