-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
84 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,59 @@ | ||
name: E2E tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test: | ||
name: ${{ matrix.testpath }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
testpath: | ||
- ./tests/e2e/v1alpha1/setup/ | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build Dockerfile | ||
run: docker build . --file Dockerfile --tag rocketmq-operator:e2e | ||
|
||
- name: Install chainsaw | ||
uses: kyverno/chainsaw/.github/actions/[email protected] | ||
with: | ||
release: v0.1.2 | ||
|
||
- name: Check install | ||
run: chainsaw version | ||
|
||
- name: Install kubectl | ||
run: | | ||
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" | ||
chmod +x kubectl | ||
sudo mv kubectl /usr/local/bin/ | ||
- name: Create k8s Kind Cluster | ||
uses: helm/[email protected] | ||
with: | ||
config: tests/_config/kind-config.yaml | ||
cluster_name: kind | ||
|
||
- name: Load Docker image into Kind | ||
run: | | ||
kubectl cluster-info --context kind-kind | ||
kind load docker-image rocketmq-operator:e2e --name kind | ||
- name: Install RocketMQ Operator | ||
run: | | ||
make deploy | ||
kubectl set image deployment/rocketmq-operator manager=rocketmq-operator:e2e -n default | ||
- name: Wait for RocketMQ Operator to be ready | ||
run: | | ||
kubectl wait --for=condition=available --timeout=300s deployment/rocketmq-operator -n default | ||
- name: Run chainsaw test | ||
run: chainsaw test --test-dir ${{ matrix.testpath }} --config tests/_config/chainsaw-configuration.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,14 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/configuration-chainsaw-v1alpha1.json | ||
|
||
apiVersion: chainsaw.kyverno.io/v1alpha1 | ||
kind: Configuration | ||
metadata: | ||
name: chainsaw-configuration | ||
spec: | ||
namespace: default | ||
delayBeforeCleanup: 10s | ||
timeouts: | ||
apply: 5m | ||
delete: 5m | ||
assert: 15m | ||
error: 15m |
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 @@ | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
name: kind | ||
nodes: | ||
- role: control-plane | ||
- role: worker | ||
- role: worker | ||
- role: worker | ||
- role: worker | ||
- role: worker | ||
- role: worker |