1
0
Fork 0
forked from forgejo/forgejo

Add git clone test on integration test (#1682)

This commit is contained in:
Lunny Xiao 2017-11-03 01:51:03 +08:00 committed by Kim "BKC" Carlbäcker
parent eecaba2031
commit f70758dec9
2 changed files with 65 additions and 2 deletions

View file

@ -16,6 +16,7 @@ import (
"net/url"
"os"
"path"
"path/filepath"
"strings"
"testing"
@ -51,7 +52,7 @@ func TestMain(m *testing.M) {
err := models.InitFixtures(
helper,
"models/fixtures/",
path.Join(filepath.Dir(setting.AppPath), "models/fixtures/"),
)
if err != nil {
fmt.Printf("Error initializing test database: %v\n", err)
@ -134,7 +135,9 @@ func initIntegrationTest() {
func prepareTestEnv(t testing.TB) {
assert.NoError(t, models.LoadFixtures())
assert.NoError(t, os.RemoveAll(setting.RepoRootPath))
assert.NoError(t, com.CopyDir("integrations/gitea-repositories-meta", setting.RepoRootPath))
assert.NoError(t, com.CopyDir(path.Join(filepath.Dir(setting.AppPath), "integrations/gitea-repositories-meta"),
setting.RepoRootPath))
}
type TestSession struct {