Skip to content

Commit

Permalink
Update dependencies, and test dbs (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 committed Dec 6, 2021
1 parent 6dd93fd commit 59c4948
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 54 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.16
- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
id: go

- name: Check out code into the Go module directory
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.16
- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
id: go

- name: Check out code into the Go module directory
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
CGO_ENABLED := $(or ${CGO_ENABLED},0)
GO := go
GO111MODULE := on
PG_VERSION := $(or ${PG_VERSION},13-alpine)
COCKROACH_VERSION := $(or ${COCKROACH_VERSION},v21.1.5)
PG_VERSION := $(or ${PG_VERSION},14-alpine)
COCKROACH_VERSION := $(or ${COCKROACH_VERSION},v21.2.2)

.EXPORT_ALL_VARIABLES:

Expand Down
9 changes: 4 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ go 1.16

require (
github.com/avast/retry-go/v3 v3.1.1
github.com/go-redis/redis/v8 v8.11.1
github.com/go-redis/redis/v8 v8.11.4
github.com/jmoiron/sqlx v1.3.4
github.com/lib/pq v1.10.2
github.com/lib/pq v1.10.4
github.com/stretchr/testify v1.7.0
github.com/testcontainers/testcontainers-go v0.11.1
golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985 // indirect
github.com/testcontainers/testcontainers-go v0.12.0
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
inet.af/netaddr v0.0.0-20210721214506-ce7a8ad02cc1
inet.af/netaddr v0.0.0-20211027220019-c74959edd3b6
)
96 changes: 63 additions & 33 deletions go.sum

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions integration_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ipam

import (
"io/ioutil"
"os"
"strings"
"testing"

Expand All @@ -13,7 +13,7 @@ func TestIntegration(t *testing.T) {
_, storage, err := startPostgres()
require.NoError(t, err)
defer storage.db.Close()
dump, err := ioutil.ReadFile("testdata/ipamt.dump.sql")
dump, err := os.ReadFile("testdata/ipamt.dump.sql")
require.NoError(t, err)
require.NotNil(t, dump)
storage.db.MustExec(string(dump))
Expand Down Expand Up @@ -140,7 +140,7 @@ func TestIntegrationP(t *testing.T) {
_, storage, err := startPostgres()
require.NoError(t, err)
defer storage.db.Close()
dump, err := ioutil.ReadFile("testdata/ipamp.dump.sql")
dump, err := os.ReadFile("testdata/ipamp.dump.sql")
require.NoError(t, err)
require.NotNil(t, dump)
storage.db.MustExec(string(dump))
Expand Down
13 changes: 6 additions & 7 deletions testing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ package ipam
import (
"context"
"fmt"
"io/ioutil"
"log"
"io"
"os"
"sync"
"testing"
Expand Down Expand Up @@ -33,19 +32,19 @@ func TestMain(m *testing.M) {
// call flag.Parse() here if TestMain uses flags
pgVersion = os.Getenv("PG_VERSION")
if pgVersion == "" {
pgVersion = "13"
pgVersion = "14"
}
cockroachVersion = os.Getenv("COCKROACH_VERSION")
if cockroachVersion == "" {
cockroachVersion = "v21.1.5"
cockroachVersion = "v21.2.2"
}
redisVersion = os.Getenv("REDIS_VERSION")
if redisVersion == "" {
redisVersion = "6-alpine"
redisVersion = "6.2-alpine"
}
keyDBVersion = os.Getenv("KEYDB_VERSION")
if keyDBVersion == "" {
keyDBVersion = "alpine_x86_64_v6.0.18"
keyDBVersion = "alpine_x86_64_v6.2.1"
}
backend = os.Getenv("BACKEND")
if backend == "" {
Expand All @@ -54,7 +53,7 @@ func TestMain(m *testing.M) {
fmt.Printf("only test %s\n", backend)
}
// prevent testcontainer logging mangle test and benchmark output
log.SetOutput(ioutil.Discard)
testcontainers.Logger.SetOutput(io.Discard)
os.Exit(m.Run())
}

Expand Down

0 comments on commit 59c4948

Please sign in to comment.