Skip to content

Commit

Permalink
Fix e2e tests and add 'time.Minute' timeout to waitFor condition
Browse files Browse the repository at this point in the history
Signed-off-by: Jordi Gil <[email protected]>
  • Loading branch information
jordigilh committed Feb 28, 2024
1 parent 214e0b2 commit 9865cca
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 11 deletions.
5 changes: 3 additions & 2 deletions test/e2e/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ type health struct {
}

type check struct {
Name string `json:"name"`
Status string `json:"status"`
Name string `json:"name"`
Status string `json:"status"`
Data map[string]string `json:"data"`
}

var (
Expand Down
21 changes: 12 additions & 9 deletions test/e2e/workflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ var _ = Describe("SonataFlow Operator", Ordered, func() {

var _ = Describe("Validate the persistence ", Ordered, func() {

const (
dbConnectionName = "Database connections health check"
defaultDataCheck = "<default>"
)
var (
ns string
)
Expand Down Expand Up @@ -198,21 +202,20 @@ var _ = Describe("Validate the persistence ", Ordered, func() {
}
Expect(h.Status).To(Equal(upStatus), "Pod health is not UP")
for _, c := range h.Checks {
if withPersistence {
if c.Name == "Database connections health check" {
Expect(c.Status).To(Equal(upStatus), "Pod's database connection is not UP")
if c.Name == dbConnectionName {
Expect(c.Status).To(Equal(upStatus), "Pod's database connection is not UP")
if withPersistence {
Expect(c.Data[defaultDataCheck]).To(Equal(upStatus), "Pod's 'default' database data is not UP")
return true
} else {
Expect(defaultDataCheck).NotTo(BeElementOf(c.Data), "Pod's 'default' database data check exists in health manifest")
return true
}
} else {
Expect(c.Name).NotTo(Equal("Database connections health check"), "persistence configuration found in workflow")
}
}
if !withPersistence {
return true
}
}
return false
}, 1).Should(BeTrue())
}, 1*time.Minute).Should(BeTrue())
},
Entry("defined in the workflow from an existing kubernetes service as a reference", test.GetSonataFlowE2EWorkflowPersistenceSampleDataDirectory("by_service"), true),
Entry("defined in the workflow and from the sonataflow platform", test.GetSonataFlowE2EWorkflowPersistenceSampleDataDirectory("from_platform_overwritten_by_service"), true),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ spec:
port: 3456
databaseName: db_name
build:
template:
buildArgs:
- name: QUARKUS_EXTENSIONS
value: org.kie.kogito:kogito-addons-quarkus-persistence-jdbc:999-SNAPSHOT,io.quarkus:quarkus-jdbc-postgresql:3.2.9.Final,io.quarkus:quarkus-agroal:3.2.9.Final
config:
strategyOptions:
KanikoBuildCacheEnabled: "true"
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ spec:
port: 5432
databaseName: sonataflow
build:
template:
buildArgs:
- name: QUARKUS_EXTENSIONS
value: org.kie.kogito:kogito-addons-quarkus-persistence-jdbc:999-SNAPSHOT,io.quarkus:quarkus-jdbc-postgresql:3.2.9.Final,io.quarkus:quarkus-agroal:3.2.9.Final
config:
strategyOptions:
KanikoBuildCacheEnabled: "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ spec:
port: 5432
databaseName: sonataflow
build:
template:
buildArgs:
- name: QUARKUS_EXTENSIONS
value: org.kie.kogito:kogito-addons-quarkus-persistence-jdbc:999-SNAPSHOT,io.quarkus:quarkus-jdbc-postgresql:3.2.9.Final,io.quarkus:quarkus-agroal:3.2.9.Final
config:
strategyOptions:
KanikoBuildCacheEnabled: "true"
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ spec:
port: 5432
databaseName: sonataflow
build:
template:
buildArgs:
- name: QUARKUS_EXTENSIONS
value: org.kie.kogito:kogito-addons-quarkus-persistence-jdbc:999-SNAPSHOT,io.quarkus:quarkus-jdbc-postgresql:3.2.9.Final,io.quarkus:quarkus-agroal:3.2.9.Final
config:
strategyOptions:
KanikoBuildCacheEnabled: "true"

0 comments on commit 9865cca

Please sign in to comment.