refactor end-to-end.yml workflow to use a top-level end-to-end.sh

This commit is contained in:
Twenty Panda 2024-03-17 11:58:02 +01:00
parent 62f75aa56f
commit bf689a2478
9 changed files with 142 additions and 74 deletions

View file

@ -12,7 +12,7 @@ function test_downgrade_1.20.2_fails() {
start 1.20.3-0
stop
download 1.20.2-0
timeout 60 $DIR/forgejo-1.20.2-0 --config $work_path/app.ini --work-path $work_path || true
timeout 60 $DIR_BINARIES/forgejo-1.20.2-0 --config $work_path/app.ini --work-path $work_path || true
if ! grep --fixed-strings --quiet 'use the newer database' $work_path/log/forgejo.log ; then
cat $work_path/log/forgejo.log
return 1
@ -41,7 +41,7 @@ function test_bug_storage_merged() {
log_info "upgrading from 1.20.2-0 with [storage].PATH fails"
download 1.20.3-0
timeout 60 $DIR/forgejo-1.20.3-0 --config $work_path/app.ini --work-path $work_path || true
timeout 60 $DIR_BINARIES/forgejo-1.20.3-0 --config $work_path/app.ini --work-path $work_path || true
if ! grep --fixed-strings --quiet '[storage].PATH is set and may create storage issues' $work_path/log/forgejo.log ; then
cat $work_path/log/forgejo.log
return 1
@ -206,7 +206,7 @@ function test_bug_storage_misplace() {
log_info "upgrading from 1.20.2-0 with conflicting sections fails"
download 1.20.3-0
timeout 60 $DIR/forgejo-1.20.3-0 --config $work_path/app.ini --work-path $work_path || true
timeout 60 $DIR_BINARIES/forgejo-1.20.3-0 --config $work_path/app.ini --work-path $work_path || true
for path in ${STORAGE_PATHS} ; do
if ! grep --fixed-strings --quiet "[storage.$path] may conflict" $work_path/log/forgejo.log ; then
cat $work_path/log/forgejo.log

View file

@ -11,19 +11,17 @@
# Everything happens in /tmp/forgejo-upgrades
#
SELF_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SELF="${BASH_SOURCE[0]}"
source $SELF_DIR/../../lib/lib.sh
UPGRADE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
STORAGE_PATHS="attachments avatars lfs packages repo-archive repo-avatars"
STORAGE_FUN="attachments avatars lfs packages repo_archive repo_avatars"
: ${FORGEJO_REPO:=fixture}
source $SELF_DIR/fixtures.sh
source $UPGRADE_DIR/fixtures.sh
function reset() {
local config=$1
reset_forgejo $SELF_DIR/$config-app.ini
reset_forgejo $UPGRADE_DIR/$config-app.ini
reset_minio
reset_garage
}
@ -86,17 +84,14 @@ function test_forgejo_database_version() {
test "$expected_version" = "$actual_version"
}
source $SELF_DIR/test-upgrade-1.20-storage.sh
source $SELF_DIR/test-upgrade-forgejo-database-v3.sh
source $SELF_DIR/../../packages/packages.sh
source $UPGRADE_DIR/test-upgrade-1.20-storage.sh
source $UPGRADE_DIR/test-upgrade-forgejo-database-v3.sh
function test_upgrades() {
run stop
run dependencies
run build_all
test_packages
run test_successful_upgrades
run test_storage_stable_s3 minio
run test_storage_stable_s3 garage
@ -104,5 +99,3 @@ function test_upgrades() {
test_upgrade_1_20_storage
run test_forgejo_database_v3_upgrades
}
"$@"