Feature/11 testing add tests for boot (#12)
* Utilize Versioning * Update Testing and CI/CD * Update Testing * Add Linting and Remove timeout * Update Lint * handle errors to make the linter happy
This commit was merged in pull request #12.
This commit is contained in:
@@ -23,7 +23,7 @@ var _ = Describe("Pgx", func() {
|
||||
ctx = context.Background()
|
||||
})
|
||||
|
||||
Describe("Connecting to the DB", func() {
|
||||
Describe("Connecting to the DB", Label("integration"), func() {
|
||||
Context("But connection is unsucessful", func() {
|
||||
It("throws error when can't connect to the database", func() {
|
||||
_, err := postgres.NewPostgresDB(postgres.Config{
|
||||
@@ -43,7 +43,7 @@ var _ = Describe("Pgx", func() {
|
||||
})
|
||||
})
|
||||
})
|
||||
Describe("Write to the DB", func() {
|
||||
Describe("Write to the DB", Label("integration"), func() {
|
||||
Context("Serialize big.Int to DB", func() {
|
||||
It("Should serialize successfully", func() {
|
||||
dbPool, err := postgres.NewPostgresDB(postgres.DefaultConfig)
|
||||
@@ -53,9 +53,13 @@ var _ = Describe("Pgx", func() {
|
||||
bi := new(big.Int)
|
||||
bi.SetString("34940183920000000000", 10)
|
||||
isEqual, err := testhelpers.IsEqual(bi.String(), "34940183920000000000")
|
||||
Expect(err).To(BeNil())
|
||||
Expect(isEqual).To(BeTrue())
|
||||
|
||||
defer dbPool.Exec(ctx, `DROP TABLE IF EXISTS example`)
|
||||
defer func() {
|
||||
_, err := dbPool.Exec(ctx, `DROP TABLE IF EXISTS example`)
|
||||
Expect(err).To(BeNil())
|
||||
}()
|
||||
_, err = dbPool.Exec(ctx, "CREATE TABLE example ( id INTEGER, data NUMERIC )")
|
||||
Expect(err).To(BeNil())
|
||||
|
||||
@@ -71,11 +75,13 @@ var _ = Describe("Pgx", func() {
|
||||
|
||||
isEqual, err = testhelpers.IsEqual(data, bi.String())
|
||||
Expect(isEqual).To(BeTrue())
|
||||
Expect(err).To(BeNil())
|
||||
actual := new(big.Int)
|
||||
actual.SetString(data, 10)
|
||||
|
||||
isEqual, err = testhelpers.IsEqual(actual, bi)
|
||||
Expect(isEqual).To(BeTrue())
|
||||
Expect(err).To(BeNil())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user