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

[armcore] Add auxiliary tenants to connection options #15124

Merged
merged 5 commits into from
Jul 28, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
lint updates
catalinaperalta committed Jul 27, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit cb8bdfa61db8061ba3c2c892d3618e985457a6a0
2 changes: 1 addition & 1 deletion sdk/armcore/internal/pollers/async/async.go
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ import (

const (
finalStateAsync = "azure-async-operation"
finalStateLoc = "location"
finalStateLoc = "location" //nolint:deadcode
finalStateOrig = "original-uri"
)

1 change: 0 additions & 1 deletion sdk/armcore/internal/pollers/loc/loc_test.go
Original file line number Diff line number Diff line change
@@ -19,7 +19,6 @@ import (
const (
fakePollingURL1 = "https://foo.bar.baz/status"
fakePollingURL2 = "https://foo.bar.baz/updated"
fakeResourceURL = "https://foo.bar.baz/resource"
)

func initialResponse(method string) *azcore.Response {
12 changes: 6 additions & 6 deletions sdk/armcore/internal/pollers/pollers_test.go
Original file line number Diff line number Diff line change
@@ -133,27 +133,27 @@ func TestMakeID(t *testing.T) {
}

func TestDecodeID(t *testing.T) {
id, kind, err := DecodeID("")
_, _, err := DecodeID("")
if err == nil {
t.Fatal("unexpected nil error")
}
id, kind, err = DecodeID("invalid_token")
_, _, err = DecodeID("invalid_token")
if err == nil {
t.Fatal("unexpected nil error")
}
id, kind, err = DecodeID("invalid_token;")
_, _, err = DecodeID("invalid_token;")
if err == nil {
t.Fatal("unexpected nil error")
}
id, kind, err = DecodeID(" ;invalid_token")
_, _, err = DecodeID(" ;invalid_token")
if err == nil {
t.Fatal("unexpected nil error")
}
id, kind, err = DecodeID("invalid;token;too")
_, _, err = DecodeID("invalid;token;too")
if err == nil {
t.Fatal("unexpected nil error")
}
id, kind, err = DecodeID("pollerID;kind")
id, kind, err := DecodeID("pollerID;kind")
if err != nil {
t.Fatal(err)
}
2 changes: 1 addition & 1 deletion sdk/armcore/poller.go
Original file line number Diff line number Diff line change
@@ -219,7 +219,7 @@ func (l *LROPoller) FinalResponse(ctx context.Context, respType interface{}) (*h
func (l *LROPoller) PollUntilDone(ctx context.Context, freq time.Duration, respType interface{}) (*http.Response, error) {
start := time.Now()
logPollUntilDoneExit := func(v interface{}) {
azcore.Log().Writef(azcore.LogLongRunningOperation, "END PollUntilDone() for %T: %v, total time: %s", l.lro, v, time.Now().Sub(start))
azcore.Log().Writef(azcore.LogLongRunningOperation, "END PollUntilDone() for %T: %v, total time: %s", l.lro, v, time.Since(start))
}
azcore.Log().Writef(azcore.LogLongRunningOperation, "BEGIN PollUntilDone() for %T", l.lro)
if l.resp != nil {
11 changes: 10 additions & 1 deletion sdk/armcore/poller_test.go
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ const (
provStateStarted = `{ "properties": { "provisioningState": "Started" } }`
provStateUpdating = `{ "properties": { "provisioningState": "Updating" } }`
provStateSucceeded = `{ "properties": { "provisioningState": "Succeeded" }, "field": "value" }`
provStateFailed = `{ "properties": { "provisioningState": "Failed" } }`
provStateFailed = `{ "properties": { "provisioningState": "Failed" } }` //nolint:deadcode
statusInProgress = `{ "status": "InProgress" }`
statusSucceeded = `{ "status": "Succeeded" }`
statusCanceled = `{ "status": "Canceled" }`
@@ -97,6 +97,9 @@ func TestNewLROPollerAsync(t *testing.T) {
t.Fatal(err)
}
poller, err = NewLROPollerFromResumeToken("pollerID", tk, pl, handleError)
if err != nil {
t.Fatal(err)
}
var result mockType
_, err = poller.PollUntilDone(context.Background(), 10*time.Millisecond, &result)
if err != nil {
@@ -127,6 +130,9 @@ func TestNewLROPollerBody(t *testing.T) {
t.Fatal(err)
}
poller, err = NewLROPollerFromResumeToken("pollerID", tk, pl, handleError)
if err != nil {
t.Fatal(err)
}
var result mockType
_, err = poller.PollUntilDone(context.Background(), 10*time.Millisecond, &result)
if err != nil {
@@ -158,6 +164,9 @@ func TestNewLROPollerLoc(t *testing.T) {
t.Fatal(err)
}
poller, err = NewLROPollerFromResumeToken("pollerID", tk, pl, handleError)
if err != nil {
t.Fatal(err)
}
var result mockType
_, err = poller.PollUntilDone(context.Background(), 10*time.Millisecond, &result)
if err != nil {