Skip to content

Commit aceea84

Browse files
committed
E2E: build IFF running tests
1 parent fb9dd2d commit aceea84

File tree

1 file changed

+15
-27
lines changed

1 file changed

+15
-27
lines changed

test_e2e.sh

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -98,27 +98,9 @@ function docker_kill() {
9898
docker kill "$1" >/dev/null
9999
}
100100

101-
# #####################
102-
# main
103-
# #####################
104-
105-
# Build it
106-
make container REGISTRY=e2e VERSION=$(make -s version)
107-
make test-tools REGISTRY=e2e
108-
109101
RUNID="${RANDOM}${RANDOM}"
110-
DIR=""
111-
for i in $(seq 1 10); do
112-
DIR="/tmp/git-sync-e2e.$RUNID"
113-
mkdir "$DIR" && break
114-
done
115-
if [[ -z "$DIR" ]]; then
116-
echo "Failed to make a temp dir"
117-
exit 1
118-
fi
119-
echo
120-
echo "test root is $DIR"
121-
echo
102+
DIR="/tmp/git-sync-e2e.$RUNID"
103+
mkdir "$DIR"
122104

123105
REPO="$DIR/repo"
124106
MAIN_BRANCH="e2e-branch"
@@ -796,7 +778,6 @@ function e2e::fetch_skip_depth_1() {
796778
assert_file_eq "$ROOT"/link/file3 "$FUNCNAME-ok"
797779
}
798780

799-
800781
##############################################
801782
# Test password
802783
##############################################
@@ -1101,7 +1082,7 @@ function e2e::http() {
11011082
--http-pprof \
11021083
--dest="link" \
11031084
>> "$1" 2>&1 &
1104-
# do nothing, just wait for the HTTP to come up
1085+
# do nothing, just wait for the HTTP to come up
11051086
for i in $(seq 1 5); do
11061087
sleep 1
11071088
if curl --silent --output /dev/null http://localhost:$BINDPORT; then
@@ -1524,10 +1505,6 @@ function e2e::github_https() {
15241505
assert_file_exists "$ROOT"/link/LICENSE
15251506
}
15261507

1527-
#
1528-
# main
1529-
#
1530-
15311508
function list_tests() {
15321509
(
15331510
shopt -s extdebug
@@ -1541,9 +1518,10 @@ function list_tests() {
15411518
)
15421519
}
15431520

1544-
# Iterate over all tests and run them.
1521+
# Figure out which, if any, tests to run.
15451522
tests=($(list_tests))
15461523

1524+
# Use -? to just list tests.
15471525
if [[ "$#" == 1 && "$1" == "-?" ]]; then
15481526
echo "available tests:"
15491527
for t in "${tests[@]}"; do
@@ -1552,10 +1530,20 @@ if [[ "$#" == 1 && "$1" == "-?" ]]; then
15521530
exit 0
15531531
fi
15541532

1533+
# If no tests specified, run them all.
15551534
if [[ "$#" == 0 ]]; then
15561535
set -- "${tests[@]}"
15571536
fi
15581537

1538+
# Build it
1539+
make container REGISTRY=e2e VERSION=$(make -s version)
1540+
make test-tools REGISTRY=e2e
1541+
1542+
echo
1543+
echo "test root is $DIR"
1544+
echo
1545+
1546+
# Iterate over the chosen tests and run them.
15591547
for t; do
15601548
clean_root
15611549
init_repo

0 commit comments

Comments
 (0)