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

./send_test.go:238:8: second argument to errors.As should not be *error #176

Closed
atc0005 opened this issue Jul 18, 2022 · 0 comments · Fixed by #177
Closed

./send_test.go:238:8: second argument to errors.As should not be *error #176

atc0005 opened this issue Jul 18, 2022 · 0 comments · Fixed by #177
Assignees
Labels
bug Something isn't working tests
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Jul 18, 2022

Overview

  • Current stable versions of Go do not surface any warnings/errors when running tests
  • Pre-release Go 1.19 versions (used in CI) do surface an issue with the current test suite

Test output from Go 1.17.12

No errors/warnings with the "oldstable" version of Go, version 1.17.12 (linux/amd64):

$ docker container run -it --rm -v $PWD:$PWD -w $PWD golang:1.17.12 go test ./...
ok      github.com/atc0005/go-teams-notify/v2   0.007s
?       github.com/atc0005/go-teams-notify/v2/adaptivecard      [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/actions     [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/basic       [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/custom-user-agent   [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/custom-validation   [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/disable-validation  [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/user-mention-multiple       [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/user-mention-single [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/user-mention-verbose        [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/messagecard/actions      [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/messagecard/basic        [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/messagecard/custom-user-agent    [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/messagecard/custom-validation    [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/messagecard/disable-validation   [no test files]
?       github.com/atc0005/go-teams-notify/v2/internal/validator        [no test files]
?       github.com/atc0005/go-teams-notify/v2/messagecard       [no test files]

Test output from Go 1.18.4

No errors/warnings with the current stable version of Go, version 1.18.4 (linux/amd64):

$ docker container run -it --rm -v $PWD:$PWD -w $PWD golang:1.18.4 go test ./...
ok      github.com/atc0005/go-teams-notify/v2   0.005s
?       github.com/atc0005/go-teams-notify/v2/adaptivecard      [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/actions     [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/basic       [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/custom-user-agent   [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/custom-validation   [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/disable-validation  [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/user-mention-multiple       [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/user-mention-single [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/user-mention-verbose        [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/messagecard/actions      [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/messagecard/basic        [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/messagecard/custom-user-agent    [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/messagecard/custom-validation    [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/messagecard/disable-validation   [no test files]
?       github.com/atc0005/go-teams-notify/v2/internal/validator        [no test files]
?       github.com/atc0005/go-teams-notify/v2/messagecard       [no test files]

Test output from Go 1.19 (pre-release versions)

Same results using these 1.19 pre-release versions:

  • 1.19beta1
  • 1.19.rc1
  • 1.19rc2

Output:

$ docker container run -it --rm -v $PWD:$PWD -w $PWD golang:1.19rc2 go test ./...
# github.com/atc0005/go-teams-notify/v2
./send_test.go:238:8: second argument to errors.As should not be *error
FAIL    github.com/atc0005/go-teams-notify/v2 [build failed]
?       github.com/atc0005/go-teams-notify/v2/adaptivecard      [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/actions     [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/basic       [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/custom-user-agent   [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/custom-validation   [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/disable-validation  [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/user-mention-multiple       [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/user-mention-single [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/adaptivecard/user-mention-verbose        [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/messagecard/actions      [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/messagecard/basic        [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/messagecard/custom-user-agent    [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/messagecard/custom-validation    [no test files]
?       github.com/atc0005/go-teams-notify/v2/examples/messagecard/disable-validation   [no test files]
?       github.com/atc0005/go-teams-notify/v2/internal/validator        [no test files]
?       github.com/atc0005/go-teams-notify/v2/messagecard       [no test files]
FAIL
@atc0005 atc0005 added bug Something isn't working tests labels Jul 18, 2022
@atc0005 atc0005 added this to the v2.7.0 milestone Jul 18, 2022
@atc0005 atc0005 self-assigned this Jul 18, 2022
atc0005 added a commit that referenced this issue Jul 18, 2022
Remove errors.As() comparison logic until I can determine how to use a
table test configuration to reliably assert that an expected error is
of a specific type.

Tweak test failure message format slightly to improve readability.

Add `name` field to table test struct, move test name comments from
each table test into name value (so that each test case is properly
labeled in output).

Run each test case as a subtest in an effort to provide additional
isolation.

refs GH-176
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant