Skip to content

Commit a6580ba

Browse files
committed
setup is reserved by bats
It's always run before every testcase, which makes that we would always install certain tools which breaks the tests where we assume to not have those tools.
1 parent be520e3 commit a6580ba

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

.github/jobs/configure-checks/all.bats

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ setup_user() {
2929
chown -R $u:$u ./
3030
}
3131

32-
setup() {
32+
setup_helper() {
3333
setup_user
3434
for shared_file in config.log confdefs.h conftest.err; do
3535
chmod a+rw $shared_file || true
@@ -149,7 +149,7 @@ compile_assertions_finished () {
149149
}
150150

151151
@test "Run as root discouraged" {
152-
setup
152+
setup_helper
153153
run su root -c "./configure"
154154
discourage_root="checking domjudge-user... configure: error: installing/running as root is STRONGLY DISCOURAGED, use --with-domjudge-user=root to override."
155155
assert_line "$discourage_root"
@@ -204,7 +204,7 @@ compile_assertions_finished () {
204204
}
205205

206206
@test "Run as normal user" {
207-
setup
207+
setup_helper
208208
run ./configure --with-domjudge-user=$u
209209
assert_line "checking domjudge-user... $u"
210210
run su $u -c "./configure"
@@ -227,7 +227,7 @@ compile_assertions_finished () {
227227
}
228228

229229
@test "/opt configured" {
230-
setup
230+
setup_helper
231231
run run_configure
232232
assert_line " * prefix..............: /opt/domjudge"
233233
assert_line " * documentation.......: /opt/domjudge/doc"
@@ -254,7 +254,7 @@ compile_assertions_finished () {
254254
}
255255

256256
@test "Prefix configured" {
257-
setup
257+
setup_helper
258258
run run_configure --prefix=/tmp
259259
refute_line " * prefix..............: /opt/domjudge"
260260
refute_line " * documentation.......: /opt/domjudge/doc"
@@ -276,7 +276,7 @@ compile_assertions_finished () {
276276
}
277277

278278
@test "Check FHS" {
279-
setup
279+
setup_helper
280280
run run_configure --enable-fhs
281281
refute_line " * prefix..............: /opt/domjudge"
282282
refute_line " * documentation.......: /opt/domjudge/doc"
@@ -311,7 +311,7 @@ compile_assertions_finished () {
311311
}
312312

313313
@test "Alternative dirs together with FHS" {
314-
setup
314+
setup_helper
315315
run run_configure --enable-fhs --with-domserver_webappdir=/run/webapp --with-domserver_tmpdir=/tmp/domserver --with-judgehost_tmpdir=/srv/tmp --with-judgehost_judgedir=/srv/judgings --with-judgehost_chrootdir=/srv/chroot/domjudge
316316
assert_line " * prefix..............: /usr/local"
317317
assert_line " * documentation.......: /usr/local/share/doc/domjudge"
@@ -343,7 +343,7 @@ compile_assertions_finished () {
343343
}
344344

345345
@test "Alternative dirs together with defaults" {
346-
setup
346+
setup_helper
347347
run run_configure "--with-judgehost_tmpdir=/srv/tmp --with-judgehost_judgedir=/srv/judgings --with-judgehost_chrootdir=/srv/chroot --with-domserver_logdir=/log"
348348
assert_line " * prefix..............: /opt/domjudge"
349349
assert_line " * documentation.......: /opt/domjudge/doc"
@@ -360,7 +360,7 @@ compile_assertions_finished () {
360360
}
361361

362362
@test "Default URL not set, docs mention" {
363-
setup
363+
setup_helper
364364
run run_configure
365365
assert_line "checking baseurl... https://example.com/domjudge/"
366366
assert_line "Warning: base URL is unconfigured; generating team documentation will"
@@ -377,7 +377,7 @@ compile_assertions_finished () {
377377
}
378378

379379
@test "Change users" {
380-
setup
380+
setup_helper
381381
run run_configure
382382
assert_line " * default user........: domjudge-bats-user"
383383
assert_line " * runguard user.......: domjudge-run"
@@ -397,7 +397,7 @@ compile_assertions_finished () {
397397
}
398398

399399
@test "No docs" {
400-
setup
400+
setup_helper
401401
run run_configure
402402
assert_line " * documentation.......: /opt/domjudge/doc"
403403
run run_configure --enable-doc-build
@@ -411,7 +411,7 @@ compile_assertions_finished () {
411411
# Fails as libraries are not found
412412
skip
413413
fi
414-
setup
414+
setup_helper
415415
run run_configure
416416
assert_line " * domserver...........: /opt/domjudge/domserver"
417417
assert_regex "^ \* webserver group\.\.\.\.\.: (www-data|apache|nginx)$"
@@ -428,7 +428,7 @@ compile_assertions_finished () {
428428
# Fails as libraries are not found
429429
skip
430430
fi
431-
setup
431+
setup_helper
432432
run run_configure --disable-domserver-build
433433
refute_line " * domserver...........: /opt/domjudge/domserver"
434434
for group in www-data apache nginx; do
@@ -447,7 +447,7 @@ compile_assertions_finished () {
447447
# Fails as libraries are not found
448448
skip
449449
fi
450-
setup
450+
setup_helper
451451
run run_configure --disable-judgehost-build
452452
assert_line " * domserver...........: /opt/domjudge/domserver"
453453
assert_regex "^ \* webserver group\.\.\.\.\.: (www-data|apache|nginx)$"

0 commit comments

Comments
 (0)