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

Do simple #7

Merged
merged 7 commits into from
Oct 4, 2023
Merged

Do simple #7

merged 7 commits into from
Oct 4, 2023

Conversation

nao1215
Copy link
Owner

@nao1215 nao1215 commented Oct 4, 2023

No description provided.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

golangci

mocks_test.go|196 col 1| Function TestMocksHeaderPresentMatcher missing the call to method parallel (paralleltest)
mocks_test.go|220 col 1| Function TestMocksHeaderNotPresentMatcher missing the call to method parallel (paralleltest)
mocks_test.go|244 col 1| Function TestMocksBasicAuth missing the call to method parallel (paralleltest)
mocks_test.go|295 col 1| Function TestMocksQueryMatcherSuccess missing the call to method parallel (paralleltest)
mocks_test.go|322 col 1| Function TestMocksQueryMatcherErrors missing the call to method parallel (paralleltest)
mocks_test.go|350 col 1| Function TestMocksQueryParamsDoesNotOverwriteQuery missing the call to method parallel (paralleltest)
mocks_test.go|363 col 1| Function TestMocksQueryCollection missing the call to method parallel (paralleltest)
mocks_test.go|377 col 1| Function TestMocksQueryCollectionFails missing the call to method parallel (paralleltest)
mocks_test.go|391 col 1| Function TestMocksQueryPresent missing the call to method parallel (paralleltest)
mocks_test.go|412 col 1| Function TestMocksQueryNotPresent missing the call to method parallel (paralleltest)

