Skip to content

Commit

Permalink
[issue-368] knative integration with DataIndex and JobService: fix e2…
Browse files Browse the repository at this point in the history
…e test errors
  • Loading branch information
jianrongzhang89 committed Jul 29, 2024
1 parent 9b7861f commit fb3ab9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 6 additions & 3 deletions test/e2e/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,20 @@ func verifyPodsHaveKSinkInjected(selector, namespace string) bool {
func verifySchemaMigration(data, name string) bool {
matched1, err := regexp.MatchString(fmt.Sprintf("Successfully applied \\d migrations to schema \"%s\"", name), data)
if err != nil {
GinkgoWriter.Println("String match error:%v", err)
GinkgoWriter.Println(fmt.Errorf("string match error:%v", err))
return false
}
matched2, err := regexp.MatchString("Successfully validated \\d migrations", data)
if err != nil {
GinkgoWriter.Println("String match error:%v", err)
GinkgoWriter.Println(fmt.Errorf("string match error:%v", err))
return false
}
GinkgoWriter.Println("Checking, logs=%v", data)
GinkgoWriter.Println(fmt.Sprintf("verifying schemaMigration, logs=%v", data))
return (matched1 && strings.Contains(data, fmt.Sprintf("Creating schema \"%s\"", name)) &&
strings.Contains(data, fmt.Sprintf("Migrating schema \"%s\" to version", name))) ||
(matched2 && strings.Contains(data, fmt.Sprintf("Current version of schema \"%s\"", name)) &&
strings.Contains(data, fmt.Sprintf("Schema \"%s\" is up to date. No migration necessary", name))) ||
(strings.Contains(data, fmt.Sprintf("Creating schema \"%s\"", name)) &&
strings.Contains(data, fmt.Sprintf("Current version of schema \"%s\"", name)) &&
strings.Contains(data, fmt.Sprintf("Schema \"%s\" is up to date. No migration necessary", name)))
}
3 changes: 1 addition & 2 deletions test/e2e/workflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,7 @@ var _ = Describe("Validate the persistence ", Ordered, func() {
Expect(logs).Should(ContainSubstring("Flyway Community Edition"))
Expect(logs).Should(ContainSubstring("Database: jdbc:postgresql://postgres.%s:5432", ns))
result := verifySchemaMigration(logs, "callbackstatetimeouts")
GinkgoWriter.Println("logs:%v", logs)
GinkgoWriter.Println("verifySchemaMigration:%v", result)
GinkgoWriter.Println(fmt.Sprintf("verifySchemaMigration: %v", result))
Expect(result).Should(BeTrue())
Expect(logs).Should(ContainSubstring("Profile prod activated"))
} else {
Expand Down

0 comments on commit fb3ab9f

Please sign in to comment.