From 456dab50024af4a47217776f84e0ea015b489583 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 25 Apr 2024 12:38:58 +0200 Subject: [PATCH 1/3] docs: managing legacy tests and cutting branches --- README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2b409da..39644c6 100644 --- a/README.md +++ b/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 From e80f12ace917124cc5a3d69d7d1ae31ca7aaf8a1 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 25 Apr 2024 12:39:48 +0200 Subject: [PATCH 2/3] chore(cleanup): v1.20 is EOL, trim it --- actions/actions.sh | 12 +- storage/legagy-relative-app.ini | 33 --- storage/merged-app.ini | 33 --- storage/misplace-app.ini | 60 ------ storage/misplace-s3-app.ini | 90 -------- storage/misplace-s3-two-app.ini | 114 ---------- storage/relative-app.ini | 45 ---- storage/storage-relative-app.ini | 45 ---- storage/storage.sh | 7 +- storage/test-upgrade-1.20-storage.sh | 223 -------------------- upgrade/test-upgrade-forgejo-database-v3.sh | 35 --- upgrade/upgrade.sh | 6 +- 12 files changed, 6 insertions(+), 697 deletions(-) delete mode 100644 storage/legagy-relative-app.ini delete mode 100644 storage/merged-app.ini delete mode 100644 storage/misplace-app.ini delete mode 100644 storage/misplace-s3-app.ini delete mode 100644 storage/misplace-s3-two-app.ini delete mode 100644 storage/relative-app.ini delete mode 100644 storage/storage-relative-app.ini delete mode 100644 storage/test-upgrade-1.20-storage.sh delete mode 100644 upgrade/test-upgrade-forgejo-database-v3.sh diff --git a/actions/actions.sh b/actions/actions.sh index def5fef..32b110b 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -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 diff --git a/storage/legagy-relative-app.ini b/storage/legagy-relative-app.ini deleted file mode 100644 index f5ea40f..0000000 --- a/storage/legagy-relative-app.ini +++ /dev/null @@ -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 diff --git a/storage/merged-app.ini b/storage/merged-app.ini deleted file mode 100644 index 0a30227..0000000 --- a/storage/merged-app.ini +++ /dev/null @@ -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 diff --git a/storage/misplace-app.ini b/storage/misplace-app.ini deleted file mode 100644 index 9ffe725..0000000 --- a/storage/misplace-app.ini +++ /dev/null @@ -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 diff --git a/storage/misplace-s3-app.ini b/storage/misplace-s3-app.ini deleted file mode 100644 index 490abbe..0000000 --- a/storage/misplace-s3-app.ini +++ /dev/null @@ -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 diff --git a/storage/misplace-s3-two-app.ini b/storage/misplace-s3-two-app.ini deleted file mode 100644 index bcf65c8..0000000 --- a/storage/misplace-s3-two-app.ini +++ /dev/null @@ -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 diff --git a/storage/relative-app.ini b/storage/relative-app.ini deleted file mode 100644 index 5bce502..0000000 --- a/storage/relative-app.ini +++ /dev/null @@ -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 diff --git a/storage/storage-relative-app.ini b/storage/storage-relative-app.ini deleted file mode 100644 index d0b7023..0000000 --- a/storage/storage-relative-app.ini +++ /dev/null @@ -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 diff --git a/storage/storage.sh b/storage/storage.sh index b08e6bc..a531e50 100755 --- a/storage/storage.sh +++ b/storage/storage.sh @@ -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 } diff --git a/storage/test-upgrade-1.20-storage.sh b/storage/test-upgrade-1.20-storage.sh deleted file mode 100644 index 063b56a..0000000 --- a/storage/test-upgrade-1.20-storage.sh +++ /dev/null @@ -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 -} diff --git a/upgrade/test-upgrade-forgejo-database-v3.sh b/upgrade/test-upgrade-forgejo-database-v3.sh deleted file mode 100644 index f15a4f3..0000000 --- a/upgrade/test-upgrade-forgejo-database-v3.sh +++ /dev/null @@ -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 -} diff --git a/upgrade/upgrade.sh b/upgrade/upgrade.sh index 8de9903..3b89393 100755 --- a/upgrade/upgrade.sh +++ b/upgrade/upgrade.sh @@ -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 } From c5a35b1ad5c7c5f8808b6bd55c15b2fe69863847 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 25 Apr 2024 13:54:12 +0200 Subject: [PATCH 3/3] fix(pprof): reset_forgejo before running it it was working before because the previous tests did it. Now that it is gone, it no longer worked because there was no app.ini. --- upgrade/test-pprof-upload.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/upgrade/test-pprof-upload.sh b/upgrade/test-pprof-upload.sh index 80425a9..e5ab46d 100644 --- a/upgrade/test-pprof-upload.sh +++ b/upgrade/test-pprof-upload.sh @@ -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