@@ -1309,7 +1309,7 @@ func TestApiTest_CombineFormDataWithMultipart(t *testing.T) {
for name, tt := range tests {
t.Run(name, func(t *testing.T) {

cmd := exec.Command(os.Args[0], "-test.run=TestApiTest_CombineFormDataWithMultipart")
cmd := exec.Command(os.Args[0], "-test.run=TestApiTestCombineFormDataWithMultipart")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
G204: Subprocess launched with a potential tainted input or cmd arguments (gosec)

@@ -212,7 +212,7 @@ func (m *FS) create(name string) (*os.File, error) {
return file, nil
}

func (m *FS) mkdirAll(path string, perm os.FileMode) error {
func (m *FS) mkdirAll(path string, _ os.FileMode) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
(*FS).mkdirAll - result 0 (error) is always nil (unparam)

@@ -428,7 +428,7 @@ func TestApiTest_AddsBasicAuthToRequest(t *testing.T) {
End()
}

func TestApiTest_AddsTimedOutContextToRequest(t *testing.T) {
func TestApiTestAddsTimedOutContextToRequest(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
unnecessary leading newline (whitespace)

@@ -753,14 +754,14 @@ func (a *APITest) report() *http.Response {
var capturedMockInteractions []*mockInteraction

a.observers = append(a.observers, func(finalRes *http.Response, inboundReq *http.Request, a *APITest) {
capturedFinalRes = copyHttpResponse(finalRes)
capturedInboundReq = copyHttpRequest(inboundReq)
capturedFinalRes = copyHTTPResponse(finalRes)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
response body must be closed (bodyclose)

@@ -5,7 +5,7 @@ import (
"testing"
)

func TestApiTest_Assert_StatusCodes(t *testing.T) {
func TestApiTestAssertStatusCodes(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
Function TestApiTestAssertStatusCodes missing the call to method parallel (paralleltest)

@@ -93,14 +93,14 @@ func TestMocks_CookieNotPresent_FailsToMatch(t *testing.T) {
assert.Equal(t, matchError.Error(), "did not expect a cookie with name 'k'")
}

func TestMocks_NewUnmatchedMockError_Empty(t *testing.T) {
func TestMocksNewUnmatchedMockErrorEmpty(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
Function TestMocksNewUnmatchedMockErrorEmpty missing the call to method parallel (paralleltest)

mockError := newUnmatchedMockError()

assert.Equal(t, true, mockError != nil)
assert.Equal(t, 0, len(mockError.errors))
}

func TestMocks_NewEmptyUnmatchedMockError_ExpectedErrorsString(t *testing.T) {
func TestMocksNewEmptyUnmatchedMockErrorExpectedErrorsString(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
Function TestMocksNewEmptyUnmatchedMockErrorExpectedErrorsString missing the call to method parallel (paralleltest)

@@ -112,7 +112,7 @@ func TestMocks_NewEmptyUnmatchedMockError_ExpectedErrorsString(t *testing.T) {
mockError.Error())
}

func TestMocks_HostMatcher(t *testing.T) {
func TestMocksHostMatcher(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
Function TestMocksHostMatcher missing the call to method parallel (paralleltest)

@@ -150,7 +150,7 @@ func TestMocks_HostMatcher(t *testing.T) {
}
}

func TestMocks_HeaderMatcher(t *testing.T) {
func TestMocksHeaderMatcher(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
Function TestMocksHeaderMatcher missing the call to method parallel (paralleltest)

@@ -179,7 +179,7 @@ func TestMocks_HeaderMatcher(t *testing.T) {
}
}

func TestMocks_MockRequest_Header_WorksWithHeaders(t *testing.T) {
func TestMocksMockRequestHeaderWorksWithHeaders(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
Function TestMocksMockRequestHeaderWorksWithHeaders missing the call to method parallel (paralleltest)

@@ -193,7 +193,7 @@ func TestMocks_MockRequest_Header_WorksWithHeaders(t *testing.T) {
assert.Equal(t, true, matchError == nil)
}

func TestMocks_HeaderPresentMatcher(t *testing.T) {
func TestMocksHeaderPresentMatcher(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
Function TestMocksHeaderPresentMatcher missing the call to method parallel (paralleltest)

@@ -217,7 +217,7 @@ func TestMocks_HeaderPresentMatcher(t *testing.T) {
}
}

func TestMocks_HeaderNotPresentMatcher(t *testing.T) {
func TestMocksHeaderNotPresentMatcher(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
Function TestMocksHeaderNotPresentMatcher missing the call to method parallel (paralleltest)

@@ -241,7 +241,7 @@ func TestMocks_HeaderNotPresentMatcher(t *testing.T) {
}
}

func TestMocks_BasicAuth(t *testing.T) {
func TestMocksBasicAuth(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
Function TestMocksBasicAuth missing the call to method parallel (paralleltest)

@@ -292,9 +292,9 @@ func TestMocks_BasicAuth(t *testing.T) {
}
}

func TestMocks_QueryMatcher_Success(t *testing.T) {
func TestMocksQueryMatcherSuccess(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
Function TestMocksQueryMatcherSuccess missing the call to method parallel (paralleltest)

@@ -319,9 +319,9 @@ func TestMocks_QueryMatcher_Success(t *testing.T) {
}
}

func TestMocks_QueryMatcher_Errors(t *testing.T) {
func TestMocksQueryMatcherErrors(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
Function TestMocksQueryMatcherErrors missing the call to method parallel (paralleltest)

@@ -347,7 +347,7 @@ func TestMocks_QueryMatcher_Errors(t *testing.T) {
}
}

func TestMocks_QueryParams_DoesNotOverwriteQuery(t *testing.T) {
func TestMocksQueryParamsDoesNotOverwriteQuery(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
Function TestMocksQueryParamsDoesNotOverwriteQuery missing the call to method parallel (paralleltest)

@@ -360,7 +360,7 @@ func TestMocks_QueryParams_DoesNotOverwriteQuery(t *testing.T) {
assert.Equal(t, true, matchError == nil)
}

func TestMocks_QueryCollection(t *testing.T) {
func TestMocksQueryCollection(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
Function TestMocksQueryCollection missing the call to method parallel (paralleltest)

@@ -374,7 +374,7 @@ func TestMocks_QueryCollection(t *testing.T) {
assert.Equal(t, true, matchError == nil)
}

func TestMocks_QueryCollection_Fails(t *testing.T) {
func TestMocksQueryCollectionFails(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
Function TestMocksQueryCollectionFails missing the call to method parallel (paralleltest)

@@ -388,9 +388,9 @@ func TestMocks_QueryCollection_Fails(t *testing.T) {
assert.Equal(t, true, matchError != nil)
}

func TestMocks_QueryPresent(t *testing.T) {
func TestMocksQueryPresent(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
Function TestMocksQueryPresent missing the call to method parallel (paralleltest)

matchError := queryPresentMatcher(req, mockRequest)
assert.Equal(t, test.expectedError, matchError)
})
}
}

func TestMocks_QueryNotPresent(t *testing.T) {
func TestMocksQueryNotPresent(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
Function TestMocksQueryNotPresent missing the call to method parallel (paralleltest)

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

Code Metrics Report

main (3e95163) #7 (01b212b) +/-
Coverage 82.4% 82.4% +0.0%
Test Execution Time 7s 4s -3s
Details
  |                     | main (3e95163) | #7 (01b212b) |  +/-  |
  |---------------------|----------------|--------------|-------|
+ | Coverage            |          82.4% |        82.4% | +0.0% |
  |   Files             |              7 |            7 |     0 |
  |   Lines             |           1586 |         1588 |    +2 |
+ |   Covered           |           1307 |         1309 |    +2 |
+ | Test Execution Time |             7s |           4s |   -3s |

Code coverage of files in pull request scope (77.8% → 82.4%)

Files Coverage +/-
assert.go 22.4% 0.0%
cookies.go 100.0% 0.0%
diagram.go 62.8% 0.0%
difflib/difflib.go 91.0% 0.0%
mocks.go 86.3% 0.0%
report.go 100.0% 0.0%
spectest.go 93.5% +93.5%

Reported by octocov

@@ -451,7 +450,7 @@ func TestApiTest_AddsTimedOutContextToRequest(t *testing.T) {
End()
}

func TestApiTest_AddsCancelledContextToRequest(t *testing.T) {
func TestApiTestAddsCancelledContextToRequest(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
unnecessary leading newline (whitespace)

request: copyHttpRequest(mockReq),
response: copyHttpResponse(mockRes),
request: copyHTTPRequest(mockReq),
response: copyHTTPResponse(mockRes),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
response body must be closed (bodyclose)

spectest.go Show resolved Hide resolved
@nao1215 nao1215 merged commit bbffcbf into main Oct 4, 2023
9 of 10 checks passed
@nao1215 nao1215 deleted the do-simple branch October 9, 2023 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant