-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide e2e testing based on kuttl (#154)
* feat: add e2e testing workflow with kuttl
- Loading branch information
1 parent
92c4598
commit f0a2c98
Showing
11 changed files
with
162 additions
and
0 deletions.
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,29 @@ | ||
name: e2e | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
e2e: | ||
name: e2e | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: install kuttl | ||
run: | | ||
curl -L https://github.com/kudobuilder/kuttl/releases/download/v0.15.0/kubectl-kuttl_0.15.0_linux_x86_64 -o /usr/local/bin/kubectl-kuttl | ||
chmod +x /usr/local/bin/kubectl-kuttl | ||
- name: create kind cluster | ||
uses: helm/[email protected] | ||
|
||
- name: set up helm | ||
uses: azure/setup-helm@v3 | ||
|
||
- name: run e2e test | ||
run: kubectl kuttl test |
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,7 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestSuite | ||
testDirs: | ||
- tests/ | ||
commands: | ||
- command: kubectl apply -f ./deploy/crds.yml | ||
timeout: 120 |
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,7 @@ | ||
jetstream: | ||
enabled: true | ||
|
||
nats: | ||
url: nats://nats:4222 | ||
|
||
namespaced: true |
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,27 @@ | ||
--- | ||
global: | ||
labels: | ||
app: main-jetstream | ||
|
||
natsBox: | ||
enabled: false | ||
|
||
config: | ||
cluster: | ||
enabled: false | ||
|
||
gateway: | ||
enabled: false | ||
|
||
jetstream: | ||
enabled: true | ||
|
||
memoryStore: | ||
enabled: true | ||
maxSize: 256Mi | ||
|
||
memoryStore: | ||
enabled: true | ||
pvc: | ||
enabled: true | ||
size: 256Mi |
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,11 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
unitTest: false | ||
commands: | ||
- command: helm uninstall --namespace $NAMESPACE nats | ||
ignoreFailure: true | ||
- command: helm uninstall --namespace $NAMESPACE nack | ||
ignoreFailure: true | ||
- command: helm repo add nats https://nats-io.github.io/k8s/helm/charts | ||
- command: helm upgrade --install --wait --namespace $NAMESPACE nats nats/nats -f ../nats.yaml | ||
- command: helm upgrade --install --wait --namespace $NAMESPACE nack nats/nack -f ../nack.yaml |
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,7 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
apply: | ||
- rides-stream.yaml | ||
assert: | ||
- asserted-rides-stream.yaml | ||
unitTest: false |
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,7 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
apply: | ||
- natscli.yaml | ||
assert: | ||
- asserted-natscli.yaml | ||
unitTest: false |
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,8 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
labels: | ||
run: natscli | ||
name: natscli | ||
status: | ||
phase: Succeeded |
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,30 @@ | ||
apiVersion: jetstream.nats.io/v1beta2 | ||
kind: Stream | ||
metadata: | ||
name: rides | ||
spec: | ||
allowDirect: false | ||
allowRollup: false | ||
compression: "" | ||
creds: "" | ||
denyDelete: false | ||
discard: old | ||
discardPerSubject: false | ||
firstSequence: 0 | ||
maxAge: "" | ||
maxBytes: -1 | ||
maxConsumers: -1 | ||
maxMsgSize: -1 | ||
maxMsgs: -1 | ||
maxMsgsPerSubject: 0 | ||
name: rides | ||
nkey: "" | ||
noAck: false | ||
preventDelete: false | ||
preventUpdate: false | ||
replicas: 1 | ||
retention: limits | ||
servers: [] | ||
storage: memory | ||
subjects: | ||
- rides.> |
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,19 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
labels: | ||
run: natscli | ||
name: natscli | ||
spec: | ||
restartPolicy: Never | ||
containers: | ||
- image: natsio/nats-box | ||
name: natscli | ||
command: | ||
- nats | ||
args: | ||
- -s | ||
- nats://nats:4222 | ||
- stream | ||
- info | ||
- rides |
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,10 @@ | ||
apiVersion: jetstream.nats.io/v1beta2 | ||
kind: Stream | ||
metadata: | ||
name: rides | ||
spec: | ||
name: rides | ||
subjects: | ||
- "rides.>" | ||
storage: memory | ||
replicas: 1 |