forked from alisw/alidist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aliroot-test.sh
65 lines (64 loc) · 2.71 KB
/
aliroot-test.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package: AliRoot-test
version: "%(year)s%(month)s%(day)s%(defaults_upper)s"
force_rebuild: 1
requires:
- AliPhysics
- GEANT3
- OCDB-test
- "IgProf:slc7.*"
---
#!/bin/sh
export ALICE_ROOT=$ALIROOT_ROOT
echo "`date +%s`:aliroot-test: $x STARTED"
WORKSPACE=${WORKSPACE:-$BUILDDIR}
# Despite the fact we shouldn't rely on external variables, here we do to
# control from the outside (i.e. jenkins) which tests to run.
#
# By default we only run gun. We do this so that before running longer tests we
# make sure that at least the simple ones are ok.
rsync -a $ALIROOT_ROOT/test/ test
for x in ${ALI_CI_TESTS:-gun}; do
set -o pipefail
find test -name "*.C" -exec perl -p -i -e 's|ALICE_ROOT/OCDB|OCDB_TEST_ROOT|' {} \;
VARIANTS=default${IGPROF_ROOT:+,igprof_memory,igprof_performance}
if test/runTests -d --variants $VARIANTS $x; then
STATUS=SUCCESS
else
STATUS=FAILED
fi
# Process any igprof profile dump (performance).
for y in $(find . -name "igprof*PERFORMANCE.gz"); do
IGPROF_OUT=$(echo $y | sed -e's/.gz/.sql/')
igprof-analyse -d -g $y --sqlite | sqlite3 $IGPROF_OUT
done
# Process any igprof profile dump (memory).
for y in $(find . -name "igprof*MEMORY.gz"); do
igprof-analyse -d -r MEM_TOTAL -g $y --sqlite | sqlite3 $(echo $y | sed -e's/MEMORY.gz/MEM_TOTAL.sql/') || true
igprof-analyse -d -r MEM_LIVE -g $y --sqlite | sqlite3 $(echo $y | sed -e's/MEMORY.gz/MEM_LIVE.sql/') || true
igprof-analyse -d -r MEM_MAX -g $y --sqlite | sqlite3 $(echo $y | sed -e's/MEMORY.gz/MEM_MAX.sql/') || true
done
# Simple normalization of results. /etc/sysbench-results is created by
# puppet on build infrastructure machines.
if [ -f /etc/sysbench-results ]; then
NORMALIZATION=`cat /etc/sysbench-results | grep 'total time:' | sed -e 's/[^0-9]*//;s/s//'`
else
NORMALIZATION=1
fi
for y in $(find . -name "*.sql"); do
cat << EOF | sqlite3 $y
CREATE TABLE metadata (key STRING, value STRING);
INSERT INTO metadata(key, value) VALUES ('status', '$STATUS');
INSERT INTO metadata(key, value) VALUES ('test_name', '$x');
INSERT INTO metadata(key, value) VALUES ('architecture', '$ARCHITECTURE');
INSERT INTO metadata(key, value) VALUES ('aliroot_version', '$ALIROOT_VERSION');
INSERT INTO metadata(key, value) VALUES ('aliphysics_version', '$ALIPHYSICS_VERSION');
INSERT INTO metadata(key, value) VALUES ('hostname', '$HOSTNAME');
INSERT INTO metadata(key, value) VALUES ('normalization', '$NORMALIZATION');
EOF
done
mkdir -p ${WORKSPACE}/$x
find . -name "*.root" -exec cp {} $WORKSPACE/$x \;
find . -name "*.log" -exec cp {} $WORKSPACE/$x \;
find . -name "*.sql" -exec cp {} $WORKSPACE/$x \;
echo "`date +%s`:aliroot-test: $x $STATUS"
done