Skip to content

Commit bc0bb4c

Browse files
committed
add test to check assembly package
1 parent cf70e1f commit bc0bb4c

File tree

3 files changed

+120
-0
lines changed

3 files changed

+120
-0
lines changed

.github/workflows/assembly-test.yml

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: "Assembly Package Test"
2+
on:
3+
workflow_call:
4+
inputs:
5+
java-matrix:
6+
description: "The java version to run the test on"
7+
type: string
8+
required: false
9+
default: '["8"]'
10+
python-matrix:
11+
description: "The python version to run the test on"
12+
type: string
13+
required: false
14+
default: '["3.9"]'
15+
os-matrix:
16+
description: "The operating system to run the test on"
17+
type: string
18+
required: false
19+
default: '["ubuntu-latest", "macos-13", "windows-latest"]'
20+
21+
env:
22+
FUNCTEST: SQLSessionIT#testShowColumns
23+
24+
jobs:
25+
assembly-include-test:
26+
timeout-minutes: 30
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
java: ${{ fromJSON(inputs.java-matrix) }}
31+
python-version: ${{ fromJSON(inputs.python-matrix) }}
32+
os: ${{ fromJSON(inputs.os-matrix) }}
33+
runs-on: ${{ matrix.os }}
34+
steps:
35+
- uses: actions/checkout@v2
36+
- name: Environment dependence
37+
uses: ./.github/actions/dependence
38+
with:
39+
python-version: ${{ matrix.python-version }}
40+
java: ${{ matrix.java }}
41+
42+
- name: assembly include package
43+
run: mvn clean package -D skipTests -P !format -P release
44+
45+
- name: Setup Platform Dependence
46+
id: platform
47+
shell: bash
48+
run: |
49+
SUFFIX="sh"
50+
if [ "$RUNNER_OS" == "macOS" ]; then
51+
brew install tree
52+
elif [ "$RUNNER_OS" == "Windows" ]; then
53+
choco install tree
54+
SUFFIX="bat"
55+
fi
56+
echo "suffix=$SUFFIX" >> $GITHUB_OUTPUT
57+
58+
- name: Save Origin Workspace Tree
59+
run: tree assembly/target/iginx-assembly-${{ env.VERSION }}-include >origin-tree.txt
60+
61+
- name: Run IGinX include Zookeeper with Pemjax
62+
run: |
63+
cd assembly/target/iginx-assembly-${{ env.VERSION }}-include
64+
./runIGinXOn1HostWithPemjax.${{ steps.platform.outputs.suffix }}
65+
sleep 10
66+
67+
- name: Get Cluster Info
68+
shell: bash
69+
run: |
70+
./client/target/iginx-client-0.7.0-SNAPSHOT/sbin/start_cli.${{ steps.platform.outputs.suffix }} -e "show cluster info;" > cluster-info.txt
71+
cat cluster-info.txt
72+
LINE_COUNT=$(wc -l < cluster-info.txt)
73+
if [ $LINE_COUNT -ne 19 ]; then
74+
echo "Cluster info is not 19 lines"
75+
exit 1
76+
fi
77+
78+
- name: Run Tests
79+
shell: bash
80+
run: mvn test -Dtest=${{ env.FUNCTEST }} -DfailIfNoTests=false -P !format
81+
82+
- name: Check Whether Logs Contains Error
83+
shell: bash
84+
run: |
85+
cd assembly/target/iginx-assembly-${{ env.VERSION }}-include
86+
if grep "ERROR" sbin/logs/iginx-latest.log; then
87+
echo "Error found in log"
88+
exit 1
89+
fi
90+
91+
- name: Show IGinX Log
92+
if: always()
93+
run: cat assembly/target/iginx-assembly-${{ env.VERSION }}-include/sbin/logs/iginx-latest.log
94+
95+
- name: Clean Up
96+
run: |
97+
cd assembly/target/iginx-assembly-${{ env.VERSION }}-include
98+
./stopIGinX.${{ steps.platform.outputs.suffix }}
99+
./clearAllData.${{ steps.platform.outputs.suffix }}
100+
101+
- name: Save Final Workspace Tree
102+
run: tree assembly/target/iginx-assembly-${{ env.VERSION }}-include >final-tree.txt
103+
104+
- name: Compare Workspace Tree to Ensure Clean Up
105+
shell: bash
106+
run: |
107+
diff origin-tree.txt final-tree.txt
108+
exit $?
109+
110+
- name: Show Origin Workspace Tree
111+
if: always()
112+
run: cat origin-tree.txt
113+
114+
- name: Show Final Workspace Tree
115+
if: always()
116+
run: cat final-tree.txt

.github/workflows/full-test-suite.yml

+2
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ jobs:
2424
uses: ./.github/workflows/DB-CE.yml
2525
remote-test:
2626
uses: ./.github/workflows/remote-test.yml
27+
assemebly-test:
28+
uses: ./.github/workflows/assembly-test.yml

.github/workflows/standard-test-suite.yml

+2
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ jobs:
3535
uses: ./.github/workflows/remote-test.yml
3636
with:
3737
metadata-matrix: '["zookeeper"]'
38+
assemebly-test:
39+
uses: ./.github/workflows/assembly-test.yml

0 commit comments

Comments
 (0)