commit 2a24a0b817684ff112fe52232d725d07816f9cc9 parent e63e82925f85456320b5569c63f1b864fdf245ac Author: Antoine A <> Date: Wed, 10 Jul 2024 15:36:09 +0200 common: fix CI test errors Diffstat:
| M | common/src/test/kotlin/ConfigTest.kt | | | 8 | ++++++-- |
| M | contrib/ci/jobs/2-test/test.sh | | | 1 | + |
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/common/src/test/kotlin/ConfigTest.kt b/common/src/test/kotlin/ConfigTest.kt @@ -54,7 +54,9 @@ class ConfigTest { configPath.createParentDirectories() configPath.createFile() configPath.toFile().setReadable(false) - testErr("Could not read config at '$configPath': permission denied") + if (!configPath.isReadable()) { // Skip if root + testErr("Could not read config at '$configPath': permission denied") + } configPath.toFile().setReadable(true) configPath.writeText("@inline@test-second-conf.conf") @@ -63,7 +65,9 @@ class ConfigTest { secondPath.createFile() secondPath.toFile().setReadable(false) - testErr("Could not read config at '$secondPath': permission denied") + if (!secondPath.isReadable()) { // Skip if root + testErr("Could not read config at '$secondPath': permission denied") + } configPath.writeText("@inline-matching@[*") testErr("Malformed glob regex at '$configPath:0': Missing '] near index 1\n[*\n ^") diff --git a/contrib/ci/jobs/2-test/test.sh b/contrib/ci/jobs/2-test/test.sh @@ -12,6 +12,7 @@ sudo -u postgres /usr/lib/postgresql/15/bin/postgres -D /etc/postgresql/15/main sleep 10 sudo -u postgres createuser -p 5432 root sudo -u postgres createdb -p 5432 -O root libeufincheck +# TODO run test as non root user to check permission errors in CI check_command() {