Skip to content

Commit

Permalink
Add extra test to detect the error
Browse files Browse the repository at this point in the history
Add the case where the user did not run the `make domserver`

In that case root will create the files and not chown them to the right user.
  • Loading branch information
Michael Vasseur committed Oct 28, 2024
1 parent 465e07b commit f6b1ed8
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
36 changes: 36 additions & 0 deletions .github/jobs/configure-checks/all.bats
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ setup() {
repo-install gcc g++ libcgroup-dev composer
}

run_user_stderr () {
su $u -c "$*" 2>&1
}

run_stderr () {
"$*" 2>&1
}

run_configure () {
su $u -c "./configure $*"
}
Expand Down Expand Up @@ -454,3 +462,31 @@ compile_assertions_finished () {
run make judgehost
assert_failure
}

@test "'Make distclean' has all permissions" {
if [ "$distro_id" = "ID=fedora" ]; then
# Fails as libraries are not found
skip
fi
setup
run run_configure
run_user_stderr make domserver
make install-domserver
run_user_stderr make distclean
refute_partial "cannot remove"
refute_partial "Permission denied"
assert_success
}

@test "'Make distclean' has permission errors" {
if [ "$distro_id" = "ID=fedora" ]; then
# Fails as libraries are not found
skip
fi
setup
run run_configure
run_stderr make install-domserver
run_user_stderr make distclean
assert_partial "cannot remove"
assert_partial "Permission denied"
}
8 changes: 6 additions & 2 deletions .github/jobs/configure-checks/setup_configure_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ case $distro_id in
apt-get update; apt-get full-upgrade -y
apt-get install pkg-config make bats autoconf -y
apt-get install composer php php-cli php-curl php-fpm php-gd \
php-intl php-json php-mbstring php-mysql php-xml php-zip -y ;;
php-intl php-json php-mbstring php-mysql php-xml php-zip \
acl zip unzip mariadb-server python3-sphinx \
python3-sphinx-rtd-theme rst2pdf fontconfig python3-yaml \
latexmk texlive-latex-recommended texlive-latex-extra \
tex-gyre -y ;;
esac

# Build the configure file
Expand All @@ -22,7 +26,7 @@ case $distro_id in
"ID=fedora")
true ;;
*)
composer install --no-scripts ;;
(cd webapp; composer install --no-scripts ) ;;
esac

# Install extra assert statements for bots
Expand Down

0 comments on commit f6b1ed8

Please sign in to comment.