Feature/22 test handling incoming events (#30)
* Checkpoint before the weekend * Update location for SetupPostgresDB * Include first functioning tests for processing head * Fix gitignore * Test CaptureHead | Add Metrics | Handle Test Race Conditions This Commit allows us to: * Test the `CaptureHead` function. * Test parsing a single Head message. * Test a Reorg condition. * Add Metrics. This is primarily used for testing but can have future use cases. * Rearrange the test due to race conditions introduced by reusing a variable. `BeforeEach` can't be used to update `BC`. * Update and finalize testing at this stage * Update code and CI/CD * Fix lint errors * Update CICD and fail when file not found. * Update test to have failed as expected.
This commit is contained in:
@@ -29,17 +29,18 @@ var _ = Describe("Pgx", func() {
|
||||
_, err := postgres.NewPostgresDB(postgres.Config{
|
||||
Driver: "PGX",
|
||||
})
|
||||
Expect(err).NotTo(BeNil())
|
||||
Expect(err).To(HaveOccurred())
|
||||
|
||||
present, err := doesContainsSubstring(err.Error(), sql.DbConnectionFailedMsg)
|
||||
Expect(present).To(BeTrue())
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
})
|
||||
})
|
||||
Context("The connection is successful", func() {
|
||||
It("Should create a DB object", func() {
|
||||
db, err := postgres.NewPostgresDB(postgres.DefaultConfig)
|
||||
defer db.Close()
|
||||
Expect(err).To(BeNil())
|
||||
defer db.Close()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user