mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-07-18 23:47:50 +00:00
chore(coverage): split integration coverage targets in two (#13168)
For debugging running `make coverage-run-sqlite` does not need to always run migration tests. Split the target so integration coverage can be called independently from migration coverage. Add the `coverage-reset` target to dispose of previous coverage data that will interfere if the goal is to verify the coverage percentage, for instance. ### Documentation - [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change. - [x] I did not document these changes and I do not expect someone else to do it. ### Release notes - [ ] This change will be noticed by a Forgejo user or admin (feature, bug fix, performance, etc.). I suggest to include a release note for this change. - [x] This change is not visible to a Forgejo user or admin (refactor, dependency upgrade, etc.). I think there is no need to add a release note for this change. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/13168 Reviewed-by: Clouds <me@cloudsftp.de> Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
This commit is contained in:
parent
c90d5b0336
commit
95db6ef377
1 changed files with 11 additions and 8 deletions
19
Makefile
19
Makefile
|
|
@ -237,7 +237,8 @@ help:
|
|||
@echo " - test-frontend-coverage test frontend files and display code coverage"
|
||||
@echo " - test-backend test backend files"
|
||||
@echo " - test-remote-cacher test backend files that use a remote cache"
|
||||
@echo " - coverage-run* test and collect coverages in the coverage/data directory"
|
||||
@echo " - coverage-reset remove the coverage directory"
|
||||
@echo " - coverage-run-* test and collect coverages in the coverage/data directory"
|
||||
@echo " - coverage-show-html display coverage-run results in an HTML page"
|
||||
@echo " - coverage-show-percent display coverage-run per package coverage percentage"
|
||||
@echo " - test-e2e-sqlite[\#name.test.e2e] test end to end using playwright and sqlite"
|
||||
|
|
@ -602,6 +603,9 @@ test\#%: | compute-go-test-packages
|
|||
@echo "Running go test with $(GOTESTFLAGS) -tags '$(TEST_TAGS)'..."
|
||||
@TZ=UTC GITEA_ROOT="$(CURDIR)" $(GOTEST) $(GOTESTFLAGS) -tags='$(TEST_TAGS)' -run $(subst .,/,$*) $(GO_TEST_PACKAGES)
|
||||
|
||||
coverage-reset:
|
||||
rm -fr coverage
|
||||
|
||||
coverage-merge:
|
||||
rm -fr coverage/merged ; mkdir -p coverage/merged
|
||||
$(GO) tool covdata merge -i `find coverage/data -name 'covmeta.*' | sed -e 's|/covmeta.*|,|' | tr -d '\n' | sed -e 's/,$$//'` -o coverage/merged
|
||||
|
|
@ -619,17 +623,16 @@ coverage-show-percentage: coverage-convert
|
|||
coverage-run: | compute-go-test-packages
|
||||
contrib/coverage-helper.sh test_packages $(COVERAGE_TEST_PACKAGES)
|
||||
|
||||
coverage-run-%: generate-ini-% | compute-migration-packages
|
||||
#
|
||||
# Migration tests go first
|
||||
#
|
||||
coverage-run-%: coverage-run-migration-% coverage-run-integration-%
|
||||
echo $@ done
|
||||
|
||||
coverage-run-migration-%: generate-ini-% | compute-migration-packages
|
||||
$(MAKE) GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/$*.ini COVERAGE_TEST_ARGS= COVERAGE_TEST_PACKAGES=forgejo.org/tests/integration/migration-test coverage-run
|
||||
for pkg in $(MIGRATION_PACKAGES); do \
|
||||
$(MAKE) GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/$*.ini COVERAGE_TEST_DATABASE=$* COVERAGE_TEST_ARGS= COVERAGE_TEST_PACKAGES=$$pkg coverage-run ; \
|
||||
done
|
||||
#
|
||||
# All other integration tests follow
|
||||
#
|
||||
|
||||
coverage-run-integration-%: generate-ini-%
|
||||
$(MAKE) GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/$*.ini COVERAGE_TEST_DATABASE=$* COVERAGE_TEST_PACKAGES=forgejo.org/tests/integration coverage-run
|
||||
|
||||
.PHONY: tidy
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue