Skip to content

Commit

Permalink
unset PACT_BROKER_USERNAME/PASSWORD if TOKEN is set
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed May 7, 2024
1 parent 67293ae commit 3d5a41e
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:
APP_REF: ${{ github.ref }}
LD_LIBRARY_PATH: /tmp
PACT_GO_LIB_DOWNLOAD_PATH: /tmp
LOG_LEVEL: debug
LOG_LEVEL: info
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
Expand Down
6 changes: 3 additions & 3 deletions examples/consumer_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var ArrayMinLike = matchers.ArrayMinLike
type Map = matchers.MapMatcher

func TestConsumerV2(t *testing.T) {
log.SetLogLevel("TRACE")
log.SetLogLevel("INFO")

mockProvider, err := consumer.NewV2Pact(consumer.MockHTTPProviderConfig{
Consumer: "PactGoV2Consumer",
Expand Down Expand Up @@ -79,7 +79,7 @@ func TestConsumerV2(t *testing.T) {
}

func TestConsumerV2_Match(t *testing.T) {
log.SetLogLevel("TRACE")
log.SetLogLevel("INFO")

mockProvider, err := consumer.NewV2Pact(consumer.MockHTTPProviderConfig{
Consumer: "PactGoV2ConsumerMatch",
Expand Down Expand Up @@ -111,7 +111,7 @@ func TestConsumerV2_Match(t *testing.T) {
}

func TestConsumerV2AllInOne(t *testing.T) {
log.SetLogLevel("TRACE")
log.SetLogLevel("INFO")

mockProvider, err := consumer.NewV2Pact(consumer.MockHTTPProviderConfig{
Consumer: "PactGoV2ConsumerAllInOne",
Expand Down
4 changes: 2 additions & 2 deletions examples/consumer_v3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var TimeGenerated = matchers.TimeGenerated
var DateTimeGenerated = matchers.DateTimeGenerated

func TestConsumerV3(t *testing.T) {
log.SetLogLevel("TRACE")
log.SetLogLevel("INFO")

mockProvider, err := consumer.NewV3Pact(consumer.MockHTTPProviderConfig{
Consumer: "PactGoV3Consumer",
Expand Down Expand Up @@ -90,7 +90,7 @@ func TestConsumerV3(t *testing.T) {
assert.NoError(t, err)
}
func TestMessagePact(t *testing.T) {
log.SetLogLevel("TRACE")
log.SetLogLevel("INFO")

provider, err := message.NewMessagePact(message.Config{
Consumer: "PactGoV3MessageConsumer",
Expand Down
2 changes: 1 addition & 1 deletion examples/consumer_v4_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

func TestConsumerV4(t *testing.T) {
log.SetLogLevel("TRACE")
log.SetLogLevel("INFO")

mockProvider, err := consumer.NewV4Pact(consumer.MockHTTPProviderConfig{
Consumer: "PactGoV4Consumer",
Expand Down
2 changes: 1 addition & 1 deletion examples/grpc/grpc_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

func TestGrpcProvider(t *testing.T) {
go startProvider()
l.SetLogLevel("TRACE")
l.SetLogLevel("INFO")

verifier := provider.NewVerifier()

Expand Down
2 changes: 1 addition & 1 deletion examples/protobuf-message/protobuf_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestPluginMessageProvider(t *testing.T) {
var dir, _ = os.Getwd()
var pactDir = fmt.Sprintf("%s/../pacts", dir)

err := pactlog.SetLogLevel("TRACE")
err := pactlog.SetLogLevel("INFO")
assert.NoError(t, err)

pactversion.CheckVersion()
Expand Down
4 changes: 2 additions & 2 deletions examples/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var requestFilterCalled = false
var stateHandlerCalled = false

func TestV3HTTPProvider(t *testing.T) {
log.SetLogLevel("TRACE")
log.SetLogLevel("INFO")
version.CheckVersion()

// Start provider API in the background
Expand Down Expand Up @@ -101,7 +101,7 @@ func TestV3HTTPProvider(t *testing.T) {
}

func TestV3MessageProvider(t *testing.T) {
log.SetLogLevel("TRACE")
log.SetLogLevel("INFO")
var user *User

verifier := provider.NewVerifier()
Expand Down
4 changes: 2 additions & 2 deletions internal/native/message_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ func TestGetPluginAsyncMessageContentsAsBytes(t *testing.T) {
func TestGrpcPluginInteraction(t *testing.T) {
tmpPactFolder, err := os.MkdirTemp("", "pact-go")
assert.NoError(t, err)
_ = log.SetLogLevel("TRACE")
_ = log.SetLogLevel("INFO")

m := NewMessageServer("test-message-consumer", "test-message-provider")

Expand Down Expand Up @@ -426,7 +426,7 @@ func TestGrpcPluginInteraction(t *testing.T) {
func TestGrpcPluginInteraction_ErrorResponse(t *testing.T) {
tmpPactFolder, err := os.MkdirTemp("", "pact-go")
assert.NoError(t, err)
_ = log.SetLogLevel("TRACE")
_ = log.SetLogLevel("INFO")

m := NewMessageServer("test-message-consumer", "test-message-provider")

Expand Down
2 changes: 1 addition & 1 deletion internal/native/mock_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func TestHandleBasedHTTPTests(t *testing.T) {
func TestPluginInteraction(t *testing.T) {
tmpPactFolder, err := os.MkdirTemp("", "pact-go")
assert.NoError(t, err)
_ = log.SetLogLevel("trace")
_ = log.SetLogLevel("INFO")

m := NewHTTPPact("test-plugin-consumer", "test-plugin-provider")

Expand Down
2 changes: 1 addition & 1 deletion internal/native/verifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestVerifier_Verify(t *testing.T) {
"--state-change-url",
"http://localhost:55827/__setup/",
"--loglevel",
"trace",
"info",
}

res := v.Verify(args)
Expand Down
7 changes: 5 additions & 2 deletions make/config.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
export PATH := $(PWD)/pact/bin:$(PATH)
export PATH
export PACT_BROKER_BASE_URL?=http://127.0.0.1
export PACT_BROKER_USERNAME?=pact_workshop
export PACT_BROKER_PASSWORD?=pact_workshop

ifndef PACT_BROKER_TOKEN
export PACT_BROKER_USERNAME?=pact_workshop
export PACT_BROKER_PASSWORD?=pact_workshop
endif
2 changes: 1 addition & 1 deletion message/v4/asynchronous_message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TestAsyncTypeSystem(t *testing.T) {
Provider: "asyncprovider",
PactDir: "/tmp/",
})
_ = log.SetLogLevel("TRACE")
_ = log.SetLogLevel("INFO")

type foo struct {
Foo string `json:"foo"`
Expand Down
2 changes: 1 addition & 1 deletion message/v4/synchronous_message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestSyncTypeSystem(t *testing.T) {
Provider: "provider",
PactDir: "/tmp/",
})
_ = log.SetLogLevel("TRACE")
_ = log.SetLogLevel("INFO")

dir, _ := os.Getwd()
path := fmt.Sprintf("%s/../../internal/native/pact_plugin.proto", dir)
Expand Down

0 comments on commit 3d5a41e

Please sign in to comment.