From 8636471d6356325f34ea6afbe4a6735201d4ffcf Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 11 Aug 2024 11:38:52 +0200 Subject: [PATCH] actions: verify the log compression feature If running Forgejo >= v9.0, verify the logs are compressed by default --- actions/actions.sh | 24 +++++++++++++++++++++--- actions/feature-logs-compression/run.sh | 8 ++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) create mode 100755 actions/feature-logs-compression/run.sh diff --git a/actions/actions.sh b/actions/actions.sh index b411778..7bcc4df 100755 --- a/actions/actions.sh +++ b/actions/actions.sh @@ -3,13 +3,27 @@ ACTIONS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -function actions_verify_example() { - local example=$1 - +function actions_export_variables() { export HOST_PORT export url=http://${FORGEJO_USER}:${FORGEJO_PASSWORD}@${HOST_PORT} export token=$(cat $DOT_FORGEJO_CURL/token) +} +function actions_verify_feature() { + local feature=$1 + + actions_export_variables + + export FEATURE_DIR=$ACTIONS_DIR/feature-$feature + + echo "============================ RUN feature-$feature ===================" + bash -ex $FEATURE_DIR/run.sh || return 1 +} + +function actions_verify_example() { + local example=$1 + + actions_export_variables actions_cleanup_example_volume export example @@ -124,5 +138,9 @@ function test_actions() { run actions_verify_example $example done fi + + if dpkg --compare-versions $version ge 9.0; then + run actions_verify_feature logs-compression + fi done } diff --git a/actions/feature-logs-compression/run.sh b/actions/feature-logs-compression/run.sh new file mode 100755 index 0000000..c1cd259 --- /dev/null +++ b/actions/feature-logs-compression/run.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e + +source $FEATURE_DIR/../../lib/lib.sh +source $FEATURE_DIR/../../forgejo/fixtures.sh + +fixture_get_one_path local data/actions_log/root/example-echo/01/1.log.zst