-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest-helpers.sh
executable file
·37 lines (34 loc) · 1.31 KB
/
test-helpers.sh
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
#!/bin/bash
function test_line() {
reportType=$1
result_filename=$2
pattern=$3
if grep --quiet "$3" "$result_filename"
then
echo "**PASS** $reportType report has: $pattern"
else
echo "**FAILED** $reportType report is missing: $pattern" && exit 1
fi
}
function test_report() {
report_type=$1
shift
result_filename=$1
shift
patterns=("$@")
for line in "${patterns[@]}";
do
test_line $report_type $result_filename "${line[@]}"
done
}
declare -a lines_to_find=("detected java code. we recommend using OpenJDK"
"detected python code. min version 3.7.5 is required"
"detected python code. if you need pip, version 19.3 or above is recommended"
"dependency library numpy is present. min version 1.19.0 is required"
"detected java code. min version 8 is required. version 17 or above is recommended"
"using dependency library snappy-java version 1.1.3. upgrade to at least version 1.1.4"
"using dependency library hadoop-lzo. this library requires a manual build"
"dependency library: leveldbjni-all is not supported on Ampere Processors"
"detected go code. min version 1.16 is required. version 1.18 or above is recommended"
"using dependency library github.com/golang/snappy version 0.0.1. upgrade to at least version 0.0.2"
)