File tree 2 files changed +12
-5
lines changed
2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,8 @@ test-vendor:
96
96
govendor status || exit 1
97
97
98
98
.PHONY : test-sqlite
99
- test-sqlite : integrations.test
99
+ test-sqlite :
100
+ go test -c code.gitea.io/gitea/integrations -tags ' sqlite'
100
101
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.test
101
102
102
103
.PHONY : test-mysql
@@ -108,7 +109,7 @@ test-pgsql: integrations.test
108
109
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.test
109
110
110
111
integrations.test : $(SOURCES )
111
- go test -c code.gitea.io/gitea/integrations -tags ' sqlite '
112
+ go test -c code.gitea.io/gitea/integrations
112
113
113
114
.PHONY : check
114
115
check : test
Original file line number Diff line number Diff line change @@ -79,6 +79,9 @@ func initIntegrationTest() {
79
79
if err != nil {
80
80
log .Fatalf ("sql.Open: %v" , err )
81
81
}
82
+ if _ , err = db .Exec ("DROP DATABASE IF EXISTS testgitea" ); err != nil {
83
+ log .Fatalf ("db.drop db: %v" , err )
84
+ }
82
85
if _ , err = db .Exec ("CREATE DATABASE IF NOT EXISTS testgitea" ); err != nil {
83
86
log .Fatalf ("db.Exec: %v" , err )
84
87
}
@@ -96,11 +99,14 @@ func initIntegrationTest() {
96
99
}
97
100
defer rows .Close ()
98
101
99
- if ! rows .Next () {
100
- if _ , err = db .Exec ("CREATE DATABASE testgitea" ); err != nil {
101
- log .Fatalf ("db.Exec : %v" , err )
102
+ if rows .Next () {
103
+ if _ , err = db .Exec ("DROP DATABASE testgitea" ); err != nil {
104
+ log .Fatalf ("db.drop db : %v" , err )
102
105
}
103
106
}
107
+ if _ , err = db .Exec ("CREATE DATABASE testgitea" ); err != nil {
108
+ log .Fatalf ("db.Exec: %v" , err )
109
+ }
104
110
}
105
111
routers .GlobalInit ()
106
112
}
You can’t perform that action at this time.
0 commit comments