mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-26 12:27:06 +00:00 
			
		
		
		
	Improve integration tests (#8276)
* improve integration tests * fix Makefile * improve makefile and integration docs
This commit is contained in:
		 Lunny Xiao
					Lunny Xiao
				
			
				
					committed by
					
						 Antoine GIRARD
						Antoine GIRARD
					
				
			
			
				
	
			
			
			 Antoine GIRARD
						Antoine GIRARD
					
				
			
						parent
						
							c05b89a5aa
						
					
				
				
					commit
					a8c024043c
				
			| @@ -131,7 +131,7 @@ func initIntegrationTest() { | ||||
| 		if err != nil { | ||||
| 			log.Fatalf("sql.Open: %v", err) | ||||
| 		} | ||||
| 		if _, err = db.Exec("CREATE DATABASE IF NOT EXISTS testgitea"); err != nil { | ||||
| 		if _, err = db.Exec(fmt.Sprintf("CREATE DATABASE IF NOT EXISTS %s", setting.Database.Name)); err != nil { | ||||
| 			log.Fatalf("db.Exec: %v", err) | ||||
| 		} | ||||
| 	case setting.Database.UsePostgreSQL: | ||||
| @@ -150,7 +150,7 @@ func initIntegrationTest() { | ||||
| 		if rows.Next() { | ||||
| 			break | ||||
| 		} | ||||
| 		if _, err = db.Exec("CREATE DATABASE testgitea"); err != nil { | ||||
| 		if _, err = db.Exec(fmt.Sprintf("CREATE DATABASE %s", setting.Database.Name)); err != nil { | ||||
| 			log.Fatalf("db.Exec: %v", err) | ||||
| 		} | ||||
| 	case setting.Database.UseMSSQL: | ||||
| @@ -160,7 +160,7 @@ func initIntegrationTest() { | ||||
| 		if err != nil { | ||||
| 			log.Fatalf("sql.Open: %v", err) | ||||
| 		} | ||||
| 		if _, err := db.Exec("If(db_id(N'gitea') IS NULL) BEGIN CREATE DATABASE gitea; END;"); err != nil { | ||||
| 		if _, err := db.Exec(fmt.Sprintf("If(db_id(N'%s') IS NULL) BEGIN CREATE DATABASE %s; END;", setting.Database.Name, setting.Database.Name)); err != nil { | ||||
| 			log.Fatalf("db.Exec: %v", err) | ||||
| 		} | ||||
| 		defer db.Close() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user