Skip to content

Commit 1c7b2f2

Browse files
committed
dbwebb test now use tee to print result directly instead of waiting for process to finish
1 parent a29cfd5 commit 1c7b2f2

2 files changed

Lines changed: 8 additions & 15 deletions

File tree

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ version: 2
22
jobs:
33
build:
44
docker:
5-
- image: dbwebb/courserepo:cli
5+
- image: dbwebb/courserepo
66

7-
working_directory: ~/arepo
7+
working_directory: ~/repo
88

99
steps:
1010
- checkout
@@ -23,4 +23,4 @@ jobs:
2323
key: v1-dependencies-{{ checksum "package.json" }}
2424

2525
# run tests!
26-
- run: make check test
26+
- run: make check test

.dbwebb/test/run.d.bash

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ function header {
105105
function doLog {
106106
if (( $1 )); then
107107
echo "[-] $2
108-
===========================================================" >> "$LOG"
108+
===========================================================" | tee -a "$LOG"
109109
else
110110
echo "[+] $2
111-
===========================================================" >> "$LOG"
111+
===========================================================" | tee -a "$LOG"
112112
fi
113113

114114
exit $1
@@ -159,14 +159,7 @@ done
159159

160160
# Adding summary to log-file
161161
printf "$(header "Test summary")
162-
$summary\n" >> "$LOG"
162+
$summary\n" | tee -a "$LOG"
163163

164-
# Printing the output
165-
RESULTS=$(cat $LOG)
166-
printf "
167-
$(header "LOG")
168-
"
169-
printf '%s\n' "${RESULTS}
170-
--------------------------------------------
171-
Saved a log of the test output: less -R '$LOG'\n
172-
"
164+
printf " --------------------------------------------
165+
Saved a log of the test output: less -R '$LOG'\n" | tee -a "$LOG"

0 commit comments

Comments
 (0)