Skip to content

Commit

Permalink
Regenerate mock file using uber-go mock (#5437)
Browse files Browse the repository at this point in the history
* Regenerate mock file using uber-go mock

Signed-off-by: khanhtc1202 <[email protected]>

* Using uber-go mock instead of golang mock in tests

Signed-off-by: khanhtc1202 <[email protected]>

* Remove unneeded note

Signed-off-by: khanhtc1202 <[email protected]>

* Add note

Signed-off-by: khanhtc1202 <[email protected]>

* Update image tag

Signed-off-by: khanhtc1202 <[email protected]>

* Update to use same image checksum with gen.yaml

Signed-off-by: khanhtc1202 <[email protected]>

* Trigger

Signed-off-by: khanhtc1202 <[email protected]>

---------

Signed-off-by: khanhtc1202 <[email protected]>
  • Loading branch information
khanhtc1202 authored Dec 23, 2024
1 parent b98a963 commit bcdba1f
Show file tree
Hide file tree
Showing 25 changed files with 440 additions and 379 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
- name: Generate code
uses: docker://ghcr.io/pipe-cd/codegen@sha256:3fd8e22eeab21bab2a2f6c1d2770b069922f4973465d57386d672574931943e8 #v0.47.3-rc0-2-g462b842
# NOTE: Keep this container image as same as defined in Makefile
uses: docker://ghcr.io/pipe-cd/codegen@sha256:fcb600d82cc4acc76f532c292445f868dfa176d6db116b6c5b18b81a1b1c5fa9 #v0.50.0-51-gb98a963
with:
entrypoint: ./tool/codegen/codegen.sh
args: /github/workspace
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ update/copyright:

.PHONY: gen/code
gen/code:
# NOTE: Specify a specific version temporally until the next release.
docker run --rm -v ${PWD}:/repo -it --entrypoint ./tool/codegen/codegen.sh ghcr.io/pipe-cd/codegen@sha256:3fd8e22eeab21bab2a2f6c1d2770b069922f4973465d57386d672574931943e8 /repo #v0.47.3-rc0-2-g462b842
# NOTE: Keep this container image as same as defined in .github/workflows/codegen.yml
docker run --rm -v ${PWD}:/repo -it --entrypoint ./tool/codegen/codegen.sh ghcr.io/pipe-cd/codegen@sha256:fcb600d82cc4acc76f532c292445f868dfa176d6db116b6c5b18b81a1b1c5fa9 /repo # v0.50.0-51-gb98a963

.PHONY: gen/test-tls
gen/test-tls:
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ require (
go.opentelemetry.io/otel/sdk v1.28.0
go.opentelemetry.io/otel/trace v1.28.0
go.uber.org/atomic v1.11.0
go.uber.org/mock v0.5.0
go.uber.org/zap v1.19.1
golang.org/x/crypto v0.25.0
golang.org/x/mod v0.22.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,8 @@ go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A
go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU=
go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/piped/controller/skipstage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"context"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"

"github.com/pipe-cd/pipecd/pkg/config"
"github.com/pipe-cd/pipecd/pkg/git"
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/piped/executor/kubernetes/canary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"fmt"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"
"go.uber.org/zap"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"

Expand Down
2 changes: 1 addition & 1 deletion pkg/app/piped/executor/kubernetes/kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"fmt"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

"github.com/pipe-cd/pipecd/pkg/app/piped/metadatastore"
provider "github.com/pipe-cd/pipecd/pkg/app/piped/platformprovider/kubernetes"
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/piped/executor/kubernetes/primary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"fmt"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"
"go.uber.org/zap"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"

Expand Down
2 changes: 1 addition & 1 deletion pkg/app/piped/executor/kubernetes/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"path"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
"go.uber.org/zap"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/app/server/analysisresultstore/filestore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (
"context"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

"github.com/pipe-cd/pipecd/pkg/filestore"
"github.com/pipe-cd/pipecd/pkg/filestore/filestoretest"
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/server/applicationlivestatestore/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package applicationlivestatestore
import (
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"

"github.com/pipe-cd/pipecd/pkg/cache"
"github.com/pipe-cd/pipecd/pkg/cache/cachetest"
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/server/applicationlivestatestore/filestore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"context"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"

"github.com/pipe-cd/pipecd/pkg/filestore"
"github.com/pipe-cd/pipecd/pkg/filestore/filestoretest"
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/server/grpcapi/piped_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"errors"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"

"github.com/pipe-cd/pipecd/pkg/cache"
"github.com/pipe-cd/pipecd/pkg/cache/cachetest"
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/server/grpcapi/web_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"errors"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"

"github.com/pipe-cd/pipecd/pkg/cache"
"github.com/pipe-cd/pipecd/pkg/cache/cachetest"
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/server/stagelogstore/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package stagelogstore
import (
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"

"github.com/pipe-cd/pipecd/pkg/cache"
"github.com/pipe-cd/pipecd/pkg/cache/cachetest"
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/server/stagelogstore/filestore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"strings"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"

"github.com/pipe-cd/pipecd/pkg/filestore"
"github.com/pipe-cd/pipecd/pkg/filestore/filestoretest"
Expand Down
Loading

0 comments on commit bcdba1f

Please sign in to comment.