chore: improve preparing tests
- Only prepare repositories once. - Move the repositories to temporary directories (these should usually be stored in memory) which are recreated for each test to avoid persistentance between tests. Doing some dirty profiling suggests that the preparing test functions from 140-100ms to 70-40ms
This commit is contained in:
parent
9e95f80d94
commit
d1520cf08d
5 changed files with 79 additions and 47 deletions
|
@ -13,7 +13,6 @@ import (
|
|||
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
"code.gitea.io/gitea/tests"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
@ -33,8 +32,6 @@ func assertFileEqual(t *testing.T, p string, content []byte) {
|
|||
|
||||
func TestRepoCloneWiki(t *testing.T) {
|
||||
onGiteaRun(t, func(t *testing.T, u *url.URL) {
|
||||
defer tests.PrepareTestEnv(t)()
|
||||
|
||||
dstPath := t.TempDir()
|
||||
|
||||
r := fmt.Sprintf("%suser2/repo1.wiki.git", u.String())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue