feat(pb): support schemas from a directory #11415
This file contains hidden or 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
| name: Run test cases | |
| concurrency: | |
| group: test-${{ github.event_name }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| tags: | |
| - "*" | |
| branches: | |
| - master | |
| pull_request: | |
| paths-ignore: | |
| - "docs/**" | |
| release: | |
| types: | |
| - published | |
| permissions: | |
| contents: read | |
| jobs: | |
| run_unit_tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25.4' | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| env: | |
| DEBIAN_FRONTEND: noninteractive | |
| run: | | |
| pip3 install pynng==0.8.1 && sudo apt-get update && sudo apt-get install ffmpeg libzmq3-dev -y | |
| - name: make install.sh executable | |
| run: chmod +x ./extensions/functions/onnx/install.sh | |
| - name: Build plugins | |
| run: | | |
| set -e -u -x | |
| mkdir -p data | |
| mkdir -p log | |
| mkdir -p plugins/sinks plugins/sources plugins/functions | |
| sed -i -r "s/debug: .*/debug: true/1" etc/kuiper.yaml | |
| go build --buildmode=plugin -trimpath --cover -covermode=atomic -coverpkg=./... -o plugins/sources/Random@v2.0.0.so extensions/sources/random/random.go | |
| cp extensions/sources/random/random.yaml etc/sources/random.yaml | |
| go build --buildmode=plugin -trimpath --cover -covermode=atomic -coverpkg=./... -o plugins/functions/Echo.so extensions/functions/echo/echo.go | |
| go build --buildmode=plugin -trimpath --cover -covermode=atomic -coverpkg=./... -o plugins/functions/CountPlusOne@v1.0.0.so extensions/functions/countPlusOne/countPlusOne.go | |
| go build --buildmode=plugin -trimpath --cover -covermode=atomic -coverpkg=./... -o plugins/functions/AccumulateWordCount@v1.0.0.so extensions/functions/accumulateWordCount/accumulateWordCount.go | |
| mkdir -p plugins/portable/mirror | |
| cd sdk/go/example/mirror | |
| go build -o ../../../../plugins/portable/mirror/mirror . | |
| cp mirror.json ../../../../plugins/portable/mirror | |
| cd ../../../../ | |
| cp -r sdk/python/ekuiper sdk/python/example/pysam/ | |
| cp test/lookup.json data/lookup.json | |
| cd extensions/functions/onnx | |
| sudo ./install.sh | |
| - name: Install Merge Tool | |
| run: go install github.com/wadey/gocovmerge@latest | |
| - name: Run test case | |
| run: | | |
| make failpoint-enable | |
| # 1. Run MAIN tests (With Race) | |
| # We ADD -skip to avoid running the special tests here | |
| go test -trimpath -race -tags="edgex msgpack script parquet test rpc" \ | |
| -skip "TestMsgpackService|TestExtensions|TestFuncState|TestFuncStateCheckpoint|TestStartCPUProfiling" \ | |
| -cover -covermode=atomic -coverpkg=./... -coverprofile=cover_race.out \ | |
| $(go list ./... | grep -v "github.com/lf-edge/ekuiper/v2/fvt") | |
| # 2. Run SPECIAL tests (No Race) | |
| go test -trimpath -tags="edgex msgpack script parquet test rpc" \ | |
| -run "TestMsgpackService|TestExtensions|TestFuncState|TestFuncStateCheckpoint|TestStartCPUProfiling" \ | |
| -cover -covermode=atomic -coverpkg=./... -coverprofile=cover_norace.out \ | |
| ./internal/service ./internal/topo/exttest ./internal/server/proftest | |
| # 3. Safe Merge using gocovmerge | |
| # This correctly sums up the counters for shared code | |
| $HOME/go/bin/gocovmerge cover_race.out cover_norace.out > coverage.xml | |
| # 4. Calculate Total | |
| total_coverage=$(go tool cover -func=coverage.xml 2>/dev/null | grep total | awk '{print $3}') | |
| echo "Total coverage: $total_coverage" | |
| # 5. Ensure failpoints disable even if tests fail | |
| - name: Cleanup Failpoints | |
| if: always() # Runs even if previous step failed | |
| run: make failpoint-disable | |
| - uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: stream.log | |
| path: log/stream.log | |
| - name: upload coverage report for ut | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage | |
| path: coverage.xml | |
| - name: Clean plugins | |
| run: | | |
| rm -r plugins/portable/mirror | |
| - name: Run fvt | |
| run: | | |
| export KUIPER__BASIC__ALLOWEXTERNALFILEACCESS="true" | |
| go test -trimpath -race -tags="full deadlock" --cover -covermode=atomic -coverpkg=./... -coverprofile=fvt_coverage.xml ./fvt | |
| total_coverage=$(go tool cover -func=coverage.xml 2>/dev/null | grep total | awk '{print $3}') | |
| echo "Total coverage: $total_coverage" | |
| - uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: streamFvt.log | |
| path: log/stream.log | |
| - name: upload coverage report for fvt | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: fvt_coverage | |
| path: fvt_coverage.xml | |
| run_fvt_tests: | |
| uses: ./.github/workflows/run_fvt_tests.yaml | |
| upload_coverage: | |
| needs: | |
| - run_unit_tests | |
| - run_fvt_tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download ut coverage reports | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: coverage | |
| path: ./ | |
| - name: Download fvt coverage reports | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: fvt_coverage | |
| path: ./ | |
| - name: Download jmeter coverage reports | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: jmeter_coverage | |
| path: ./ | |
| - name: Download jmeter redis coverage reports | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: jmeter_redis_coverage | |
| path: ./ | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: coverage.xml,fvt_coverage.xml,jmeter.xml,jmeter_redis.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| version: v10.2.1 | |
| verbose: true |