Skip to content

Commit

Permalink
chore: add weekly ci (#4176)
Browse files Browse the repository at this point in the history
  • Loading branch information
fraidev authored Sep 11, 2024
1 parent babdebf commit 8c1fda3
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Weekly tests

permissions:
contents: read

concurrency:
group: weekly-${{ github.ref }}
cancel-in-progress: true

on:
schedule:
- cron: "0 0 * * 1"
workflow_dispatch:

jobs:
weekly_longevity:
name: Weekly Longevity test
runs-on: ${{ matrix.os }}
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
rust-target: [x86_64-unknown-linux-musl]
steps:
- uses: actions/checkout@v4
- name: Setup Fluvio
uses: infinyon/fluvio/.github/actions/setup-fluvio@master
with:
version: latest
- name: Run Resume test
timeout-minutes: 60
run: |
FLUVIO_BIN=fluvio INTERACTIONS=100 make resume-test
- name: Run diagnostics
if: failure()
timeout-minutes: 5
run: fluvio cluster diagnostics
- name: Upload diagnostics
uses: actions/upload-artifact@v4
timeout-minutes: 5
if: failure()
with:
name: weekly-longevity.diag
path: diagnostics*.gz
- name: Slack Notification
uses: 8398a7/action-slack@v3
if: ${{ !success() }}
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MATRIX_CONTEXT: ${{ toJson(matrix) }}
10 changes: 10 additions & 0 deletions makefiles/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,16 @@ upgrade-test: build-cli build_k8_image
./tests/upgrade-test.sh
endif

ifeq (${CI},true)
# In CI, we expect all artifacts to already be built and loaded for the script
resume-test:
./tests/local-resume-test.sh
else
# When not in CI (i.e. development), load the dev k8 image before running test
resume-test: build-cli
./tests/local-resume-test.sh
endif

# When running in development, might need to run `cargo clean` to ensure correct fluvio binary is used
validate-release-stable:
./tests/fluvio-validate-release.sh $(VERSION) $(GIT_COMMIT)
Expand Down
55 changes: 55 additions & 0 deletions tests/local-resume-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash

readonly INTERACTIONS=${INTERACTIONS:-5}

function run_test() {
${FLUVIO_BIN} cluster delete --force
${FLUVIO_BIN} cluster start --local

seq 1 10 | parallel -j 10 ${FLUVIO_BIN} topic create test-topic-{}
seq 1 10 | parallel -j 10 ${FLUVIO_BIN} remote register test-remote-{}

${FLUVIO_BIN} cluster shutdown
${FLUVIO_BIN} cluster resume

# Create topic
${FLUVIO_BIN} topic create test-topic-11 # THIS WAS HANGING

TOPIC_LIST=$(${FLUVIO_BIN} topic list 2>/dev/null)
PARTITION_LIST=$(${FLUVIO_BIN} partition list 2>/dev/null)
REMOTE_LIST=$(${FLUVIO_BIN} remote list 2>/dev/null)

# Check if the topic list has 11+1 lines
if [ $(echo "$TOPIC_LIST" | wc -l) -eq 12 ]; then
echo "PASS"
else
echo "FAIL"
exit 1
fi

# Check if the partition list has 11+1 lines
if [ $(echo "$PARTITION_LIST" | wc -l) -eq 12 ]; then
echo "PASS"
else
echo "FAIL"
exit 1
fi

# Check if the remote list has 10+1 lines
if [ $(echo "$REMOTE_LIST" | wc -l) -eq 11 ]; then
echo "PASS"
else
echo "FAIL"
exit 1
fi
}

function main() {
for i in $(seq 1 $INTERACTIONS);
do
echo "INTERATION: $i"
run_test
done
}

main;

0 comments on commit 8c1fda3

Please sign in to comment.