Skip to content

Commit

Permalink
ci: add Fuzz Test for distributed mode
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed May 20, 2024
1 parent 2b0ffa2 commit 5fdd2bf
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 24 deletions.
23 changes: 23 additions & 0 deletions .github/actions/setup-etcd-cluster/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Setup Etcd cluster
description: Deploy Etcd cluster on Kubernetes
inputs:
etcd-replica-count:
default: 1
description: "Etcd replica count"
namespace:
default: "etcd-cluster"

runs:
using: composite
steps:
- name: Install etcd cluster
shell: bash
run: |
helm upgrade \
--install etcd oci://registry-1.docker.io/bitnamicharts/etcd \
--set replicaCount=${{ inputs.etcd-replica-count }} \
--set auth.rbac.create=false \
--set auth.rbac.token.enabled=false \
--set persistence.size=1Gi \
--create-namespace \
-n ${{ input.namespace }}
27 changes: 4 additions & 23 deletions .github/actions/setup-greptimedb-cluster/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ inputs:
image-tag:
default: "latest"
description: 'Image tag'
etcd-endpoints:
default: "etcd.etcd-cluster.svc.cluster.local:2379"
description: "Etcd endpoints"

runs:
using: composite
Expand All @@ -36,34 +39,12 @@ runs:
--create-namespace \
greptimedb-operator greptime/greptimedb-operator \
-n greptimedb-admin
- name: Install etcd cluster
shell: bash
run: |
helm upgrade \
--install etcd oci://registry-1.docker.io/bitnamicharts/etcd \
--set replicaCount=${{ inputs.etcd-replica-count }} \
--set auth.rbac.create=false \
--set auth.rbac.token.enabled=false \
--set persistence.size=1Gi \
--create-namespace \
-n etcd-cluster
- name: Wait for etcd
shell: bash
run: |
kubectl wait \
--for=condition=Ready \
pod -l app.kubernetes.io/instance=etcd \
--timeout=120s \
-n etcd-cluster
- name: Print etcd info
shell: bash
run: kubectl get all --show-labels -n etcd-cluster
- name: Install GreptimeDB cluster
shell: bash
run: |
helm upgrade \
--install my-greptimedb \
--set meta.etcdEndpoints=etcd.etcd-cluster.svc.cluster.local:2379 \
--set meta.etcdEndpoints=${{ inputs.etcd-endpoints }} \
--set image.registry=${{ inputs.image-registry }} \
--set image.repository=${{ inputs.image-repository }} \
--set image.tag=${{ inputs.image-tag }} \
Expand Down
29 changes: 28 additions & 1 deletion .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,26 +270,53 @@ jobs:
artifacts-dir: bin
version: current

e2e:
distributed-fuzztest:
name: Fuzz Test (Distributed)
runs-on: ubuntu-latest
needs: build-greptime-ci
strategy:
matrix:
target: [ "fuzz_create_table", "fuzz_alter_table", "fuzz_create_database", "fuzz_create_logical_table", "fuzz_alter_logical_table", "fuzz_insert", "fuzz_insert_logical_table" ]
steps:
- uses: actions/checkout@v4
- name: Setup Kind
uses: ./.github/actions/setup-kind
- name: Setup Etcd cluser
uses: ./.github/actions/setup-etcd-cluster
- name: Download pre-built binariy
uses: actions/download-artifact@v4
with:
name: bin
path: .
- name: Unzip binary
run: tar -xvf ./bin.tar.gz
- name: Wait for etcd
run: |
kubectl wait \
--for=condition=Ready \
pod -l app.kubernetes.io/instance=etcd \
--timeout=120s \
-n etcd-cluster
- name: Print etcd info
shell: bash
run: kubectl get all --show-labels -n etcd-cluster
- name: Build and push GreptimeDB image
uses: ./.github/actions/build-and-push-ci-image
- name: Setup GreptimeDB cluster
uses: ./.github/actions/setup-greptimedb-cluster
with:
image-registry: localhost:5001
- name: Port forward (mysql)
run: |
kubectl port-forward service/my-greptimedb-frontend 4002:4002 -n my-greptimedb&
- name: Fuzz Test
uses: ./.github/actions/fuzz-test
env:
CUSTOM_LIBFUZZER_PATH: /usr/lib/llvm-14/lib/libFuzzer.a
GT_MYSQL_ADDR: 127.0.0.1:4002
with:
target: ${{ matrix.target }}
max-total-time: 120

sqlness:
name: Sqlness Test
Expand Down

0 comments on commit 5fdd2bf

Please sign in to comment.