-
Notifications
You must be signed in to change notification settings - Fork 184
Expand file tree
/
Copy pathtest-run-single-benchmark.sh
More file actions
executable file
·97 lines (75 loc) · 3.03 KB
/
test-run-single-benchmark.sh
File metadata and controls
executable file
·97 lines (75 loc) · 3.03 KB
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
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd -- "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd -- "${SCRIPT_DIR}/../.." && pwd)"
SCRIPT="${REPO_ROOT}/scripts/run-single-benchmark.sh"
set +e
OUTPUT="$(bash "${SCRIPT}" --dry-run --module testsuites/benchmark --class org.eclipse.rdf4j.benchmark.ReasoningBenchmark --method forwardChainingSchemaCachingRDFSInferencer 2>&1)"
STATUS=$?
set -e
echo "${OUTPUT}"
if [[ ${STATUS} -ne 0 ]]; then
exit ${STATUS}
fi
if [[ "${OUTPUT}" != *"mvn -pl testsuites/benchmark -am -P benchmarks -DskipTests package"* ]]; then
echo "Expected Maven command not found in output" >&2
exit 1
fi
if [[ "${OUTPUT}" != *"ReasoningBenchmark.forwardChainingSchemaCachingRDFSInferencer"* ]]; then
echo "Expected benchmark method not found in output" >&2
exit 1
fi
set +e
JFR_OUTPUT="$(bash "${SCRIPT}" --dry-run --module testsuites/benchmark --class org.eclipse.rdf4j.benchmark.ReasoningBenchmark --method forwardChainingSchemaCachingRDFSInferencer --enable-jfr 2>&1)"
JFR_STATUS=$?
set -e
echo "${JFR_OUTPUT}"
if [[ ${JFR_STATUS} -ne 0 ]]; then
exit ${JFR_STATUS}
fi
if [[ "${JFR_OUTPUT}" != *"JFR profiling enabled:"* ]]; then
echo "Expected JFR guidance banner when profiling is enabled" >&2
exit 1
fi
EXPECTED_JFR_PATH="testsuites/benchmark/target/ReasoningBenchmark.forwardChainingSchemaCachingRDFSInferencer.jfr"
if [[ "${JFR_OUTPUT}" != *"${EXPECTED_JFR_PATH}"* ]]; then
echo "Expected JFR banner to include the recording destination" >&2
exit 1
fi
if [[ "${JFR_OUTPUT}" != *"-wi 0"* ]]; then
echo "Expected JFR run to disable warmup iterations" >&2
exit 1
fi
if [[ "${JFR_OUTPUT}" != *"-i 10"* ]]; then
echo "Expected JFR run to force 10 measurement iterations" >&2
exit 1
fi
if [[ "${JFR_OUTPUT}" != *"-r 10s"* ]]; then
echo "Expected JFR run to set measurement time to 10 seconds" >&2
exit 1
fi
if [[ "${JFR_OUTPUT}" != *"-f 1"* ]]; then
echo "Expected JFR run to enforce a single fork" >&2
exit 1
fi
if [[ "${JFR_OUTPUT}" != *"-XX:StartFlightRecording=settings=profile\\,dumponexit=true"* ]]; then
echo "Expected JFR run to enable JFR profiling" >&2
exit 1
fi
if [[ "${JFR_OUTPUT}" != *"testsuites/benchmark/target/ReasoningBenchmark.forwardChainingSchemaCachingRDFSInferencer.jfr"* ]]; then
echo "Expected JFR run to emit recording into the module target directory" >&2
exit 1
fi
set +e
JFR_CPU_OUTPUT="$(bash "${SCRIPT}" --dry-run --module testsuites/benchmark --class org.eclipse.rdf4j.benchmark.ReasoningBenchmark --method forwardChainingSchemaCachingRDFSInferencer --enable-jfr --enable-jfr-cpu-times 2>&1)"
JFR_CPU_STATUS=$?
set -e
echo "${JFR_CPU_OUTPUT}"
if [[ ${JFR_CPU_STATUS} -ne 0 ]]; then
exit ${JFR_CPU_STATUS}
fi
if [[ "${JFR_CPU_OUTPUT}" != *"-XX:FlightRecorderOptions=enableThreadCpuTime=true\\,enableProcessCpuTime=true"* ]]; then
echo "Expected CPU time options to be appended when requested" >&2
exit 1
fi
exit 0