Merge pull request 'chore(cleanup): v1.20 is EOL, trim it' (#167) from earl-warren/end-to-end:wip-trim-v1.20 into main
Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/167
This commit is contained in:
commit
2171ed7a5e
14 changed files with 20 additions and 700 deletions
14
README.md
14
README.md
|
@ -3,13 +3,23 @@
|
|||
A series of tests scenarios and assertions covering
|
||||
[Forgejo](https://codeberg.org/forgejo/forgejo) and the [Forgejo
|
||||
runner](https://code.forgejo.org/forgejo/runner). They partially rely
|
||||
on [Forgejo actions](https://code.forgejo.org/actions) developped
|
||||
on [Forgejo actions](https://code.forgejo.org/actions) developed
|
||||
specifically for testing such as
|
||||
[setup-forgejo](https://code.forgejo.org/actions/setup-forgejo).
|
||||
|
||||
They are designed to run using Forgejo releases and development
|
||||
versions compiled from designated repositories.
|
||||
|
||||
# Removing legacy tests
|
||||
|
||||
End to end tests cover the supported range of releases and when one of
|
||||
them is EOL, it must be removed as well as the tests that target it
|
||||
specifically. Otherwise the test suite would grow indefinitely.
|
||||
|
||||
When a release is EOL, a branch is cut with a name following the
|
||||
pattern `legacy/vX.Y-vA.B`. For instance when `v8.0` is published and
|
||||
`v1.21` is EOL, the branch `legacy/v8.0-v1.21` is cut.
|
||||
|
||||
# Hacking
|
||||
|
||||
docker and sudo must be installed with insecure registries allowed in
|
||||
|
@ -46,7 +56,7 @@ make TAGS='bindata sqlite sqlite_unlock_notify' generate forgejo
|
|||
cp -a forgejo /srv/forgejo-binaries/forgejo-7.0-dev
|
||||
```
|
||||
|
||||
It will be used whenver the version `7.0-dev` is specified in a test.
|
||||
It will be used whenever the version `7.0-dev` is specified in a test.
|
||||
|
||||
## Running actions locally
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ function actions_runner_version() {
|
|||
}
|
||||
|
||||
function test_actions() {
|
||||
local versions="${1:-1.20 1.21 $RELEASE_NUMBERS_AND_DEV}"
|
||||
local versions="${1:-1.21 $RELEASE_NUMBERS_AND_DEV}"
|
||||
|
||||
for version in $versions ; do
|
||||
|
||||
|
@ -103,17 +103,11 @@ function test_actions() {
|
|||
done
|
||||
fi
|
||||
|
||||
for example in echo checkout service container expression local-action docker-action if if-fail ; do
|
||||
for example in echo checkout service container expression local-action docker-action if if-fail push tag push-cancel artifacts pull-request context ; do
|
||||
run actions_verify_example $example
|
||||
done
|
||||
|
||||
if dpkg --compare-versions $version gt 1.20 ; then
|
||||
for example in push tag push-cancel artifacts pull-request context ; do
|
||||
run actions_verify_example $example
|
||||
done
|
||||
fi
|
||||
|
||||
if dpkg --compare-versions $version gt 1.20 && dpkg --compare-versions $version lt 7.1 ; then
|
||||
if dpkg --compare-versions $version lt 7.1 ; then
|
||||
for example in cron ; do
|
||||
run actions_verify_example $example
|
||||
done
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
RUN_MODE = prod
|
||||
WORK_PATH = ${WORK_PATH}
|
||||
|
||||
[server]
|
||||
APP_DATA_PATH = ${WORK_PATH}/data
|
||||
DOMAIN = ${IP}
|
||||
HTTP_PORT = 3000
|
||||
SSH_LISTEN_PORT = 2222
|
||||
LFS_START_SERVER = true
|
||||
LFS_CONTENT_PATH = relative-lfs
|
||||
|
||||
[database]
|
||||
DB_TYPE = sqlite3
|
||||
PATH = ${WORK_PATH}/forgejo.db
|
||||
|
||||
[log]
|
||||
MODE = file
|
||||
LEVEL = debug
|
||||
ROUTER = file
|
||||
|
||||
[log.file]
|
||||
FILE_NAME = forgejo.log
|
||||
|
||||
[security]
|
||||
INSTALL_LOCK = true
|
||||
|
||||
[repository]
|
||||
ENABLE_PUSH_CREATE_USER = true
|
||||
DEFAULT_PUSH_CREATE_PRIVATE = false
|
||||
|
||||
[picture]
|
||||
AVATAR_UPLOAD_PATH = relative-avatars
|
||||
REPOSITORY_AVATAR_UPLOAD_PATH = relative-repo-avatars
|
|
@ -1,33 +0,0 @@
|
|||
RUN_MODE = prod
|
||||
WORK_PATH = ${WORK_PATH}
|
||||
|
||||
[server]
|
||||
APP_DATA_PATH = ${WORK_PATH}/data
|
||||
DOMAIN = ${IP}
|
||||
HTTP_PORT = 3000
|
||||
SSH_LISTEN_PORT = 2222
|
||||
LFS_START_SERVER = true
|
||||
|
||||
[database]
|
||||
DB_TYPE = sqlite3
|
||||
|
||||
[log]
|
||||
MODE = file
|
||||
LEVEL = debug
|
||||
ROUTER = file
|
||||
|
||||
[log.file]
|
||||
FILE_NAME = forgejo.log
|
||||
|
||||
[security]
|
||||
INSTALL_LOCK = true
|
||||
|
||||
[repository]
|
||||
ENABLE_PUSH_CREATE_USER = true
|
||||
DEFAULT_PUSH_CREATE_PRIVATE = false
|
||||
|
||||
[actions]
|
||||
ENABLED = true
|
||||
|
||||
[storage]
|
||||
PATH = ${WORK_PATH}/merged
|
|
@ -1,60 +0,0 @@
|
|||
RUN_MODE = prod
|
||||
WORK_PATH = ${WORK_PATH}
|
||||
|
||||
[server]
|
||||
APP_DATA_PATH = ${WORK_PATH}/elsewhere
|
||||
DOMAIN = ${IP}
|
||||
HTTP_PORT = 3000
|
||||
SSH_LISTEN_PORT = 2222
|
||||
LFS_START_SERVER = true
|
||||
|
||||
[database]
|
||||
DB_TYPE = sqlite3
|
||||
|
||||
[log]
|
||||
MODE = file
|
||||
LEVEL = debug
|
||||
ROUTER = file
|
||||
|
||||
[log.file]
|
||||
FILE_NAME = forgejo.log
|
||||
|
||||
[security]
|
||||
INSTALL_LOCK = true
|
||||
|
||||
[repository]
|
||||
ENABLE_PUSH_CREATE_USER = true
|
||||
DEFAULT_PUSH_CREATE_PRIVATE = false
|
||||
|
||||
[actions]
|
||||
ENABLED = true
|
||||
|
||||
[attachment]
|
||||
|
||||
[storage.attachments]
|
||||
PATH = ${WORK_PATH}/data/attachments
|
||||
|
||||
[lfs]
|
||||
|
||||
[storage.lfs]
|
||||
PATH = ${WORK_PATH}/data/lfs
|
||||
|
||||
[avatar]
|
||||
|
||||
[storage.avatars]
|
||||
PATH = ${WORK_PATH}/data/avatars
|
||||
|
||||
[repo-avatar]
|
||||
|
||||
[storage.repo-avatars]
|
||||
PATH = ${WORK_PATH}/data/repo-avatars
|
||||
|
||||
[repo-archive]
|
||||
|
||||
[storage.repo-archive]
|
||||
PATH = ${WORK_PATH}/data/repo-archive
|
||||
|
||||
[packages]
|
||||
|
||||
[storage.packages]
|
||||
PATH = ${WORK_PATH}/data/packages
|
|
@ -1,90 +0,0 @@
|
|||
RUN_MODE = prod
|
||||
WORK_PATH = ${WORK_PATH}
|
||||
|
||||
[server]
|
||||
APP_DATA_PATH = ${WORK_PATH}/elsewhere
|
||||
DOMAIN = ${IP}
|
||||
HTTP_PORT = 3000
|
||||
SSH_LISTEN_PORT = 2222
|
||||
LFS_START_SERVER = true
|
||||
|
||||
[database]
|
||||
DB_TYPE = sqlite3
|
||||
|
||||
[log]
|
||||
MODE = file
|
||||
LEVEL = debug
|
||||
ROUTER = file
|
||||
|
||||
[log.file]
|
||||
FILE_NAME = forgejo.log
|
||||
|
||||
[security]
|
||||
INSTALL_LOCK = true
|
||||
|
||||
[repository]
|
||||
ENABLE_PUSH_CREATE_USER = true
|
||||
DEFAULT_PUSH_CREATE_PRIVATE = false
|
||||
|
||||
[actions]
|
||||
ENABLED = true
|
||||
|
||||
[attachment]
|
||||
STORAGE_TYPE = minio
|
||||
SERVE_DIRECT = false
|
||||
MINIO_ENDPOINT = 127.0.0.1:9000
|
||||
MINIO_ACCESS_KEY_ID = 123456
|
||||
MINIO_SECRET_ACCESS_KEY = 12345678
|
||||
MINIO_BUCKET = forgejo
|
||||
MINIO_LOCATION = us-east-1
|
||||
MINIO_USE_SSL = false
|
||||
|
||||
[lfs]
|
||||
STORAGE_TYPE = minio
|
||||
SERVE_DIRECT = false
|
||||
MINIO_ENDPOINT = 127.0.0.1:9000
|
||||
MINIO_ACCESS_KEY_ID = 123456
|
||||
MINIO_SECRET_ACCESS_KEY = 12345678
|
||||
MINIO_BUCKET = forgejo
|
||||
MINIO_LOCATION = us-east-1
|
||||
MINIO_USE_SSL = false
|
||||
|
||||
[repo-avatar]
|
||||
STORAGE_TYPE = minio
|
||||
SERVE_DIRECT = false
|
||||
MINIO_ENDPOINT = 127.0.0.1:9000
|
||||
MINIO_ACCESS_KEY_ID = 123456
|
||||
MINIO_SECRET_ACCESS_KEY = 12345678
|
||||
MINIO_BUCKET = forgejo
|
||||
MINIO_LOCATION = us-east-1
|
||||
MINIO_USE_SSL = false
|
||||
|
||||
[avatar]
|
||||
STORAGE_TYPE = minio
|
||||
SERVE_DIRECT = false
|
||||
MINIO_ENDPOINT = 127.0.0.1:9000
|
||||
MINIO_ACCESS_KEY_ID = 123456
|
||||
MINIO_SECRET_ACCESS_KEY = 12345678
|
||||
MINIO_BUCKET = forgejo
|
||||
MINIO_LOCATION = us-east-1
|
||||
MINIO_USE_SSL = false
|
||||
|
||||
[repo-archive]
|
||||
STORAGE_TYPE = minio
|
||||
SERVE_DIRECT = false
|
||||
MINIO_ENDPOINT = 127.0.0.1:9000
|
||||
MINIO_ACCESS_KEY_ID = 123456
|
||||
MINIO_SECRET_ACCESS_KEY = 12345678
|
||||
MINIO_BUCKET = forgejo
|
||||
MINIO_LOCATION = us-east-1
|
||||
MINIO_USE_SSL = false
|
||||
|
||||
[packages]
|
||||
STORAGE_TYPE = minio
|
||||
SERVE_DIRECT = false
|
||||
MINIO_ENDPOINT = 127.0.0.1:9000
|
||||
MINIO_ACCESS_KEY_ID = 123456
|
||||
MINIO_SECRET_ACCESS_KEY = 12345678
|
||||
MINIO_BUCKET = forgejo
|
||||
MINIO_LOCATION = us-east-1
|
||||
MINIO_USE_SSL = false
|
|
@ -1,114 +0,0 @@
|
|||
RUN_MODE = prod
|
||||
WORK_PATH = ${WORK_PATH}
|
||||
|
||||
[server]
|
||||
APP_DATA_PATH = ${WORK_PATH}/elsewhere
|
||||
DOMAIN = ${IP}
|
||||
HTTP_PORT = 3000
|
||||
SSH_LISTEN_PORT = 2222
|
||||
LFS_START_SERVER = true
|
||||
|
||||
[database]
|
||||
DB_TYPE = sqlite3
|
||||
|
||||
[log]
|
||||
MODE = file
|
||||
LEVEL = debug
|
||||
ROUTER = file
|
||||
|
||||
[log.file]
|
||||
FILE_NAME = forgejo.log
|
||||
|
||||
[security]
|
||||
INSTALL_LOCK = true
|
||||
|
||||
[repository]
|
||||
ENABLE_PUSH_CREATE_USER = true
|
||||
DEFAULT_PUSH_CREATE_PRIVATE = false
|
||||
|
||||
[actions]
|
||||
ENABLED = true
|
||||
|
||||
[storage.attachments]
|
||||
STORAGE_TYPE = minio
|
||||
SERVE_DIRECT = false
|
||||
MINIO_ENDPOINT = 127.0.0.1:9000
|
||||
MINIO_ACCESS_KEY_ID = 123456
|
||||
MINIO_SECRET_ACCESS_KEY = 12345678
|
||||
MINIO_BUCKET = forgejo
|
||||
MINIO_LOCATION = us-east-1
|
||||
MINIO_USE_SSL = false
|
||||
|
||||
[storage.lfs]
|
||||
STORAGE_TYPE = minio
|
||||
SERVE_DIRECT = false
|
||||
MINIO_ENDPOINT = 127.0.0.1:9000
|
||||
MINIO_ACCESS_KEY_ID = 123456
|
||||
MINIO_SECRET_ACCESS_KEY = 12345678
|
||||
MINIO_BUCKET = forgejo
|
||||
MINIO_LOCATION = us-east-1
|
||||
MINIO_USE_SSL = false
|
||||
|
||||
[picture]
|
||||
AVATAR_STORAGE_TYPE = minio
|
||||
REPOSITORY_AVATAR_STORAGE_TYPE = minio
|
||||
|
||||
[storage.repo-avatars]
|
||||
STORAGE_TYPE = minio
|
||||
SERVE_DIRECT = false
|
||||
MINIO_ENDPOINT = 127.0.0.1:9000
|
||||
MINIO_ACCESS_KEY_ID = 123456
|
||||
MINIO_SECRET_ACCESS_KEY = 12345678
|
||||
MINIO_BUCKET = forgejo
|
||||
MINIO_LOCATION = us-east-1
|
||||
MINIO_USE_SSL = false
|
||||
|
||||
[storage.minio]
|
||||
STORAGE_TYPE = minio
|
||||
SERVE_DIRECT = false
|
||||
MINIO_ENDPOINT = 127.0.0.1:9000
|
||||
MINIO_ACCESS_KEY_ID = 123456
|
||||
MINIO_SECRET_ACCESS_KEY = 12345678
|
||||
MINIO_BUCKET = forgejo
|
||||
MINIO_LOCATION = us-east-1
|
||||
MINIO_USE_SSL = false
|
||||
|
||||
[storage]
|
||||
STORAGE_TYPE = minio
|
||||
SERVE_DIRECT = false
|
||||
MINIO_ENDPOINT = 127.0.0.1:9000
|
||||
MINIO_ACCESS_KEY_ID = 123456
|
||||
MINIO_SECRET_ACCESS_KEY = 12345678
|
||||
MINIO_BUCKET = forgejo
|
||||
MINIO_LOCATION = us-east-1
|
||||
MINIO_USE_SSL = false
|
||||
|
||||
[storage.avatars]
|
||||
STORAGE_TYPE = minio
|
||||
SERVE_DIRECT = false
|
||||
MINIO_ENDPOINT = 127.0.0.1:9000
|
||||
MINIO_ACCESS_KEY_ID = 123456
|
||||
MINIO_SECRET_ACCESS_KEY = 12345678
|
||||
MINIO_BUCKET = forgejo
|
||||
MINIO_LOCATION = us-east-1
|
||||
MINIO_USE_SSL = false
|
||||
|
||||
[storage.repo-archive]
|
||||
STORAGE_TYPE = minio
|
||||
SERVE_DIRECT = false
|
||||
MINIO_ENDPOINT = 127.0.0.1:9000
|
||||
MINIO_ACCESS_KEY_ID = 123456
|
||||
MINIO_SECRET_ACCESS_KEY = 12345678
|
||||
MINIO_BUCKET = forgejo
|
||||
MINIO_LOCATION = us-east-1
|
||||
MINIO_USE_SSL = false
|
||||
|
||||
[storage.packages]
|
||||
STORAGE_TYPE = minio
|
||||
SERVE_DIRECT = false
|
||||
MINIO_ENDPOINT = 127.0.0.1:9000
|
||||
MINIO_ACCESS_KEY_ID = 123456
|
||||
MINIO_SECRET_ACCESS_KEY = 12345678
|
||||
MINIO_BUCKET = forgejo
|
||||
MINIO_LOCATION = us-east-1
|
||||
MINIO_USE_SSL = false
|
|
@ -1,45 +0,0 @@
|
|||
RUN_MODE = prod
|
||||
WORK_PATH = ${WORK_PATH}
|
||||
|
||||
[server]
|
||||
APP_DATA_PATH = ${WORK_PATH}/data
|
||||
DOMAIN = ${IP}
|
||||
HTTP_PORT = 3000
|
||||
SSH_LISTEN_PORT = 2222
|
||||
LFS_START_SERVER = true
|
||||
|
||||
[database]
|
||||
DB_TYPE = sqlite3
|
||||
|
||||
[log]
|
||||
MODE = file
|
||||
LEVEL = debug
|
||||
ROUTER = file
|
||||
|
||||
[log.file]
|
||||
FILE_NAME = forgejo.log
|
||||
|
||||
[security]
|
||||
INSTALL_LOCK = true
|
||||
|
||||
[repository]
|
||||
ENABLE_PUSH_CREATE_USER = true
|
||||
DEFAULT_PUSH_CREATE_PRIVATE = false
|
||||
|
||||
[attachment]
|
||||
PATH = relative-attachments
|
||||
|
||||
[lfs]
|
||||
PATH = relative-lfs
|
||||
|
||||
[avatar]
|
||||
PATH = relative-avatars
|
||||
|
||||
[repo-avatar]
|
||||
PATH = relative-repo-avatars
|
||||
|
||||
[repo-archive]
|
||||
PATH = relative-repo-archive
|
||||
|
||||
[packages]
|
||||
PATH = relative-packages
|
|
@ -1,45 +0,0 @@
|
|||
RUN_MODE = prod
|
||||
WORK_PATH = ${WORK_PATH}
|
||||
|
||||
[server]
|
||||
APP_DATA_PATH = ${WORK_PATH}/data
|
||||
DOMAIN = ${IP}
|
||||
HTTP_PORT = 3000
|
||||
SSH_LISTEN_PORT = 2222
|
||||
LFS_START_SERVER = true
|
||||
|
||||
[database]
|
||||
DB_TYPE = sqlite3
|
||||
|
||||
[log]
|
||||
MODE = file
|
||||
LEVEL = debug
|
||||
ROUTER = file
|
||||
|
||||
[log.file]
|
||||
FILE_NAME = forgejo.log
|
||||
|
||||
[security]
|
||||
INSTALL_LOCK = true
|
||||
|
||||
[repository]
|
||||
ENABLE_PUSH_CREATE_USER = true
|
||||
DEFAULT_PUSH_CREATE_PRIVATE = false
|
||||
|
||||
[storage.attachments]
|
||||
PATH = relative-attachments
|
||||
|
||||
[storage.lfs]
|
||||
PATH = relative-lfs
|
||||
|
||||
[storage.avatars]
|
||||
PATH = relative-avatars
|
||||
|
||||
[storage.repo-avatars]
|
||||
PATH = relative-repo-avatars
|
||||
|
||||
[storage.repo-archive]
|
||||
PATH = relative-repo-archive
|
||||
|
||||
[storage.packages]
|
||||
PATH = relative-packages
|
|
@ -33,7 +33,7 @@ function test_storage_stable_s3() {
|
|||
|
||||
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
|
||||
for version in 1.21 $RELEASE_NUMBERS_AND_DEV ; do
|
||||
log_info "Forgejo $version & $s3_backend"
|
||||
stop
|
||||
storage_reset stable-s3
|
||||
|
@ -45,12 +45,7 @@ function test_storage_stable_s3() {
|
|||
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
|
||||
}
|
||||
|
|
|
@ -1,223 +0,0 @@
|
|||
#!/bin/bash
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
function test_downgrade_1.20.2_fails() {
|
||||
local work_path=$DIR/forgejo-work-path
|
||||
|
||||
log_info "See also https://codeberg.org/forgejo/forgejo/pulls/1225"
|
||||
|
||||
log_info "downgrading from 1.20.3-0 to 1.20.2-0 fails"
|
||||
stop
|
||||
storage_reset default
|
||||
start 1.20.3-0
|
||||
stop
|
||||
download 1.20.2-0
|
||||
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
|
||||
fi
|
||||
}
|
||||
|
||||
function test_bug_storage_merged() {
|
||||
local work_path=$DIR/forgejo-work-path
|
||||
|
||||
log_info "See also https://codeberg.org/forgejo/forgejo/pulls/1225"
|
||||
|
||||
log_info "using < 1.20.3-0 and [storage].PATH merge all storage"
|
||||
for version in 1.18.5-0 1.19.4-0 1.20.2-0 ; do
|
||||
stop
|
||||
storage_reset merged
|
||||
start $version
|
||||
for path in ${STORAGE_PATHS} ; do
|
||||
! test -d $work_path/data/$path
|
||||
done
|
||||
for path in ${STORAGE_PATHS} ; do
|
||||
! test -d $work_path/merged/$path
|
||||
done
|
||||
test -d $work_path/merged
|
||||
done
|
||||
stop
|
||||
|
||||
log_info "upgrading from 1.20.2-0 with [storage].PATH fails"
|
||||
download 1.20.3-0
|
||||
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
|
||||
fi
|
||||
}
|
||||
|
||||
function test_bug_storage_relative_path() {
|
||||
local work_path=$DIR/forgejo-work-path
|
||||
|
||||
log_info "using < 1.20.3-0 legacy [server].XXXX and [picture].XXXX are relative to WORK_PATH"
|
||||
for version in 1.18.5-0 1.19.4-0 1.20.2-0 ; do
|
||||
stop
|
||||
storage_reset legagy-relative
|
||||
start $version
|
||||
test -d $work_path/relative-lfs
|
||||
test -d $work_path/relative-avatars
|
||||
test -d $work_path/relative-repo-avatars
|
||||
done
|
||||
|
||||
log_info "using >= 1.20.3-0 legacy [server].XXXX and [picture].XXXX are relative to APP_DATA_PATH"
|
||||
for version in 1.20.3-0 1.21.0-5-rc2 ; do
|
||||
stop
|
||||
storage_reset legagy-relative
|
||||
start $version
|
||||
test -d $work_path/data/relative-lfs
|
||||
test -d $work_path/data/relative-avatars
|
||||
test -d $work_path/data/relative-repo-avatars
|
||||
done
|
||||
|
||||
log_info "using >= 1.20.3-0 relative [storage.XXXX].PATHS are relative to APP_DATA_PATH"
|
||||
for version in 1.20.3-0 1.21.0-5-rc2 ; do
|
||||
stop
|
||||
storage_reset storage-relative
|
||||
start $version
|
||||
for path in ${STORAGE_PATHS} ; do
|
||||
test -d $work_path/data/relative-$path
|
||||
done
|
||||
done
|
||||
|
||||
log_info "using 1.20.[12]-0 relative [storage.XXXX].PATHS are inconsistent"
|
||||
for version in 1.20.2-0 ; do
|
||||
stop
|
||||
storage_reset storage-relative
|
||||
start $version
|
||||
test -d $work_path/data/packages
|
||||
test -d $work_path/relative-repo-archive
|
||||
test -d $work_path/relative-attachments
|
||||
test -d $work_path/relative-lfs
|
||||
test -d $work_path/data/avatars
|
||||
test -d $work_path/data/repo-avatars
|
||||
done
|
||||
|
||||
log_info "using < 1.20 relative [storage.XXXX].PATHS are inconsistent"
|
||||
for version in 1.18.5-0 1.19.4-0 ; do
|
||||
stop
|
||||
storage_reset storage-relative
|
||||
start $version
|
||||
test -d $work_path/relative-packages
|
||||
test -d $work_path/relative-repo-archive
|
||||
test -d $work_path/relative-attachments
|
||||
test -d $work_path/data/lfs
|
||||
test -d $work_path/data/avatars
|
||||
test -d $work_path/data/repo-avatars
|
||||
done
|
||||
|
||||
log_info "using < 1.20.3-0 relative [XXXX].PATHS are relative to WORK_PATH"
|
||||
for version in 1.18.5-0 1.19.4-0 1.20.2-0 ; do
|
||||
stop
|
||||
storage_reset relative
|
||||
start $version
|
||||
for path in ${STORAGE_PATHS} ; do
|
||||
test -d $work_path/relative-$path
|
||||
done
|
||||
done
|
||||
|
||||
log_info "using >= 1.20.3-0 relative [XXXX].PATHS are relative to APP_DATA_PATH"
|
||||
for version in 1.20.3-0 1.21.0-5-rc2 ; do
|
||||
stop
|
||||
storage_reset relative
|
||||
start $version
|
||||
for path in ${STORAGE_PATHS} ; do
|
||||
test -d $work_path/data/relative-$path
|
||||
done
|
||||
done
|
||||
|
||||
stop
|
||||
}
|
||||
|
||||
function test_bug_storage_s3_misplace() {
|
||||
local work_path=$DIR/forgejo-work-path
|
||||
local s3_backend=${2:-minio}
|
||||
|
||||
log_info "See also https://codeberg.org/forgejo/forgejo/issues/1338"
|
||||
|
||||
for version in 1.20.2-0 1.20.3-0 ; do
|
||||
log_info "Forgejo $version & $s3_backend"
|
||||
stop
|
||||
storage_reset misplace-s3
|
||||
start $version $s3_backend
|
||||
fixture_create
|
||||
for fun in ${STORAGE_FUN} ; do
|
||||
fixture_${fun}_assert_s3
|
||||
done
|
||||
done
|
||||
|
||||
for version in 1.18.5-0 1.19.4-0 ; do
|
||||
log_info "Forgejo $version & $s3_backend"
|
||||
stop
|
||||
storage_reset misplace-s3
|
||||
start $version $s3_backend
|
||||
fixture_create
|
||||
#
|
||||
# some storage are in S3
|
||||
#
|
||||
fixture_attachments_assert_s3
|
||||
fixture_lfs_assert_s3
|
||||
#
|
||||
# others are in local
|
||||
#
|
||||
fixture_repo_archive_assert_local elsewhere/repo-archive
|
||||
fixture_avatars_assert_local elsewhere/avatars
|
||||
fixture_packages_assert_local elsewhere/packages
|
||||
fixture_repo_avatars_assert_local elsewhere/repo-avatars
|
||||
done
|
||||
}
|
||||
|
||||
function test_bug_storage_misplace() {
|
||||
local work_path=$DIR/forgejo-work-path
|
||||
|
||||
log_info "See also https://codeberg.org/forgejo/forgejo/pulls/1225"
|
||||
|
||||
log_info "using < 1.20 and conflicting sections misplace storage"
|
||||
for version in 1.18.5-0 1.19.4-0 ; do
|
||||
stop
|
||||
storage_reset misplace
|
||||
start $version
|
||||
#
|
||||
# some storage are where they should be
|
||||
#
|
||||
test -d $work_path/data/packages
|
||||
test -d $work_path/data/repo-archive
|
||||
test -d $work_path/data/attachments
|
||||
#
|
||||
# others are under APP_DATA_PATH
|
||||
#
|
||||
test -d $work_path/elsewhere/lfs
|
||||
test -d $work_path/elsewhere/avatars
|
||||
test -d $work_path/elsewhere/repo-avatars
|
||||
done
|
||||
|
||||
log_info "using < 1.20.[12]-0 and conflicting sections ignores [storage.*]"
|
||||
for version in 1.20.2-0 ; do
|
||||
stop
|
||||
storage_reset misplace
|
||||
start $version
|
||||
for path in ${STORAGE_PATHS} ; do
|
||||
test -d $work_path/elsewhere/$path
|
||||
done
|
||||
done
|
||||
|
||||
stop
|
||||
|
||||
log_info "upgrading from 1.20.2-0 with conflicting sections fails"
|
||||
download 1.20.3-0
|
||||
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
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
function test_upgrade_1_20_storage() {
|
||||
run test_bug_storage_misplace
|
||||
run test_bug_storage_merged
|
||||
run test_downgrade_1.20.2_fails
|
||||
run test_bug_storage_s3_misplace
|
||||
}
|
|
@ -24,9 +24,10 @@ function test_upload_profiles() {
|
|||
|
||||
function test_forgejo_pprof() {
|
||||
stop
|
||||
docker rm -f test_pyroscope
|
||||
docker run --name test_pyroscope --rm -d -p 4040:4040 docker.io/grafana/pyroscope
|
||||
|
||||
|
||||
reset_forgejo $UPGRADE_DIR/default-app.ini
|
||||
log_info "run 7.0-test"
|
||||
start 7.0-test
|
||||
test_upload_profiles
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
|
||||
function test_forgejo_database_version() {
|
||||
local expected_version=$1
|
||||
local work_path=$DIR/forgejo-work-path
|
||||
|
||||
actual_version=$(sqlite3 $work_path/forgejo.db "select version from forgejo_version")
|
||||
test "$expected_version" = "$actual_version"
|
||||
}
|
||||
|
||||
function test_forgejo_database_v3_upgrades_list_table() {
|
||||
local table=$1
|
||||
local work_path=$DIR/forgejo-work-path
|
||||
|
||||
sqlite3 $work_path/forgejo.db ".tables $table" .exit | grep --quiet $table
|
||||
}
|
||||
|
||||
function test_forgejo_database_v3_upgrades() {
|
||||
local table=forgejo_auth_token
|
||||
|
||||
stop
|
||||
|
||||
upgrade_reset default
|
||||
log_info "run 1.20.4-1"
|
||||
start 1.20.4-1
|
||||
stop
|
||||
! test_forgejo_database_v3_upgrades_list_table $table
|
||||
test_forgejo_database_version 2
|
||||
|
||||
log_info "run 1.20.5-0"
|
||||
start 1.20.5-0
|
||||
stop
|
||||
test_forgejo_database_v3_upgrades_list_table $table
|
||||
test_forgejo_database_version 3
|
||||
}
|
|
@ -30,7 +30,7 @@ function test_successful_upgrades() {
|
|||
log_info "using $config app.ini"
|
||||
upgrade_reset $config
|
||||
|
||||
version=1.18
|
||||
version=1.21
|
||||
log_info "run $version"
|
||||
cleanup_storage
|
||||
start $version
|
||||
|
@ -38,7 +38,7 @@ function test_successful_upgrades() {
|
|||
fixture_assert
|
||||
doctor_run $version
|
||||
|
||||
for version in 1.19 1.20 1.21 $RELEASE_NUMBERS_AND_DEV ; do
|
||||
for version in $RELEASE_NUMBERS_AND_DEV ; do
|
||||
stop
|
||||
log_info "run $version"
|
||||
start $version
|
||||
|
@ -92,7 +92,6 @@ function test_gitea_upgrades() {
|
|||
done
|
||||
}
|
||||
|
||||
source $UPGRADE_DIR/test-upgrade-forgejo-database-v3.sh
|
||||
source $UPGRADE_DIR/test-pprof-upload.sh
|
||||
|
||||
function test_upgrades() {
|
||||
|
@ -100,7 +99,6 @@ function test_upgrades() {
|
|||
run build_all
|
||||
|
||||
run test_successful_upgrades
|
||||
run test_forgejo_database_v3_upgrades
|
||||
run test_forgejo_pprof
|
||||
run test_gitea_upgrades
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue