forked from semgrep/semgrep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-perf-tests-old.sh
executable file
·48 lines (36 loc) · 1.45 KB
/
run-perf-tests-old.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
38
39
40
41
42
43
44
45
46
47
48
#! /usr/bin/env bash
set -e
# set -x
HYPERFINE="hyperfine -m 2 --warmup 0 "
A_VERSION="0.4.8"
B_VERSION="0.4.9"
test_test_suite() {
rm -rf /tmp/semgrep-rules && git clone https://github.com/returntocorp/semgrep-rules /tmp/semgrep-rules
ls -al /tmp/semgrep-rules
CMDA="${SGREP_A} --dangerously-allow-arbitrary-code-execution-from-rules --strict --test --test-ignore-todo /tmp/semgrep-rules"
CMDB="${SGREP_B} --dangerously-allow-arbitrary-code-execution-from-rules --strict --test --test-ignore-todo /tmp/semgrep-rules"
$CMDA
$CMDB
$HYPERFINE --export-markdown testsuite.md "${CMDA}" "${CMDB}"
}
test_sample_repos() {
rm -rf /tmp/sample && git clone --depth=1 https://github.com/apache/airflow /tmp/sample/
cd /tmp/sample
SGREP_A="docker run --rm -v ${PWD}:/src returntocorp/semgrep:${A_VERSION}"
SGREP_B="docker run --rm -v ${PWD}:/src returntocorp/semgrep:${B_VERSION}"
CMDA="${SGREP_A} --config=r2c --dangerously-allow-arbitrary-code-execution-from-rules --strict"
CMDB="${SGREP_B} --config=r2c --dangerously-allow-arbitrary-code-execution-from-rules --strict"
#$CMDA
#$CMDB
$HYPERFINE --export-markdown "${THIS_DIR}/testsuite.md" "${CMDA}" "${CMDB}"
cat "${THIS_DIR}/testsuite.md"
cd -
}
echo "-----------------------"
echo "starting perf tests"
THIS_DIR="$(dirname "$(realpath "$0")")";
cd "${THIS_DIR}"
#test_test_suite
test_sample_repos
echo "-----------------------"
echo "all per tests completed"