Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ginkgo 2 migration #735

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,23 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: 1.14
go-version: 1.17

- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}

- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.29
skip-go-installation: true
working-directory: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}

- name: Test
working-directory: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}
run: make precommit-new-unit-tets
run: make precommit-new-unit-tests

- name: Send coverage
uses: shogo82148/[email protected]
Expand Down Expand Up @@ -59,7 +65,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: 1.14
go-version: 1.17

- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand Down Expand Up @@ -99,7 +105,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: 1.14
go-version: 1.17

- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand Down Expand Up @@ -139,7 +145,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: 1.14
go-version: 1.17

- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand Down Expand Up @@ -179,7 +185,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: 1.14
go-version: 1.17

- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ precommit-integration-tests-service-instance-and-binding: build test-int-service
precommit-integration-tests-other: build test-int-other ## Run this before commiting (builds, recreates fakes, runs tests, checks linting and formating). This also runs integration tests - check test-int target for details
precommit-unit-tests: build test-unit format-check lint-check ## Run this before commiting (builds, recreates fakes, runs tests, checks linting and formating). This also runs integration tests - check test-int target for details
precommit-new-unit-tets: prepare build test-unit format-check lint-check
precommit-new-unit-tests: prepare build test-unit format-check
precommit-new-integration-tests-broker: prepare build test-int-broker
precommit-new-integration-tests-osb-and-plugin: prepare build test-int-osb-and-plugin
precommit-new-integration-tests-service-instance-and-binding: prepare build test-int-service-instance-and-binding
Expand Down
8 changes: 4 additions & 4 deletions api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/Peripli/service-manager/api"
"github.com/Peripli/service-manager/storage/storagefakes"
"github.com/Peripli/service-manager/test/common"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand All @@ -38,18 +38,18 @@ func TestAPI(t *testing.T) {
RunSpecs(t, "API Suite")
}

var _ = Describe("API", func() {
var _ = Describe("API", Ordered, func() {
var (
mockedStorage *storage.InterceptableTransactionalRepository
server *common.OAuthServer
fakeEnvironment *envfakes.FakeEnvironment
)

BeforeSuite(func() {
BeforeAll(func() {
server = common.NewOAuthServer()
})

AfterSuite(func() {
AfterAll(func() {
server.Close()
})

Expand Down
2 changes: 1 addition & 1 deletion api/filters/filters_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package filters_test
import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
2 changes: 1 addition & 1 deletion api/filters/force_delete_validation_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/Peripli/service-manager/pkg/util"
"github.com/Peripli/service-manager/pkg/web"
"github.com/Peripli/service-manager/pkg/web/webfakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"net/http"
"net/url"
Expand Down
6 changes: 2 additions & 4 deletions api/filters/labeling_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@ import (
"github.com/benjamintf1/unmarshalledmatchers"
"net/http"

. "github.com/onsi/ginkgo/extensions/table"

"github.com/Peripli/service-manager/pkg/query"

"github.com/Peripli/service-manager/pkg/web"

. "github.com/onsi/gomega"

"github.com/Peripli/service-manager/pkg/web/webfakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
)

var _ = Describe("LabelingFilters", func() {
Expand Down Expand Up @@ -286,7 +284,7 @@ var _ = Describe("LabelingFilters", func() {
_, err = labelingFilters[1].Run(fakeRequest, fakeHandler)
Expect(err).ToNot(HaveOccurred())
Expect(string(fakeRequest.Body)).To(unmarshalledmatchers.MatchOrderedJSON(t.expectedRequestBody))
}, entries...)
}, entries)
})
})
})
2 changes: 1 addition & 1 deletion api/filters/logging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/Peripli/service-manager/pkg/log"
"github.com/Peripli/service-manager/pkg/web"
"github.com/Peripli/service-manager/pkg/web/webfakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
2 changes: 1 addition & 1 deletion api/filters/protected_labels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/Peripli/service-manager/pkg/web"
"github.com/Peripli/service-manager/pkg/web/webfakes"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
2 changes: 1 addition & 1 deletion api/filters/service_binding_strip_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

"github.com/Peripli/service-manager/pkg/web"
"github.com/Peripli/service-manager/pkg/web/webfakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
2 changes: 1 addition & 1 deletion api/filters/service_instance_strip_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/tidwall/sjson"

"github.com/Peripli/service-manager/pkg/web/webfakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
11 changes: 4 additions & 7 deletions api/filters/tenant_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,16 @@ import (
"fmt"
"net/http"

"github.com/benjamintf1/unmarshalledmatchers"

. "github.com/onsi/ginkgo/extensions/table"

"github.com/Peripli/service-manager/pkg/query"
"github.com/benjamintf1/unmarshalledmatchers"

"github.com/Peripli/service-manager/pkg/web"

. "github.com/onsi/gomega"

"github.com/Peripli/service-manager/api/filters"
"github.com/Peripli/service-manager/pkg/web/webfakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
)

var _ = Describe("TenantFilters", func() {
Expand Down Expand Up @@ -207,7 +204,7 @@ var _ = Describe("TenantFilters", func() {
_, err = multitenancyFilters[1].Run(fakeRequest, fakeHandler)
Expect(err).ToNot(HaveOccurred())
Expect(string(fakeRequest.Body)).To(unmarshalledmatchers.MatchOrderedJSON(t.expectedRequestBody))
}, entries...)
}, entries)
})

