]> source.dussan.org Git - gitea.git/commit
Reduce integration test overhead (#32475)
authorRowan Bohde <rowan.bohde@gmail.com>
Thu, 14 Nov 2024 19:28:46 +0000 (13:28 -0600)
committerGitHub <noreply@github.com>
Thu, 14 Nov 2024 19:28:46 +0000 (19:28 +0000)
commit68731c07c52d35b7b44db1c2f5f7a755efcc8c84
tree5357aca5db9027ec978f561c65a496810cb72517
parent249e67672aea8a5a0ed73bedc655f9dcd37437ea
Reduce integration test overhead (#32475)

In profiling integration tests, I found a couple places where per-test
overhead could be reduced:

* Avoiding disk IO by synchronizing instead of deleting & copying test
Git repository data. This saves ~100ms per test on my machine
* When flushing queues in `PrintCurrentTest`, invoke `FlushWithContext`
in a parallel.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
102 files changed:
models/fixtures/repository.yml
models/migrations/base/tests.go
models/unittest/fscopy.go
models/unittest/testdb.go
modules/git/tests/repos/language_stats_repo/description [deleted file]
modules/git/tests/repos/language_stats_repo/info/exclude [deleted file]
modules/git/tests/repos/repo1_bare/description [deleted file]
modules/git/tests/repos/repo1_bare/info/exclude [deleted file]
modules/git/tests/repos/repo1_bare_sha256/description [deleted file]
modules/git/tests/repos/repo1_bare_sha256/info/exclude [deleted file]
modules/git/tests/repos/repo2_empty/description [deleted file]
modules/git/tests/repos/repo2_empty/info/exclude [deleted file]
modules/git/tests/repos/repo3_notes/description [deleted file]
modules/git/tests/repos/repo5_pulls/description [deleted file]
modules/git/tests/repos/repo5_pulls/info/exclude [deleted file]
modules/git/tests/repos/repo5_pulls_sha256/description [deleted file]
modules/git/tests/repos/repo6_blame_sha256/description [deleted file]
modules/git/tests/repos/repo6_blame_sha256/info/exclude [deleted file]
modules/git/tests/repos/repo6_merge_sha256/description [deleted file]
modules/git/tests/repos/repo6_merge_sha256/info/exclude [deleted file]
modules/indexer/code/indexer_test.go
modules/queue/manager.go
modules/queue/workergroup.go
modules/queue/workerqueue.go
modules/repository/create_test.go
modules/testlogger/testlogger.go
services/gitdiff/testdata/academic-module/description [deleted file]
services/gitdiff/testdata/academic-module/info/exclude [deleted file]
services/repository/adopt_test.go
tests/gitea-repositories-meta/limited_org/private_repo_on_limited_org.git/description [deleted file]
tests/gitea-repositories-meta/limited_org/private_repo_on_limited_org.git/info/exclude [deleted file]
tests/gitea-repositories-meta/limited_org/public_repo_on_limited_org.git/description [deleted file]
tests/gitea-repositories-meta/limited_org/public_repo_on_limited_org.git/info/exclude [deleted file]
tests/gitea-repositories-meta/migration/lfs-test.git/description [deleted file]
tests/gitea-repositories-meta/org26/repo_external_tracker.git/description [deleted file]
tests/gitea-repositories-meta/org26/repo_external_tracker.git/info/exclude [deleted file]
tests/gitea-repositories-meta/org26/repo_external_tracker_alpha.git/description [deleted file]
tests/gitea-repositories-meta/org26/repo_external_tracker_alpha.git/info/exclude [deleted file]
tests/gitea-repositories-meta/org26/repo_external_tracker_numeric.git/description [deleted file]
tests/gitea-repositories-meta/org26/repo_external_tracker_numeric.git/info/exclude [deleted file]
tests/gitea-repositories-meta/org3/repo3.git/description [deleted file]
tests/gitea-repositories-meta/org3/repo3.git/info/exclude [deleted file]
tests/gitea-repositories-meta/org3/repo5.git/description [deleted file]
tests/gitea-repositories-meta/org3/repo5.git/info/exclude [deleted file]
tests/gitea-repositories-meta/org41/repo61.git/description [deleted file]
tests/gitea-repositories-meta/org41/repo61.git/info/exclude [deleted file]
tests/gitea-repositories-meta/org41/repo61.git/objects/.keep [new file with mode: 0644]
tests/gitea-repositories-meta/org41/repo61.git/refs/.keep [new file with mode: 0644]
tests/gitea-repositories-meta/org42/search-by-path.git/info/exclude [deleted file]
tests/gitea-repositories-meta/org42/search-by-path.git/refs/.keep [new file with mode: 0644]
tests/gitea-repositories-meta/privated_org/private_repo_on_private_org.git/description [deleted file]
tests/gitea-repositories-meta/privated_org/private_repo_on_private_org.git/info/exclude [deleted file]
tests/gitea-repositories-meta/privated_org/public_repo_on_private_org.git/description [deleted file]
tests/gitea-repositories-meta/privated_org/public_repo_on_private_org.git/info/exclude [deleted file]
tests/gitea-repositories-meta/user12/repo10.git/description [deleted file]
tests/gitea-repositories-meta/user12/repo10.git/info/exclude [deleted file]
tests/gitea-repositories-meta/user13/repo11.git/description [deleted file]
tests/gitea-repositories-meta/user13/repo11.git/info/exclude [deleted file]
tests/gitea-repositories-meta/user2/commits_search_test.git/description [deleted file]
tests/gitea-repositories-meta/user2/commits_search_test.git/info/exclude [deleted file]
tests/gitea-repositories-meta/user2/commitsonpr.git/description [deleted file]
tests/gitea-repositories-meta/user2/commitsonpr.git/info/exclude [deleted file]
tests/gitea-repositories-meta/user2/git_hooks_test.git/description [deleted file]
tests/gitea-repositories-meta/user2/git_hooks_test.git/info/exclude [deleted file]
tests/gitea-repositories-meta/user2/glob.git/description [deleted file]
tests/gitea-repositories-meta/user2/glob.git/info/exclude [deleted file]
tests/gitea-repositories-meta/user2/readme-test.git/info/exclude [deleted file]
tests/gitea-repositories-meta/user2/repo-release.git/description [deleted file]
tests/gitea-repositories-meta/user2/repo-release.git/info/exclude [deleted file]
tests/gitea-repositories-meta/user2/repo1.git/description [deleted file]
tests/gitea-repositories-meta/user2/repo1.git/info/exclude [deleted file]
tests/gitea-repositories-meta/user2/repo1.wiki.git/description [deleted file]
tests/gitea-repositories-meta/user2/repo1.wiki.git/info/exclude [deleted file]
tests/gitea-repositories-meta/user2/repo15.git/description [deleted file]
tests/gitea-repositories-meta/user2/repo15.git/info/exclude [deleted file]
tests/gitea-repositories-meta/user2/repo16.git/description [deleted file]
tests/gitea-repositories-meta/user2/repo16.git/info/exclude [deleted file]
tests/gitea-repositories-meta/user2/repo2.git/description [deleted file]
tests/gitea-repositories-meta/user2/repo2.git/info/exclude [deleted file]
tests/gitea-repositories-meta/user2/repo20.git/description [deleted file]
tests/gitea-repositories-meta/user2/repo20.git/info/exclude [deleted file]
tests/gitea-repositories-meta/user2/test_commit_revert.git/description [deleted file]
tests/gitea-repositories-meta/user2/test_commit_revert.git/info/exclude [deleted file]
tests/gitea-repositories-meta/user2/utf8.git/description [deleted file]
tests/gitea-repositories-meta/user2/utf8.git/info/exclude [deleted file]
tests/gitea-repositories-meta/user27/repo49.git/description [deleted file]
tests/gitea-repositories-meta/user27/repo49.git/info/exclude [deleted file]
tests/gitea-repositories-meta/user27/template1.git/description [deleted file]
tests/gitea-repositories-meta/user27/template1.git/info/exclude [deleted file]
tests/gitea-repositories-meta/user30/empty.git/objects/.keep [new file with mode: 0644]
tests/gitea-repositories-meta/user30/empty.git/refs/.keep [new file with mode: 0644]
tests/gitea-repositories-meta/user30/renderer.git/info/exclude [deleted file]
tests/gitea-repositories-meta/user30/renderer.git/refs/.keep [new file with mode: 0644]
tests/gitea-repositories-meta/user40/repo60.git/description [deleted file]
tests/gitea-repositories-meta/user40/repo60.git/info/exclude [deleted file]
tests/gitea-repositories-meta/user40/repo60.git/objects/.keep [new file with mode: 0644]
tests/gitea-repositories-meta/user40/repo60.git/refs/.keep [new file with mode: 0644]
tests/gitea-repositories-meta/user5/repo4.git/description [deleted file]
tests/gitea-repositories-meta/user5/repo4.git/info/exclude [deleted file]
tests/integration/integration_test.go
tests/integration/migration-test/migration_test.go
tests/test_utils.go