Skip to content

Commit

Permalink
Upgrade dependencies and images
Browse files Browse the repository at this point in the history
1. Update localstack to support more recent versions
2. Update localstack tests to work properly with updated version and
   latest aws package
3. Add supported redis version 7.2.4
4. Add supported memcached version 1.6.23
5. Add supported mariadb version 11.2.2
6. Add supported mongo version 5.0
7. Add supported postgres version up to 16
8. Bump supported azurite version to 3.30.0
9. Add supported cockroachdb versions
10. Bump supported elastic versions
11. Bump supported influxdb version
12. Bump supported kafka version
13. Add supported rabbitmq version
  • Loading branch information
orlangure committed May 19, 2024
1 parent cf7544d commit a4357be
Show file tree
Hide file tree
Showing 41 changed files with 548 additions and 537 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Get dependencies
run: go get -v -t -d ./...
- name: Get golangci-lint
run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.51.2
run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.57.2
- name: Lint
run: $(go env GOPATH)/bin/golangci-lint run --timeout 10m0s ./...

Expand Down Expand Up @@ -495,7 +495,7 @@ jobs:
run: |
cat preset-cover.txt server-cover.txt > coverage.txt
bash <(curl -s https://codecov.io/bash)
test-vault:
name: "[preset] vault"

Expand Down
4 changes: 0 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
linters:
enable:
- bodyclose
- cyclop
- dogsled
- errcheck
- exportloopref
- forcetypeassert
- funlen
- errorlint
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- godox
- gofmt
Expand Down Expand Up @@ -43,7 +40,6 @@ issues:
exclude-rules:
- path: _test\.go
linters:
- funlen
- bodyclose
- gosec
- noctx
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,24 +105,24 @@ The power of Gnomock is in the Presets. Existing Presets with their supported<su

| Preset | Go package | Go API | Supported versions | arm64 |
|--------|------------|--------|-------------------------------------------|-------|
[Localstack](https://github.com/localstack/localstack) (AWS) | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/localstack) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/localstack?tab=doc) | `0.12.2`, `0.13.1`, `0.14.0` | ✅
[Localstack](https://github.com/localstack/localstack) (AWS) | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/localstack) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/localstack?tab=doc) | `0.12.2`, `0.13.1`, `0.14.0`, `2.3.0`, `3.1.0` | ✅
Splunk | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/splunk) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/splunk?tab=doc) | `8.0.2` | ❌
Redis | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/redis) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/redis?tab=doc) | `5.0.10`, `6.0.9` | ✅
Memcached | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/memcached) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/memcached?tab=doc) | `1.6.9` | ✅
Redis | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/redis) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/redis?tab=doc) | `5.0.10`, `6.0.9`, `7.2.4` | ✅
Memcached | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/memcached) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/memcached?tab=doc) | `1.6.9`, `1.6.23` | ✅
MySQL | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/mysql) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/mysql?tab=doc) | `5.7.32`, `8.0.22` | ✅
MariaDB | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/mariadb) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/mariadb?tab=doc) | `10.5.8` | ✅
PostgreSQL | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/postgres) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/postgres?tab=doc) | `10.15`, `11.10`, `12.5`, `13.1` | ✅
MariaDB | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/mariadb) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/mariadb?tab=doc) | `10.5.8`, `11.2.2` | ✅
PostgreSQL | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/postgres) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/postgres?tab=doc) | `10.15`, `11.10`, `12.5`, `13.1`, `14.11`, `15.6`, `16.2` | ✅
Microsoft SQL Server | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/mssql) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/mssql?tab=doc) | `2017-latest`, `2019-latest` | ❌
MongoDB | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/mongo) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/mongo?tab=doc) | `3.6.21`, `4.4` | ✅
RabbitMQ | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/rabbitmq) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/rabbitmq?tab=doc) | `3.8.9-alpine`, `3.8.9-management-alpine` | ✅
Kafka | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/kafka) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/kafka?tab=doc) | `3.3.1-L0` | ✅
Elasticsearch | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/elastic) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/elastic?tab=doc) | `8.7.0`, `7.17.9` | ✅
MongoDB | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/mongo) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/mongo?tab=doc) | `3.6.21`, `4.4`, `5.0` | ✅
RabbitMQ | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/rabbitmq) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/rabbitmq?tab=doc) | `3.8.9-alpine`, `3.8.9-management-alpine`, `3.13-alpine` | ✅
Kafka | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/kafka) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/kafka?tab=doc) | `3.3.1-L0`, `3.6.1-L0` | ✅
Elasticsearch | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/elastic) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/elastic?tab=doc) | `8.13.0`, `7.17.21` | ✅
Kubernetes | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/k3s) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/k3s?tab=doc) | `v1.26.3-k3s1` | ✅
CockroachDB | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/cockroachdb) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/cockroachdb?tab=doc) | `v19.2.11`, `v20.1.10` | ✅
InfluxDB | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/influxdb) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/influxdb?tab=doc) | `2.0.4-alpine` | ✅
CockroachDB | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/cockroachdb) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/cockroachdb?tab=doc) | `v19.2.11`, `v20.1.10`, `v21.2.17`, `v22.2.19`, `v23.1.20` | ✅
InfluxDB | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/influxdb) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/influxdb?tab=doc) | `2.7.6-alpine` | ✅
Cassandra | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/cassandra) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/cassandra?tab=doc) | `4.0`, `3` | ✅
Vault | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/vault) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/vault?tab=doc) | `1.10.11`, `1.11.8`, `1.12.4`, `1.13` | ✅
Azurite | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/azurite) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/azurite?tab=doc) | `3.22.0` | ✅
Vault | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/vault) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/vault?tab=doc) | `1.10`, `1.11`, `1.12`, `1.13` | ✅
Azurite | [Go package](https://github.com/orlangure/gnomock/tree/master/preset/azurite) | [Reference](https://pkg.go.dev/github.com/orlangure/gnomock/preset/azurite?tab=doc) | `3.30.0` | ✅
<!-- new presets go here -->

It is possible to use Gnomock [directly from Go](https://pkg.go.dev/github.com/orlangure/gnomock#StartCustom) code without any presets. HTTP API only allows to setup containers using presets that exist in this repository.
Expand Down
7 changes: 4 additions & 3 deletions docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/filters"
dockerimage "github.com/docker/docker/api/types/image"
"github.com/docker/docker/api/types/mount"
"github.com/docker/docker/client"
"github.com/docker/docker/errdefs"
Expand Down Expand Up @@ -64,7 +65,7 @@ func (g *g) dockerConnect() (*docker, error) {
}

func (d *docker) isExistingLocalImage(ctx context.Context, image string) (bool, error) {
images, err := d.client.ImageList(ctx, types.ImageListOptions{All: true})
images, err := d.client.ImageList(ctx, dockerimage.ListOptions{All: true})
if err != nil {
return false, fmt.Errorf("can't list image: %w", err)
}
Expand All @@ -91,7 +92,7 @@ func (d *docker) isExistingLocalImage(ctx context.Context, image string) (bool,
func (d *docker) pullImage(ctx context.Context, image string, cfg *Options) error {
d.log.Info("pulling image")

reader, err := d.client.ImagePull(ctx, image, types.ImagePullOptions{
reader, err := d.client.ImagePull(ctx, image, dockerimage.PullOptions{
RegistryAuth: cfg.Auth,
})
if err != nil {
Expand Down Expand Up @@ -174,7 +175,7 @@ func (d *docker) setupContainerCleanup(id string, cfg *Options) chan string {
return health.HTTPGet(ctx, c.DefaultAddress())
}),
WithInit(func(ctx context.Context, c *Container) error {
return cleaner.Notify(context.Background(), c.DefaultAddress(), id)
return cleaner.Notify(ctx, c.DefaultAddress(), id)
}),
}
if cfg.UseLocalImagesFirst {
Expand Down
62 changes: 31 additions & 31 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,58 @@ module github.com/orlangure/gnomock
go 1.21

require (
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.1.0
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/aws/aws-sdk-go v1.44.332
github.com/bradfitz/gomemcache v0.0.0-20230611145640-acc696258285
github.com/aws/aws-sdk-go v1.50.4
github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874
github.com/denisenkom/go-mssqldb v0.12.3
github.com/docker/docker v26.1.0+incompatible
github.com/docker/go-connections v0.4.0
github.com/elastic/go-elasticsearch/v7 v7.17.10
github.com/elastic/go-elasticsearch/v8 v8.9.0
github.com/elastic/go-elasticsearch/v8 v8.12.0
github.com/go-redis/redis v6.15.9+incompatible
github.com/go-redis/redis/v7 v7.4.1
github.com/go-sql-driver/mysql v1.7.1
github.com/gocql/gocql v1.5.2
github.com/gocql/gocql v1.6.0
github.com/golang/snappy v0.0.4 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.1
github.com/gorilla/mux v1.8.0
github.com/hashicorp/vault/api v1.9.2
github.com/influxdata/influxdb-client-go/v2 v2.12.3
github.com/google/uuid v1.6.0
github.com/gorilla/mux v1.8.1
github.com/hashicorp/vault/api v1.11.0
github.com/influxdata/influxdb-client-go/v2 v2.13.0
github.com/lib/pq v1.10.9
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/segmentio/kafka-go v0.4.42
github.com/segmentio/kafka-go v0.4.47
github.com/stretchr/testify v1.9.0
go.mongodb.org/mongo-driver v1.12.1
go.mongodb.org/mongo-driver v1.13.1
go.uber.org/multierr v1.10.0 // indirect
go.uber.org/zap v1.25.0
golang.org/x/sync v0.3.0
k8s.io/api v0.28.1
k8s.io/apimachinery v0.28.1
k8s.io/client-go v0.28.1
go.uber.org/zap v1.26.0
golang.org/x/sync v0.6.0
k8s.io/api v0.29.1
k8s.io/apimachinery v0.29.1
k8s.io/client-go v0.29.1
)

require (
github.com/rabbitmq/amqp091-go v1.8.1
golang.org/x/mod v0.12.0
github.com/rabbitmq/amqp091-go v1.9.0
golang.org/x/mod v0.14.0
)

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/cenkalti/backoff/v3 v3.0.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deepmap/oapi-codegen v1.10.1 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/elastic/elastic-transport-go/v8 v8.2.0 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/elastic/elastic-transport-go/v8 v8.4.0 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-jose/go-jose/v3 v3.0.0 // indirect
github.com/go-jose/go-jose/v3 v3.0.1 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
Expand All @@ -65,7 +65,6 @@ require (
github.com/golang-sql/sqlexp v0.1.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
Expand All @@ -81,7 +80,7 @@ require (
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.15.9 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
Expand All @@ -90,6 +89,7 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/oapi-codegen/runtime v1.0.0 // indirect
github.com/onsi/ginkgo v1.16.4 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
Expand All @@ -109,7 +109,7 @@ require (
go.opentelemetry.io/otel/trace v1.25.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
Expand All @@ -120,10 +120,10 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.0.3 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

0 comments on commit a4357be

Please sign in to comment.