Skip to content

Commit 391bba0

Browse files
committed
Test rabbitmq plugin in GitHub actions
See #440
1 parent 1378269 commit 391bba0

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

.github/workflows/pr.yml

+22
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,25 @@ jobs:
4141
kind create cluster --image kindest/node:"$K8S_VERSION"
4242
DOCKER_REGISTRY_SERVER=local-server OPERATOR_IMAGE=local-operator make deploy-kind
4343
make system-tests
44+
45+
kubectl_tests:
46+
name: kubectl rabbitmq tests
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Install Bats
50+
run: |
51+
git clone https://github.com/bats-core/bats-core.git "$HOME"/bats-core
52+
cd "$HOME"/bats-core
53+
sudo ./install.sh /usr/local
54+
- name: Check out code into the Go module directory
55+
uses: actions/checkout@v2
56+
- name: kubectl rabbitmq tests
57+
env:
58+
K8S_VERSION: v1.19.1
59+
run: |
60+
export GOPATH=$HOME/go
61+
export PATH=$PATH:$GOPATH/bin
62+
make install-tools
63+
kind create cluster --image kindest/node:"$K8S_VERSION"
64+
PATH=$PATH:$(pwd)/bin
65+
kubectl-rabbitmq.bats

bin/kubectl-rabbitmq.bats

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ eventually() {
3030
}
3131

3232
@test "create creates RabbitMQ cluster" {
33-
kubectl rabbitmq create bats-default
33+
kubectl rabbitmq create bats-default \
34+
--unlimited # otherwise scheduling the pod fails on kind in GitHub actions because of insufficient CPU
3435

3536
eventually '[[ $(kubectl get rabbitmqcluster bats-default -o json | jq -r '"'"'.status.conditions | .[] | select(.type=="AllReplicasReady").status'"'"') == "True" ]]' 600
3637
}

0 commit comments

Comments
 (0)