Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run regression tests on Travis #35

Open
wants to merge 54 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
aeef947
Test mpirun and mpiexec commands
nightlark Jul 10, 2019
8529034
Install mpich on Travis
nightlark Jul 10, 2019
2ddcb92
Run TraceR simulation on Travis
nightlark Jul 25, 2019
2026548
Test install TraceR on Travis
nightlark Jul 25, 2019
ee6280f
Pass arguments to make install on Travis
nightlark Jul 25, 2019
93c96c3
Return to starting directory before running TraceR
nightlark Jul 25, 2019
399fa1e
Add baseline regression test output files
nightlark Aug 16, 2019
630c750
Bash script to compare output files with regression test files
nightlark Aug 16, 2019
c14fb6e
Merge pull request #1 from nightlark/travis-test-mpirun
nightlark Aug 16, 2019
25ac0f3
Output files from dfly example run in tests/output folder
nightlark Aug 16, 2019
063b7c4
Run check files script to compare regression files against output fil…
nightlark Aug 16, 2019
6d661fd
Move check to its own entry under script (exit status needs to fail b…
nightlark Aug 16, 2019
30478ba
Create an output folder for results from running tests
nightlark Aug 16, 2019
5e50139
Output the diff for files that regression tests that don't match
nightlark Aug 16, 2019
6d00002
Switch to using git diff tool for word-level diff
nightlark Aug 23, 2019
2065c81
Merge branch 'ci-test' of https://github.com/nightlark/TraceR into ci…
nightlark Aug 23, 2019
c49cb9e
Check that removing the git diff header works on Travis
nightlark Aug 26, 2019
7c35187
Test out float val extraction
nightlark Aug 26, 2019
17d3ac8
Tweak the detection of allowable diff lines and extraction of floatin…
nightlark Aug 27, 2019
d988019
Switch to alternate form of checking if return code for diff was 0
nightlark Aug 27, 2019
fe96166
Add floating point value check
nightlark Aug 27, 2019
0467fe1
Set tolerance check to something that should fail
nightlark Aug 27, 2019
ad28bdb
Change tolerance check to something that should pass
nightlark Aug 27, 2019
9bca43b
Clean-up recv_time check output
nightlark Aug 27, 2019
83ffb93
Fix bash error on echo
nightlark Aug 27, 2019
dd630d3
Add missing closing quote
nightlark Aug 27, 2019
821d797
Tweak debug output for diff comparison
nightlark Aug 27, 2019
f553136
Bash debug output
nightlark Aug 27, 2019
0e87168
Tweak one of the checks
nightlark Aug 27, 2019
c9a51f6
Fix up the logic for detecting non-recv_time diff
nightlark Aug 27, 2019
98060d2
Typo in variable name fix
nightlark Aug 27, 2019
a49fab6
Turn off verbose debug output for file diff checking
nightlark Aug 27, 2019
b1ffc26
Run test with other network configurations
nightlark Aug 27, 2019
2ea7191
Use the right conf file for hypreX_expressMesh, and use mpirun exit c…
nightlark Aug 27, 2019
3f871d8
Update setting return value for multi-line steps to avoid premature s…
nightlark Aug 27, 2019
f80bf19
Apply suggestions from ShellCheck.net
nightlark Aug 27, 2019
63214f2
Check msg-stats file for CI tests
nightlark Sep 4, 2019
0c7a9ad
Tweak checking for failure
nightlark Sep 4, 2019
d1b7ef0
Fix failing for msg-stats file mismatches
nightlark Sep 4, 2019
366e456
Refactor msg-stat checking to handle different types of time fields
nightlark Sep 4, 2019
1ebaac0
Add time tolerance check for very small variations on Travis
nightlark Sep 4, 2019
ed87517
Apply suggestions from ShellCheck.net
nightlark Sep 5, 2019
956c43b
Switch line splitting to use read -a
nightlark Sep 5, 2019
f21bf42
Add files for checking TraceR stdout simulation prints
nightlark Sep 25, 2019
79b443c
Create test output directory before writing to it
nightlark Sep 25, 2019
7a564e3
Dump filtered output to log
nightlark Sep 25, 2019
6534c9c
Try outputting directly to console after piping output
nightlark Sep 25, 2019
f8b3276
Test running set
nightlark Sep 25, 2019
34cecb6
Remove early creation of output directory
nightlark Sep 25, 2019
8c5f8f2
Reduce the set of lines checked
nightlark Sep 25, 2019
f87ebc3
Update regression test output
nightlark Oct 1, 2019
761e29e
Update std.out file for tests
nightlark Oct 1, 2019
7d015f2
Update std.out for fattree
nightlark Oct 2, 2019
97f52b9
Fix syntax error
nightlark Oct 2, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ addons:
packages:
- libtool-bin
- libmpich-dev
- mpich

install:
# Install ROSS
Expand Down Expand Up @@ -46,7 +47,46 @@ install:
export PATH=$PATH:${TRAVIS_BUILD_DIR}/ci-deps/OTF2/bin

script:
- cd tracer
- pushd tracer
- make all PREFIX=${TRAVIS_BUILD_DIR}/install-test CXX=mpicc CXX=mpicxx ROSS_DIR="${TRAVIS_BUILD_DIR}/ci-deps/ROSS" CODES_DIR="${TRAVIS_BUILD_DIR}/ci-deps/CODES" SELECT_TRACE="-DTRACER_OTF_TRACES=1"
- make install PREFIX=${TRAVIS_BUILD_DIR}/install-test CXX=mpicc CXX=mpicxx ROSS_DIR="${TRAVIS_BUILD_DIR}/ci-deps/ROSS" CODES_DIR="${TRAVIS_BUILD_DIR}/ci-deps/CODES" SELECT_TRACE="-DTRACER_OTF_TRACES=1"
- cd ../utils
- make
- popd
- mkdir ${TRAVIS_BUILD_DIR}/tests/output
- |
pushd examples/stencil4d-otf
mpirun -np 2 ${TRAVIS_BUILD_DIR}/install-test/bin/traceR --lp-io-dir=${TRAVIS_BUILD_DIR}/tests/output/test-output-dfly --sync=3 -- ../conf/dfly.conf tracer_config | sed -n '/START PARALLEL OPTIMISTIC SIMULATION/,/END SIMULATION/p' | tail -n +2 | head -n -3 > std.out
rv=$?
cat std.out
mv std.out ${TRAVIS_BUILD_DIR}/tests/output/test-output-dfly/std.out
popd
if [[ $rv == 0 ]]; then true; else false; fi
- ${TRAVIS_BUILD_DIR}/tests/bin/check-files-match.sh ${TRAVIS_BUILD_DIR}/tests/regression/test-output-dfly
- |
pushd examples/stencil4d-otf
mpirun -np 2 ${TRAVIS_BUILD_DIR}/install-test/bin/traceR --lp-io-dir=${TRAVIS_BUILD_DIR}/tests/output/test-output-fattree --sync=3 -- ../conf/fattree.conf tracer_config | sed -n '/START PARALLEL OPTIMISTIC SIMULATION/,/END SIMULATION/p' | tail -n +2 | head -n -3 > std.out
rv=$?
cat std.out
mv std.out ${TRAVIS_BUILD_DIR}/tests/output/test-output-fattree/std.out
popd
if [[ $rv == 0 ]]; then true; else false; fi
- ${TRAVIS_BUILD_DIR}/tests/bin/check-files-match.sh ${TRAVIS_BUILD_DIR}/tests/regression/test-output-fattree
- |
pushd examples/stencil4d-otf
mpirun -np 2 ${TRAVIS_BUILD_DIR}/install-test/bin/traceR --lp-io-dir=${TRAVIS_BUILD_DIR}/tests/output/test-output-hypre --sync=3 -- ../conf/hypreX_expressMesh.conf tracer_config | sed -n '/START PARALLEL OPTIMISTIC SIMULATION/,/END SIMULATION/p' | tail -n +2 | head -n -3 > std.out
rv=$?
cat std.out
mv std.out ${TRAVIS_BUILD_DIR}/tests/output/test-output-hypre/std.out
popd
if [[ $rv == 0 ]]; then true; else false; fi
- ${TRAVIS_BUILD_DIR}/tests/bin/check-files-match.sh ${TRAVIS_BUILD_DIR}/tests/regression/test-output-hypre
- |
pushd examples/stencil4d-otf
mpirun -np 2 ${TRAVIS_BUILD_DIR}/install-test/bin/traceR --lp-io-dir=${TRAVIS_BUILD_DIR}/tests/output/test-output-torus --sync=3 -- ../conf/torus.conf tracer_config | sed -n '/START PARALLEL OPTIMISTIC SIMULATION/,/END SIMULATION/p' | tail -n +2 | head -n -3 > std.out
rv=$?
cat std.out
mv std.out ${TRAVIS_BUILD_DIR}/tests/output/test-output-torus/std.out
popd
if [[ $rv == 0 ]]; then true; else false; fi
- ${TRAVIS_BUILD_DIR}/tests/bin/check-files-match.sh ${TRAVIS_BUILD_DIR}/tests/regression/test-output-torus
168 changes: 168 additions & 0 deletions tests/bin/check-files-match.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
#!/bin/bash

testDir=$1

passed=true

for f in "$testDir"/*
do
echo "$f"
fRun=${f/regression/output}
tc_passed=true

case $f in
*msg-stats)
# direct comparison won't work, times vary
echo "=========================================="
echo "checking: $f"
echo "=========================================="
IFS=">" read -ra header <<< "$(head -n 1 "$f")"
ignore_time_fld=-1
tol_time_fld=-1
for ((i=0; i<${#header[@]}; i++));
do
if [[ ${header[i]} == *"Busy Time"* ]];
then
ignore_time_fld=$i
echo "Ignoring times in field index $ignore_time_fld"
elif [[ ${header[i]} == *"Time"* ]];
then
tol_time_fld=$i
echo "Checking time tol for field index $tol_time_fld"
elif [[ ${header[i]} == *"Avg packet latency"* ]];
then
tol_time_fld=$i
echo "Checking time tol for field index $tol_time_fld"
fi
done

while IFS="@" read -r line1 line2;
do
read -ra flds1 <<< "$line1"
read -ra flds2 <<< "$line2"
if [[ "${#flds1[@]}" != "${#flds2[@]}" ]];
then
tc_passed=false
echo "Failed (different number of fields): $line1 != $ line2"
else
for ((i=0; i<${#flds1[@]}; i++));
do
if [[ "${flds1[i]}" != "${flds2[i]}" ]];
then
if [[ "$i" == "$ignore_time_fld" ]];
then
:
#echo "Ignoring time field mismatch"
elif [[ "$i" == "$tol_time_fld" ]];
then
echo "Checking time field..."
if [[ $(echo "sqrt((${flds1[i]} - ${flds2[i]})^2) > 0.000001" | bc -l) == 1 ]]
then
tc_passed=false
echo "-- outside tolerance [> .000001]"
else
echo "-- within tolerance [<= .000001]"
fi
else
tc_passed=false
echo "***"
echo "Failed (field $i mismatch): ${flds1[i]} != ${flds2[i]}"
echo "Output: $line1"
echo "Regression: $line2"
echo "***"
fi
fi
done
fi
done <<< "$(paste -d@ "$fRun" "$f")"
;;
*~)
continue
;;
*)
echo "=========================================="
echo "diff: $f"
echo "=========================================="
test_diff=$(git diff -U0 --word-diff=porcelain --no-index -- "$fRun" "$f")
rv=$?
if [[ $rv != 0 ]]
then
before_val=0
after_val=0
has_non_recv_diffline=false
test_diff=$(echo "$test_diff" | tail -n +5)
while IFS= read -r line;
do
tmp_float_num=-1
is_recv_diffline=false
# grep returns 0 if recv_time is present prefixed with + or - at the start of the line (if not, ignore)
echo "$line" | grep "^[+-]recv_time";
rv=$?
if [[ $rv == 0 ]]
then
is_recv_diffline=true
# remove everything but the number following a "recv_time:" prefixed by a single character
tmp_float_num=${line##?recv_time:}
# grep returns 1 if there are only 0-9 and . in the string (fail if other content)
if echo "$tmp_float_num" | grep "[^0-9.]";
then
tc_passed=false
fi
fi

# check to make sure that the diff isn't for something other than recv_time
echo "$line" | grep "^[+-]";
rv=$?
if [[ $rv == 0 && $is_recv_diffline != "true" ]];
then
has_non_recv_diffline=true
fi

if [[ $line == "-"* ]]
then
before_val=$tmp_float_num
if [[ $is_recv_diffline != "true" ]]
then
tc_passed=false
fi
elif [[ $line == "+"* ]]
then
after_val=$tmp_float_num
if [[ $is_recv_diffline != "true" ]]
then
tc_passed=false
fi
elif [[ $line == "~" ]]
then
echo "Checking difference..."
if [[ $has_non_recv_diffline == "false" ]];
then
echo "- checking recv_time diff [$before_val vs $after_val]"
if [[ $(echo "sqrt(($after_val - $before_val)^2) > 0.000001" | bc -l) == 1 ]]
then
tc_passed=false
echo "-- outside tolerance [> .000001]"
else
echo "-- within tolerance [<= .000001]"
fi
else
tc_passed=false
echo "- diff contained a change that wasn't recv_time"
fi
# reset flag for detecting a non-recv_time change
has_non_recv_diffline=false
fi
done <<< "$test_diff"

fi
esac

if [[ "$tc_passed" == "false" ]];
then
passed=false
echo "FAILED $f does not match"
fi
done

# Passed should be either true or false, corresponding to the right command
$passed
Loading