Skip to content

Commit

Permalink
Merge branch 'main' into mr2011/issue_190/remove_generated_code
Browse files Browse the repository at this point in the history
  • Loading branch information
MR2011 authored Oct 25, 2024
2 parents 3747ef2 + a1f5f54 commit dfb3554
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 1 deletion.
5 changes: 5 additions & 0 deletions internal/database/mariadb/issue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
package mariadb_test

import (
"time"

"github.com/cloudoperators/heureka/internal/database/mariadb"
"github.com/cloudoperators/heureka/internal/database/mariadb/test"
"github.com/cloudoperators/heureka/internal/entity"
Expand All @@ -21,6 +23,9 @@ var _ = Describe("Issue", Label("database", "Issue"), func() {
var db *mariadb.SqlDatabase
var seeder *test.DatabaseSeeder
BeforeEach(func() {
// This sleep suppresses a potential racing condition which triggers test failures.
time.Sleep(3 * time.Second)

var err error
db = dbm.NewTestSchema()
seeder, err = test.NewDatabaseSeeder(dbm.DbConfig())
Expand Down
5 changes: 5 additions & 0 deletions internal/e2e/activity_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"fmt"
"os"
"time"

"github.com/cloudoperators/heureka/internal/entity"
testentity "github.com/cloudoperators/heureka/internal/entity/test"
Expand All @@ -31,6 +32,9 @@ var _ = Describe("Getting Activities via API", Label("e2e", "Activity"), func()
var cfg util.Config

BeforeEach(func() {
// This sleep suppresses a potential racing condition which triggers test failures.
time.Sleep(3 * time.Second)

var err error
_ = dbm.NewTestSchema()
seeder, err = test.NewDatabaseSeeder(dbm.DbConfig())
Expand Down Expand Up @@ -133,6 +137,7 @@ var _ = Describe("Getting Activities via API", Label("e2e", "Activity"), func()
req.Var("after", "0")

req.Header.Set("Cache-Control", "no-cache")

ctx := context.Background()

err = client.Run(ctx, req, &respData)
Expand Down
5 changes: 5 additions & 0 deletions internal/e2e/component_instance_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"fmt"
"os"
"time"

"github.com/cloudoperators/heureka/internal/entity"
testentity "github.com/cloudoperators/heureka/internal/entity/test"
Expand All @@ -31,6 +32,9 @@ var _ = Describe("Getting ComponentInstances via API", Label("e2e", "ComponentIn
var cfg util.Config

BeforeEach(func() {
// This sleep suppresses a potential racing condition which triggers test failures.
time.Sleep(3 * time.Second)

var err error
_ = dbm.NewTestSchema()
seeder, err = test.NewDatabaseSeeder(dbm.DbConfig())
Expand Down Expand Up @@ -135,6 +139,7 @@ var _ = Describe("Getting ComponentInstances via API", Label("e2e", "ComponentIn
req.Var("after", "0")

req.Header.Set("Cache-Control", "no-cache")

ctx := context.Background()

err = client.Run(ctx, req, &respData)
Expand Down
5 changes: 5 additions & 0 deletions internal/e2e/component_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"fmt"
"os"
"time"

"github.com/cloudoperators/heureka/internal/entity"
testentity "github.com/cloudoperators/heureka/internal/entity/test"
Expand All @@ -32,6 +33,9 @@ var _ = Describe("Getting Components via API", Label("e2e", "Components"), func(
var cfg util.Config

BeforeEach(func() {
// This sleep suppresses a potential racing condition which triggers test failures.
time.Sleep(3 * time.Second)

var err error
_ = dbm.NewTestSchema()
seeder, err = test.NewDatabaseSeeder(dbm.DbConfig())
Expand Down Expand Up @@ -136,6 +140,7 @@ var _ = Describe("Getting Components via API", Label("e2e", "Components"), func(
req.Var("after", "0")

req.Header.Set("Cache-Control", "no-cache")

ctx := context.Background()

err = client.Run(ctx, req, &respData)
Expand Down
4 changes: 4 additions & 0 deletions internal/e2e/component_version_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"fmt"
"os"
"time"

"github.com/cloudoperators/heureka/internal/entity"
testentity "github.com/cloudoperators/heureka/internal/entity/test"
Expand All @@ -31,6 +32,9 @@ var _ = Describe("Getting ComponentVersions via API", Label("e2e", "ComponentVer
var cfg util.Config

BeforeEach(func() {
// This sleep suppresses a potential racing condition which triggers test failures.
time.Sleep(3 * time.Second)

var err error
_ = dbm.NewTestSchema()
seeder, err = test.NewDatabaseSeeder(dbm.DbConfig())
Expand Down
3 changes: 3 additions & 0 deletions internal/e2e/evidence_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ var _ = Describe("Getting Evidences via API", Label("e2e", "Evidences"), func()
var cfg util.Config

BeforeEach(func() {
// This sleep suppresses a potential racing condition which triggers test failures.
time.Sleep(3 * time.Second)

var err error
_ = dbm.NewTestSchema()
seeder, err = test.NewDatabaseSeeder(dbm.DbConfig())
Expand Down
5 changes: 5 additions & 0 deletions internal/e2e/issue_match_change_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"fmt"
"os"
"time"

"github.com/cloudoperators/heureka/internal/entity"
testentity "github.com/cloudoperators/heureka/internal/entity/test"
Expand All @@ -28,6 +29,9 @@ var _ = Describe("Getting IssueMatchChanges via API", Label("e2e", "IssueMatchCh
var s *server.Server
var cfg util.Config
BeforeEach(func() {
// This sleep suppresses a potential racing condition which triggers test failures.
time.Sleep(3 * time.Second)

var err error
_ = dbm.NewTestSchema()
seeder, err = test.NewDatabaseSeeder(dbm.DbConfig())
Expand Down Expand Up @@ -132,6 +136,7 @@ var _ = Describe("Getting IssueMatchChanges via API", Label("e2e", "IssueMatchCh
req.Var("after", "0")

req.Header.Set("Cache-Control", "no-cache")

ctx := context.Background()

err = client.Run(ctx, req, &respData)
Expand Down
4 changes: 4 additions & 0 deletions internal/e2e/issue_match_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ var _ = Describe("Getting IssueMatches via API", Label("e2e", "IssueMatches"), f
var s *server.Server
var cfg util.Config
BeforeEach(func() {
// This sleep suppresses a potential racing condition which triggers test failures.
time.Sleep(3 * time.Second)

var err error
_ = dbm.NewTestSchema()
seeder, err = test.NewDatabaseSeeder(dbm.DbConfig())
Expand Down Expand Up @@ -134,6 +137,7 @@ var _ = Describe("Getting IssueMatches via API", Label("e2e", "IssueMatches"), f
req.Var("after", "0")

req.Header.Set("Cache-Control", "no-cache")

ctx := context.Background()

err = client.Run(ctx, req, &respData)
Expand Down
6 changes: 5 additions & 1 deletion internal/e2e/service_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"fmt"
"os"
"time"

"github.com/cloudoperators/heureka/internal/entity"
testentity "github.com/cloudoperators/heureka/internal/entity/test"
Expand All @@ -31,6 +32,9 @@ var _ = Describe("Getting Services via API", Label("e2e", "Services"), func() {
var cfg util.Config

BeforeEach(func() {
// This sleep suppresses a potential racing condition which triggers test failures.
time.Sleep(3 * time.Second)

var err error
_ = dbm.NewTestSchema()
seeder, err = test.NewDatabaseSeeder(dbm.DbConfig())
Expand All @@ -39,7 +43,6 @@ var _ = Describe("Getting Services via API", Label("e2e", "Services"), func() {
cfg = dbm.DbConfig()
cfg.Port = util2.GetRandomFreePort()
s = server.NewServer(cfg)

s.NonBlockingStart()
})

Expand Down Expand Up @@ -174,6 +177,7 @@ var _ = Describe("Getting Services via API", Label("e2e", "Services"), func() {
req.Var("after", "0")

req.Header.Set("Cache-Control", "no-cache")

ctx := context.Background()

err = client.Run(ctx, req, &respData)
Expand Down

0 comments on commit dfb3554

Please sign in to comment.