-
Notifications
You must be signed in to change notification settings - Fork 304
151 lines (131 loc) · 5.26 KB
/
test-smoke-gh_runner.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: Smoketest Package (gh-runner)
on:
workflow_call:
inputs:
os:
type: string
description: 'Operating System'
required: false
default: 'ubuntu-22.04'
asset-name:
type: string
description: 'Asset Name'
required: false
default: 'build-docker-package'
dependencies:
type: string
description: 'Dependencies'
required: false
default: 'bison flex build-essential binutils-dev curl lsb-release libcppunit-dev python3-dev default-jdk r-base-dev r-cran-rcpp r-cran-rinside r-cran-inline libtool autotools-dev automake git cmake xmlstarlet'
jobs:
main:
runs-on: ${{ inputs.os }}
strategy:
fail-fast: false
matrix:
engine: ['hthor', 'thor', 'roxie']
match:
- pattern: '[a-d]*.ecl'
- pattern: '[e-h]*.ecl'
- pattern: '[i-l]*.ecl'
- pattern: '[m-q]*.ecl'
- pattern: '[r-u]*.ecl'
exclude: teststdlibrary.ecl
- pattern: '[v-z]*.ecl'
include:
- engine: 'hthor'
match:
pattern: teststdlibrary.ecl
- engine: 'thor'
match:
pattern: teststdlibrary.ecl
- engine: 'roxie'
match:
pattern: teststdlibrary.ecl
steps:
- name: Free additional disk space (remove Android SDK + Tools)
run: |
sudo rm -rf /usr/local/lib/android
- name: Download Package
uses: actions/download-artifact@v4
with:
name: ${{ inputs.asset-name }}
path: ${{ inputs.asset-name }}
- name: Download Support Files
uses: actions/download-artifact@v4
with:
name: ${{ inputs.asset-name }}-support-files
path: ${{ inputs.asset-name }}-support-files
- name: vars
id: vars
run: |
echo "matrix-setname=$(echo -n ${{ matrix.match.pattern }} | tr -c \"[:alnum:]\" _)" >> $GITHUB_OUTPUT
- name: Install Dependencies
shell: "bash"
run: |
sudo apt-get update
sudo apt-get install -y ${{ inputs.dependencies }}
sudo apt-get install -y gdb
- name: Install Package
shell: "bash"
run: |
sudo apt-get install -y -f ./${{ inputs.asset-name }}/*.deb
sudo chown -R $USER:$USER /opt/HPCCSystems
sudo xmlstarlet ed -L -u 'Environment/Software/ThorCluster/@slavesPerNode' -v 2 -u 'Environment/Software/ThorCluster/@channelsPerSlave' -v 1 /etc/HPCCSystems/environment.xml
chmod +x ./${{ inputs.asset-name }}-support-files/*
sudo cp ./${{ inputs.asset-name }}-support-files/* /opt/HPCCSystems/bin
- name: Start HPCC-Platform
shell: "bash"
run: |
export LANG="en_US.UTF-8"
sudo update-locale
sudo /etc/init.d/hpcc-init start
- name: Run Setup
working-directory: /opt/HPCCSystems/testing/regress
shell: "bash"
run: |
/opt/HPCCSystems/bin/timeoutcmd $((8 * 60)) \
./ecl-test setup --preAbort '/opt/HPCCSystems/bin/smoketest-preabort.sh' --pq 2 --generateStackTrace
grep Failure: /home/runner/HPCCSystems-regression/log/setup_*.log
if [[ "$(grep -ohP '(?<=^Failure: )[0-9]+$' /home/runner/HPCCSystems-regression/log/setup_*.log | awk '{s+=$1} END {print s}')" -gt 0 ]]; then exit 1; fi
- name: Select Tests
id: select-tests
working-directory: /opt/HPCCSystems/testing/regress
shell: "bash"
run: |
(cd ecl; ls ${{ matrix.match.pattern }}) > matches.tmp
echo queries are:
cat matches.tmp
if [[ -z "${{ matrix.match.exclude }}" ]]
then
queries="$(cat matches.tmp | tr '\n' ' ')"
else
queries="$(cd ecl; ls ${{ matrix.match.exclude }} | grep -v -f - ../matches.tmp | tr '\n' ' ')"
fi
echo queries after exclude: ${queries}
echo "queries=${queries}" >> $GITHUB_OUTPUT
- name: Run Tests
working-directory: /opt/HPCCSystems/testing/regress
shell: "bash"
run: |
# force regression suite to timeout after 28 minutes, so it captures ZAP report of any inflight hung queries
/opt/HPCCSystems/bin/timeoutcmd $((28 * 60)) \
./ecl-test query --preAbort '/opt/HPCCSystems/bin/smoketest-preabort.sh' --pq 2 --target ${{ matrix.engine }} --excludeclass python2,embedded-r,embedded-js,3rdpartyservice,mongodb --generateStackTrace ${{ steps.select-tests.outputs.queries }}
grep Failure: /home/runner/HPCCSystems-regression/log/${{ matrix.engine }}.*.log
if [[ "$(grep -oP '(?<=^Failure: )[0-9]+$' /home/runner/HPCCSystems-regression/log/${{ matrix.engine }}.*.log)" -gt 0 ]]; then exit 1; fi
- name: regression-run-logs-artifact
if: ${{ failure() || cancelled() }}
uses: actions/upload-artifact@v4
with:
name: test-smoke-${{ inputs.asset-name }}-${{ matrix.engine }}-${{ steps.vars.outputs.matrix-setname }}
path: |
/var/log/HPCCSystems
/home/runner/HPCCSystems-regression
if-no-files-found: error
succeeded:
runs-on: ${{ inputs.os }}
needs: main
steps:
- shell: "bash"
run: |
echo "...all tests passed..."