-
Notifications
You must be signed in to change notification settings - Fork 417
134 lines (125 loc) · 4.69 KB
/
run_test_case.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
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
jobs:
run_unit_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.23'
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
env:
DEBIAN_FRONTEND: noninteractive
run: |
pip3 install pynng==0.7.2 && 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: Run test case
run: |
make failpoint-enable
go test -trimpath -tags="edgex msgpack script parquet test" --cover -covermode=atomic -coverpkg=./... -coverprofile=coverage.xml $(go list ./... | grep -v "github.com/lf-edge/ekuiper/v2/fvt")
total_coverage=$(go tool cover -func=coverage.xml 2>/dev/null | grep total | awk '{print $3}')
make failpoint-disable
echo "Total coverage: $total_coverage"
- 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: |
go test -trimpath -tags="full" --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@v4
with:
files: coverage.xml,fvt_coverage.xml,jmeter.xml,jmeter_redis.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
verbose: true