-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into sdk-identifier
# Conflicts: # client_test.go
- Loading branch information
Showing
23 changed files
with
826 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,10 +20,10 @@ jobs: | |
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.20" | ||
go-version: "1.21" | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
uses: golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299 # [email protected] | ||
with: | ||
version: v1.51 | ||
only-new-issues: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ jobs: | |
with: | ||
go-version: ${{ matrix.go }} | ||
- uses: actions/checkout@v3 | ||
- uses: actions/cache@v2 | ||
- uses: actions/cache@v3 | ||
with: | ||
# In order: | ||
# * Module download cache | ||
|
@@ -48,23 +48,21 @@ jobs: | |
run: make mod-tidy | ||
if: ${{ matrix.go == '1.20' }} | ||
- name: Test | ||
run: make test | ||
run: make test-coverage | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # [email protected] | ||
with: | ||
directory: .coverage | ||
- name: Test (with race detection) | ||
run: make test-race | ||
# The race detector adds considerable runtime overhead. To save time on | ||
# pull requests, only run this step for a single job in the matrix. For | ||
# all other workflow triggers (e.g., pushes to a release branch) run | ||
# this step for the whole matrix. | ||
if: ${{ github.event_name != 'pull_request' || (matrix.go == '1.20' && matrix.os == 'ubuntu') }} | ||
- name: Collect coverage | ||
run: make test-coverage | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
directory: .coverage | ||
if: ${{ github.event_name != 'pull_request' || (matrix.go == '1.21' && matrix.os == 'ubuntu') }} | ||
timeout-minutes: 15 | ||
strategy: | ||
matrix: | ||
go: ["1.20", "1.19", "1.18"] | ||
go: ["1.21", "1.20", "1.19", "1.18"] | ||
os: [ubuntu, windows, macos] | ||
fail-fast: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ import ( | |
const testDsn = "http://[email protected]/1337" | ||
|
||
func setupHubTest() (*Hub, *Client, *Scope) { | ||
client, _ := NewClient(ClientOptions{Dsn: testDsn}) | ||
client, _ := NewClient(ClientOptions{Dsn: testDsn, Transport: &TransportMock{}}) | ||
scope := NewScope() | ||
hub := NewHub(client, scope) | ||
return hub, client, scope | ||
|
@@ -95,7 +95,7 @@ func TestPopScopeCannotLeaveStackEmpty(t *testing.T) { | |
func TestBindClient(t *testing.T) { | ||
hub, client, _ := setupHubTest() | ||
hub.PushScope() | ||
newClient, _ := NewClient(ClientOptions{Dsn: testDsn}) | ||
newClient, _ := NewClient(ClientOptions{Dsn: testDsn, Transport: &TransportMock{}}) | ||
hub.BindClient(newClient) | ||
|
||
if (*hub.stack)[0].client == (*hub.stack)[1].client { | ||
|
@@ -123,7 +123,7 @@ func TestWithScopeBindClient(t *testing.T) { | |
hub, client, _ := setupHubTest() | ||
|
||
hub.WithScope(func(scope *Scope) { | ||
newClient, _ := NewClient(ClientOptions{Dsn: testDsn}) | ||
newClient, _ := NewClient(ClientOptions{Dsn: testDsn, Transport: &TransportMock{}}) | ||
hub.BindClient(newClient) | ||
if hub.stackTop().client != newClient { | ||
t.Error("should use newly bound client") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package testutils | ||
|
||
import ( | ||
"os" | ||
"time" | ||
) | ||
|
||
func IsCI() bool { | ||
return os.Getenv("CI") != "" | ||
} | ||
|
||
func FlushTimeout() time.Duration { | ||
if IsCI() { | ||
// CI is very overloaded so we need to allow for a long wait time. | ||
return 5 * time.Second | ||
} | ||
|
||
return time.Second | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.