summaryrefslogtreecommitdiffstats
path: root/integrations/integration_test.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2022-07-14 08:22:09 +0100
committerGitHub <noreply@github.com>2022-07-14 08:22:09 +0100
commitbffa30302070b594a1c40cdc56264b9731036fb3 (patch)
tree92104ff6b8a51f5d1506742427dd1399fa42428c /integrations/integration_test.go
parent175705356cac06c22d13d86b31605a6ad6dd9642 (diff)
downloadgitea-bffa30302070b594a1c40cdc56264b9731036fb3.tar.gz
gitea-bffa30302070b594a1c40cdc56264b9731036fb3.zip
Add option to purge users (#18064)
Add the ability to purge users when deleting them. Close #15588 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'integrations/integration_test.go')
-rw-r--r--integrations/integration_test.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/integrations/integration_test.go b/integrations/integration_test.go
index 8a43de7c45..230f780175 100644
--- a/integrations/integration_test.go
+++ b/integrations/integration_test.go
@@ -188,8 +188,13 @@ func initIntegrationTest() {
switch {
case setting.Database.UseMySQL:
- db, err := sql.Open("mysql", fmt.Sprintf("%s:%s@tcp(%s)/",
- setting.Database.User, setting.Database.Passwd, setting.Database.Host))
+ connType := "tcp"
+ if len(setting.Database.Host) > 0 && setting.Database.Host[0] == '/' { // looks like a unix socket
+ connType = "unix"
+ }
+
+ db, err := sql.Open("mysql", fmt.Sprintf("%s:%s@%s(%s)/",
+ setting.Database.User, setting.Database.Passwd, connType, setting.Database.Host))
defer db.Close()
if err != nil {
log.Fatal("sql.Open: %v", err)