forked from IGinX-THU/IGinX
-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (101 loc) · 4.23 KB
/
assembly-test.yml
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
name: "Assembly Package Test"
on:
workflow_call:
inputs:
java-matrix:
description: "The java version to run the test on"
type: string
required: false
default: '["8"]'
python-matrix:
description: "The python version to run the test on"
type: string
required: false
default: '["3.11"]'
os-matrix:
description: "The operating system to run the test on"
type: string
required: false
default: '["ubuntu-latest", "macos-latest", "windows-latest"]'
env:
FUNCTEST: SQLSessionIT#testShowColumns
jobs:
assembly-include-test:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
java: ${{ fromJSON(inputs.java-matrix) }}
python-version: ${{ fromJSON(inputs.python-matrix) }}
os: ${{ fromJSON(inputs.os-matrix) }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Environment dependence
uses: ./.github/actions/dependence
with:
python-version: ${{ matrix.python-version }}
java: ${{ matrix.java }}
- name: assembly include package
run: mvn clean package -D skipTests -P-format -P release
- name: Setup Platform Dependence
id: platform
shell: bash
run: |
SUFFIX="sh"
if [ "$RUNNER_OS" == "macOS" ]; then
brew install tree
elif [ "$RUNNER_OS" == "Windows" ]; then
choco install tree
SUFFIX="bat"
fi
echo "suffix=$SUFFIX" >> $GITHUB_OUTPUT
- name: Save Origin Workspace Tree
run: tree assembly/target/iginx-assembly-${{ env.VERSION }}-include >origin-tree.txt
- name: Run IGinX include Zookeeper with Pemjax
run: |
cd assembly/target/iginx-assembly-${{ env.VERSION }}-include
./runIGinXOn1HostWithPemjax.${{ steps.platform.outputs.suffix }}
sleep 10
- name: Get Cluster Info
shell: bash
run: |
./client/target/iginx-client-${{ env.VERSION }}/sbin/start_cli.${{ steps.platform.outputs.suffix }} -e "show cluster info;" > cluster-info.txt
cat cluster-info.txt
LINE_COUNT=$(wc -l < cluster-info.txt)
if [ $LINE_COUNT -ne 19 ]; then
echo "Cluster info is not 19 lines"
exit 1
fi
- name: Run Tests
shell: bash -el {0}
run: mvn test -Dtest=${{ env.FUNCTEST }} -DfailIfNoTests=false -P-format
- name: Check Whether Logs Contains Error
shell: bash
run: |
cd assembly/target/iginx-assembly-${{ env.VERSION }}-include
if grep "ERROR" sbin/logs/iginx-latest.log; then
echo "Error found in log"
exit 1
fi
- name: Show IGinX Log
if: always()
run: cat assembly/target/iginx-assembly-${{ env.VERSION }}-include/sbin/logs/iginx-latest.log
- name: Clean Up
run: |
cd assembly/target/iginx-assembly-${{ env.VERSION }}-include
./stopIGinX.${{ steps.platform.outputs.suffix }}
./clearAllData.${{ steps.platform.outputs.suffix }}
- name: Save Final Workspace Tree
run: tree assembly/target/iginx-assembly-${{ env.VERSION }}-include >final-tree.txt
- name: Compare Workspace Tree to Ensure Clean Up
shell: bash
run: |
diff origin-tree.txt final-tree.txt
exit $?
- name: Show Origin Workspace Tree
if: always()
run: cat origin-tree.txt
- name: Show Final Workspace Tree
if: always()
run: cat final-tree.txt