Describe("Global access", func() {
Expand Down Expand Up @@ -259,7 +256,7 @@ var _ = Describe("TenantFilters", func() {
_, err = multitenancyFilters[1].Run(fakeRequest, fakeHandler)
Expect(err).ToNot(HaveOccurred())
Expect(string(fakeRequest.Body)).To(unmarshalledmatchers.MatchOrderedJSON(t.actualRequestBody))
}, entries...)
}, entries)
})
})
})
Expand Down
2 changes: 1 addition & 1 deletion api/healthcheck/healthcheck_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/Peripli/service-manager/pkg/health"
"github.com/Peripli/service-manager/pkg/web"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
2 changes: 1 addition & 1 deletion api/healthcheck/monitored_platform_indicator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/Peripli/service-manager/pkg/health"
"github.com/Peripli/service-manager/pkg/types"
storagefakes "github.com/Peripli/service-manager/storage/storagefakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"time"
)
Expand Down
2 changes: 1 addition & 1 deletion api/healthcheck/platform_indicator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/Peripli/service-manager/pkg/health"
"github.com/Peripli/service-manager/pkg/types"
storagefakes2 "github.com/Peripli/service-manager/storage/storagefakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"time"
)
Expand Down
2 changes: 1 addition & 1 deletion api/http_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"github.com/Peripli/service-manager/pkg/util"
"github.com/Peripli/service-manager/pkg/web"
"github.com/Peripli/service-manager/pkg/web/webfakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
2 changes: 1 addition & 1 deletion api/info/info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

"github.com/Peripli/service-manager/api/info"
"github.com/Peripli/service-manager/pkg/web"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
5 changes: 2 additions & 3 deletions api/osb/catalog_fetcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ import (

"github.com/Peripli/service-manager/pkg/types"
"github.com/Peripli/service-manager/test/common"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/extensions/table"
. "github.com/onsi/ginkgo/v2"
)

var _ = Describe("Catalog CatalogFetcher", func() {
Expand Down Expand Up @@ -240,5 +239,5 @@ var _ = Describe("Catalog CatalogFetcher", func() {
if t.expectedResponse != nil {
Expect(rawCatalog).To(Equal(t.expectedResponse))
}
}, entries...)
}, entries)
})
2 changes: 1 addition & 1 deletion api/osb/osb_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/Peripli/service-manager/pkg/types"
"github.com/Peripli/service-manager/test/tls_settings"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/sirupsen/logrus"
"log"
Expand Down
2 changes: 1 addition & 1 deletion api/osb/osb_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package osb

import "testing"
import . "github.com/onsi/ginkgo"
import . "github.com/onsi/ginkgo/v2"
import . "github.com/onsi/gomega"

func TestOSB(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"github.com/Peripli/service-manager/pkg/log"
"github.com/Peripli/service-manager/pkg/server"
"github.com/Peripli/service-manager/storage"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)

Expand Down
Loading