Skip to content

Commit

Permalink
increase code coverage goal for azcore
Browse files Browse the repository at this point in the history
added move coverage to azcore and fixed bug in retry policy.
fixed test publishing to include sub-directories.
  • Loading branch information
jhendrixMSFT committed Aug 18, 2021
1 parent 75c1a4d commit f1b22ab
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion eng/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Name": "azcore",
"CoverageGoal": 0.68
"CoverageGoal": 0.85
},
{
"Name": "internal",
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/templates/steps/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ steps:
condition: succeededOrFailed()
inputs:
testRunner: JUnit
testResultsFiles: '${{parameters.GoWorkspace}}sdk/${{parameters.ServiceDirectory}}/report.xml'
testResultsFiles: '${{parameters.GoWorkspace}}sdk/${{parameters.ServiceDirectory}}/**/report.xml'
testRunTitle: 'Go ${{ parameters.GoVersion }} on ${{ parameters.Image }}'
failTaskOnFailedTests: true

Expand Down
2 changes: 1 addition & 1 deletion sdk/azcore/policy_retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (p *retryPolicy) Do(req *Request) (resp *http.Response, err error) {
if req.body != nil {
// wrap the body so we control when it's actually closed
rwbody := &retryableRequestBody{body: req.body}
req.Body = rwbody
req.body = rwbody
req.Request.GetBody = func() (io.ReadCloser, error) {
_, err := rwbody.Seek(0, io.SeekStart) // Seek back to the beginning of the stream
return rwbody, err
Expand Down
2 changes: 1 addition & 1 deletion sdk/azcore/poller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func TestOpPollerSimple(t *testing.T) {

func TestOpPollerWithWidgetPUT(t *testing.T) {
srv, close := mock.NewServer()
srv.AppendResponse(mock.WithStatusCode(http.StatusAccepted), mock.WithBody([]byte(`{"status": "InProgress"}`)))
srv.AppendResponse(mock.WithStatusCode(http.StatusAccepted), mock.WithBody([]byte(`{"status": "InProgress"}`)), mock.WithHeader("Retry-After", "1"))
srv.AppendResponse(mock.WithStatusCode(http.StatusAccepted), mock.WithBody([]byte(`{"status": "InProgress"}`)))
srv.AppendResponse(mock.WithStatusCode(http.StatusOK), mock.WithBody([]byte(`{"status": "Succeeded"}`)))
// PUT and PATCH state that a final GET will happen
Expand Down

0 comments on commit f1b22ab

Please sign in to comment.