Skip to content

Commit 4c33990

Browse files
committed
WIP
1 parent 904e388 commit 4c33990

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

cmd/routing-api/main_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,10 @@ var _ = Describe("Main", func() {
245245
gormDB, err = gorm.Open(getGormDialect(rapiConfig.SqlDB.Type, connectionString), &gorm.Config{})
246246
Expect(err).NotTo(HaveOccurred())
247247
})
248-
AfterEach(func() {
249-
gormDB.AutoMigrate(&models.RouterGroupDB{})
250-
Expect(os.Remove(configPath)).To(Succeed())
251-
})
248+
/* AfterEach(func() {
249+
gormDB.AutoMigrate(&models.RouterGroupDB{})
250+
Expect(os.Remove(configPath)).To(Succeed())
251+
})*/
252252
It("should fail with an error", func() {
253253
routingAPIRunner := testrunner.New(routingAPIBinPath, routingAPIArgs)
254254
proc := ifrit.Invoke(routingAPIRunner)

cmd/routing-api/routing_api_suite_test.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"crypto/tls"
55
"encoding/pem"
66
"fmt"
7+
"io"
78
"io/ioutil"
8-
"log"
99
"net/http"
1010
"net/url"
1111
"os"
@@ -67,11 +67,10 @@ var (
6767
mtlsAPIClientCert tls.Certificate
6868
)
6969

70-
func TestMain(m *testing.M) {
70+
func TestMainSuite(t *testing.T) {
7171
RegisterFailHandler(Fail)
72-
os.Exit(m.Run())
73-
//TODO Adapt the test execution
74-
RunSpecs(m, "Main Suite")
72+
suiteConfig, reporterConfig := GinkgoConfiguration()
73+
RunSpecs(t, "Main Suite", suiteConfig, reporterConfig)
7574
}
7675

7776
var _ = SynchronizedBeforeSuite(
@@ -85,8 +84,7 @@ var _ = SynchronizedBeforeSuite(
8584
return []byte(strings.Join([]string{routingAPIBin, locketPath}, ","))
8685
},
8786
func(binPaths []byte) {
88-
//TODO Adapt the logger
89-
grpclog.SetLogger(log.New(ioutil.Discard, "", 0))
87+
grpclog.SetLoggerV2(grpclog.NewLoggerV2(io.Discard, io.Discard, io.Discard))
9088

9189
path := string(binPaths)
9290
routingAPIBinPath = strings.Split(path, ",")[0]

migration/V2_update_rg_migration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func (v *V2UpdateRgMigration) Version() int {
2020
func (v *V2UpdateRgMigration) Run(sqlDB *db.SqlDB) error {
2121
type routerGroup struct {
2222
models.Model
23-
Name string `gorm:"index:idx_rg_name,unique" json:"name"`
23+
Name string `gorm:"size:255;index:idx_rg_name,unique" json:"name"`
2424
}
2525
return sqlDB.Client.AddUniqueIndex("idx_rg_name", &routerGroup{})
2626
}

0 commit comments

Comments
 (0)