mirror of
https://code.forgejo.org/actions/setup-forgejo
synced 2025-06-08 03:58:19 +02:00
better verbosity for integration tests
This commit is contained in:
parent
eaecaaa2e6
commit
65714b4555
3 changed files with 27 additions and 20 deletions
|
@ -16,8 +16,8 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- if: matrix.info.tests != 'none'
|
||||
shell: bash
|
||||
run: |
|
||||
set -x
|
||||
LXC_IP_PREFIX=10.0.10 ./forgejo-dependencies.sh
|
||||
export PATH=$(pwd):$PATH
|
||||
forgejo.sh setup root admin1234 ${{ matrix.info.image }} ${{ matrix.info.version }}
|
||||
|
@ -32,29 +32,41 @@ jobs:
|
|||
forgejo-runner.sh setup
|
||||
export FORGEJO_RUNNER_LOGS=forgejo-runner.log
|
||||
|
||||
for example in ${{ matrix.info.tests }} ; do
|
||||
echo "============================ demo ==================="
|
||||
./forgejo-test-helper.sh run_workflow testdata/demo http://root:admin1234@$(cat forgejo-ip):3000 root demo setup-forgejo $(cat forgejo-token) > /tmp/output
|
||||
grep '^sha=' /tmp/output
|
||||
|
||||
function run() {
|
||||
local example=$1
|
||||
|
||||
export example
|
||||
export EXAMPLE_DIR=$(pwd)/testdata/example-$example
|
||||
|
||||
if test -f $EXAMPLE_DIR/setup.sh ; then
|
||||
$EXAMPLE_DIR/setup.sh
|
||||
echo "============================ SETUP example-$example ==================="
|
||||
bash -ex $EXAMPLE_DIR/setup.sh || return 1
|
||||
fi
|
||||
|
||||
echo "============================ BEGIN example-$example ==================="
|
||||
if test -f $EXAMPLE_DIR/run.sh ; then
|
||||
$EXAMPLE_DIR/run.sh
|
||||
echo "============================ RUN example-$example ==================="
|
||||
bash -ex $EXAMPLE_DIR/run.sh || return 1
|
||||
else
|
||||
if ! forgejo-test-helper.sh run_workflow testdata/example-$example http://root:admin1234@$(cat forgejo-ip):3000 root example-$example setup-forgejo $(cat forgejo-token) >& /tmp/run.out ; then
|
||||
cat /tmp/run.out
|
||||
false
|
||||
fi
|
||||
forgejo-test-helper.sh run_workflow testdata/example-$example http://root:admin1234@$(cat forgejo-ip):3000 root example-$example setup-forgejo $(cat forgejo-token) || return 1
|
||||
fi
|
||||
echo "============================ END example-$example ==================="
|
||||
|
||||
if test -f $EXAMPLE_DIR/teardown.sh ; then
|
||||
$EXAMPLE_DIR/teardown.sh
|
||||
echo "============================ TEARDOWN example-$example ==================="
|
||||
bash -ex $EXAMPLE_DIR/teardown.sh || return 1
|
||||
fi
|
||||
}
|
||||
|
||||
for example in ${{ matrix.info.tests }} ; do
|
||||
echo "============================ BEGIN example-$example ==================="
|
||||
if ! time run $example >& /tmp/run.out ; then
|
||||
cat /tmp/run.out
|
||||
echo "============================ FAIL example-$example ==================="
|
||||
sleep 5 # hack for Forgejo v1.21 to workaround a but by which the last lines of the output are moved to the next step
|
||||
false
|
||||
fi
|
||||
echo "============================ END example-$example ==================="
|
||||
done
|
||||
echo "============================ demo ==================="
|
||||
./forgejo-test-helper.sh run_workflow testdata/demo http://root:admin1234@$(cat forgejo-ip):3000 root demo setup-forgejo $(cat forgejo-token) > /tmp/output
|
||||
grep '^sha=' /tmp/output
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue