Compare commits
5 Commits
dead-code-
...
measure-te
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a04a61bd46 | ||
|
|
8daa04e265 | ||
|
|
4d3e4ccdc5 | ||
|
|
5d13451935 | ||
|
|
576c5951e4 |
@@ -189,6 +189,8 @@
|
||||
|
||||
src = self;
|
||||
|
||||
TESTS_TIMER_LOG="${placeholder "out"}/testTime";
|
||||
|
||||
VERSION_SUFFIX = versionSuffix;
|
||||
|
||||
nativeBuildInputs = nativeBuildDeps;
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
|
||||
set -u
|
||||
|
||||
TESTS_TIMER_LOG=${TESTS_TIMER_LOG:-/dev/null}
|
||||
|
||||
start_time=$(date -u +%s)
|
||||
echo "$(date -u +%s) $1 start" >> "$TESTS_TIMER_LOG"
|
||||
|
||||
red=""
|
||||
green=""
|
||||
yellow=""
|
||||
@@ -15,14 +20,19 @@ if [ -t 1 ]; then
|
||||
normal="[m"
|
||||
fi
|
||||
(cd tests && env ${TESTS_ENVIRONMENT} init.sh 2>/dev/null > /dev/null)
|
||||
|
||||
log="$(cd $(dirname $1) && env ${TESTS_ENVIRONMENT} $(basename $1) 2>&1)"
|
||||
status=$?
|
||||
stop_time=$(date -u +%s)
|
||||
elapsed_time=$(($stop_time-$start_time))
|
||||
|
||||
if [ $status -eq 0 ]; then
|
||||
echo "$post_run_msg [${green}PASS$normal]"
|
||||
echo "$post_run_msg [${green}PASS$normal] in ${elapsed_time}s"
|
||||
elif [ $status -eq 99 ]; then
|
||||
echo "$post_run_msg [${yellow}SKIP$normal]"
|
||||
echo "$post_run_msg [${yellow}SKIP$normal] after ${elapsed_time}s"
|
||||
else
|
||||
echo "$post_run_msg [${red}FAIL$normal]"
|
||||
echo "$post_run_msg [${red}FAIL$normal] in ${elapsed_time}s"
|
||||
echo "$log" | sed 's/^/ /'
|
||||
exit "$status"
|
||||
fi
|
||||
echo "$(date -u +%s) $1 stop" >> "$TESTS_TIMER_LOG"
|
||||
|
||||
@@ -90,12 +90,18 @@ startDaemon() {
|
||||
# Start the daemon, wait for the socket to appear. !!!
|
||||
# ‘nix-daemon’ should have an option to fork into the background.
|
||||
rm -f $NIX_DAEMON_SOCKET_PATH
|
||||
PATH=$DAEMON_PATH nix daemon &
|
||||
PATH=$DAEMON_PATH nix-daemon&
|
||||
pidDaemon=$!
|
||||
for ((i = 0; i < 300; i++)); do
|
||||
if [[ -S $NIX_DAEMON_SOCKET_PATH ]]; then break; fi
|
||||
if [[ -S $NIX_DAEMON_SOCKET_PATH ]]; then
|
||||
DAEMON_STARTED=1
|
||||
break;
|
||||
fi
|
||||
sleep 0.1
|
||||
done
|
||||
pidDaemon=$!
|
||||
if [[ -z ${DAEMON_STARTED+x} ]]; then
|
||||
fail "Didn’t manage to start the daemon"
|
||||
fi
|
||||
trap "killDaemon" EXIT
|
||||
export NIX_REMOTE=daemon
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user