split storage & ugprade and separate fixtures
This commit is contained in:
parent
bf689a2478
commit
554d2b48c0
20 changed files with 170 additions and 118 deletions
58
storage/storage.sh
Executable file
58
storage/storage.sh
Executable file
|
@ -0,0 +1,58 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
|
||||
STORAGE_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}
|
||||
|
||||
function storage_reset() {
|
||||
local config=$1
|
||||
reset_forgejo $STORAGE_DIR/$config-app.ini
|
||||
reset_minio
|
||||
reset_garage
|
||||
}
|
||||
|
||||
function verify_storage() {
|
||||
local work_path=$DIR/forgejo-work-path
|
||||
|
||||
for path in ${STORAGE_PATHS} ; do
|
||||
test -d $work_path/data/$path
|
||||
done
|
||||
}
|
||||
|
||||
function cleanup_storage() {
|
||||
local work_path=$DIR/forgejo-work-path
|
||||
|
||||
for path in ${STORAGE_PATHS} ; do
|
||||
rm -fr $work_path/data/$path
|
||||
done
|
||||
}
|
||||
|
||||
function test_storage_stable_s3() {
|
||||
local work_path=$DIR/forgejo-work-path
|
||||
local s3_backend=${1:-minio}
|
||||
|
||||
log_info "See also https://codeberg.org/forgejo/forgejo/issues/1338"
|
||||
|
||||
for version in 1.18 1.19 1.20.2-0 1.20.3-0 1.20 1.21 $RELEASE_NUMBERS_AND_DEV ; do
|
||||
log_info "Forgejo $version & $s3_backend"
|
||||
stop
|
||||
storage_reset stable-s3
|
||||
start $version $s3_backend
|
||||
fixture_create
|
||||
for fun in ${STORAGE_FUN} ; do
|
||||
fixture_${fun}_assert_s3
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
source $STORAGE_DIR/test-upgrade-1.20-storage.sh
|
||||
|
||||
function test_storage() {
|
||||
run test_storage_stable_s3 minio
|
||||
run test_storage_stable_s3 garage
|
||||
|
||||
test_upgrade_1_20_storage
|
||||
run test_forgejo_database_v3_upgrades
|
||||
}
|
Loading…
Add table
Reference in a new issue