Add coverage (#914)
Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/914 Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
This commit is contained in:
parent
fea037d403
commit
8f920b4b7a
4 changed files with 31 additions and 2 deletions
11
.forgejo/upload-coverage/action.yml
Normal file
11
.forgejo/upload-coverage/action.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
inputs:
|
||||
scope:
|
||||
description: 'Scope of the coverage'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage-${{ inputs.scope }}
|
||||
path: /tmp/forgejo-end-to-end/coverage
|
||||
|
|
@ -86,6 +86,10 @@ jobs:
|
|||
with:
|
||||
built: ${{ needs.build.outputs.built }}
|
||||
- run: su forgejo -c "./end-to-end.sh test_packages"
|
||||
- if: ${{ needs.build.outputs.built == 'yes' }}
|
||||
uses: ./.forgejo/upload-coverage
|
||||
with:
|
||||
scope: packages
|
||||
- name: full logs
|
||||
if: always()
|
||||
run: su forgejo -c "./end-to-end.sh show_logs"
|
||||
|
|
@ -100,6 +104,10 @@ jobs:
|
|||
built: ${{ needs.build.outputs.built }}
|
||||
- run: ./end-to-end.sh prepare_dockerd
|
||||
- run: su forgejo -c "./end-to-end.sh test_actions"
|
||||
- if: ${{ needs.build.outputs.built == 'yes' }}
|
||||
uses: ./.forgejo/upload-coverage
|
||||
with:
|
||||
scope: actions
|
||||
- name: full logs
|
||||
if: always()
|
||||
run: su forgejo -c "./end-to-end.sh show_logs"
|
||||
|
|
@ -124,6 +132,10 @@ jobs:
|
|||
key: gitlab
|
||||
- run: |
|
||||
su forgejo -c "./end-to-end.sh test_federation"
|
||||
- if: ${{ needs.build.outputs.built == 'yes' }}
|
||||
uses: ./.forgejo/upload-coverage
|
||||
with:
|
||||
scope: federation
|
||||
- name: full logs
|
||||
if: always()
|
||||
run: su forgejo -c "./end-to-end.sh show_logs"
|
||||
|
|
@ -187,6 +199,10 @@ jobs:
|
|||
built: ${{ needs.build.outputs.built }}
|
||||
- run: su forgejo -c "./end-to-end.sh test_upgrades"
|
||||
- run: su forgejo -c "./end-to-end.sh test_storage"
|
||||
- if: ${{ needs.build.outputs.built == 'yes' }}
|
||||
uses: ./.forgejo/upload-coverage
|
||||
with:
|
||||
scope: upgrade
|
||||
- name: full logs
|
||||
if: always()
|
||||
run: su forgejo -c "./end-to-end.sh show_logs"
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ done
|
|||
git fetch --update-head-ok origin +$ref:$ref
|
||||
git switch --force-create $v $ref
|
||||
|
||||
export TAGS="bindata sqlite sqlite_unlock_notify" FORGEJO_VERSION=$semver
|
||||
export TAGS="bindata sqlite sqlite_unlock_notify" FORGEJO_VERSION=$semver EXTRA_GOFLAGS="-cover"
|
||||
make deps-backend backend
|
||||
make generate forgejo
|
||||
cp -a forgejo $dir_binaries/forgejo-$v-dev
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ RELEASE_NUMBERS="11.0 12.0 13.0"
|
|||
PREFIX===============
|
||||
export DIR=/tmp/forgejo-end-to-end
|
||||
DIR_BINARIES=/srv/forgejo-binaries
|
||||
COVERAGE_DIR="$DIR/coverage"
|
||||
export DOT_FORGEJO_CURL=$DIR/forgejo-curl
|
||||
export DOT=$DOT_FORGEJO_CURL # for backward compatibility with forgejo-curl.sh 1.0.0
|
||||
: ${FORGEJO_USER:=root}
|
||||
|
|
@ -262,7 +263,8 @@ function start_forgejo_daemon() {
|
|||
|
||||
local base=$(work_path_base $config)
|
||||
local work_path=$DIR/$base
|
||||
daemon --chdir=$DIR --unsafe --env="TERM=$TERM" --env="HOME=$HOME" --env="PATH=$PATH" --pidfile=$DIR/$base-pid --errlog=$DIR/$base-err.log --output=$DIR/$base-out.log -- $binary --config $work_path/app.ini --work-path $work_path
|
||||
mkdir -p $COVERAGE_DIR
|
||||
daemon --chdir=$DIR --unsafe --env="TERM=$TERM" --env="HOME=$HOME" --env="PATH=$PATH" --env="GOCOVERDIR=$COVERAGE_DIR" --pidfile=$DIR/$base-pid --errlog=$DIR/$base-err.log --output=$DIR/$base-out.log -- $binary --config $work_path/app.ini --work-path $work_path
|
||||
if ! retry grep --no-messages --quiet 'Starting server on' $work_path/log/forgejo.log; then
|
||||
grep '' $DIR/$base*.log
|
||||
grep '' $work_path/log/*.log 2>/dev/null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue