testing: add more unit tests to increase branch coverage#7227
testing: add more unit tests to increase branch coverage#7227mohammed90 wants to merge 34 commits intomasterfrom
Conversation
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
|
AI disclosure: copilot + claude opus Bugs FoundBug 1:
|
| // TODO: decide on the behavior for this case; it fails currently | ||
| // { | ||
| // name: "module with @ in path but no version", | ||
| // input: "github.com/@user/module", | ||
| // expectedModule: "github.com/@user/module", | ||
| // expectedVersion: "", | ||
| // expectError: false, | ||
| // }, |
There was a problem hiding this comment.
I guess we should figure out the official spec on Go's package string format, I figure an @ immediately after a / would just be eaten as part of the package name, not count as a version unless there's something alpha before the @ 🤔
| "testing" | ||
| ) | ||
|
|
||
| func TestReverse(t *testing.T) { |
There was a problem hiding this comment.
Oh 🤣 I didn't realize we actually had a func reverse, I assumed this was testing a Go built-in
| "go.uber.org/zap/zapcore" | ||
| ) | ||
|
|
||
| func TestLoggableHTTPRequestMarshal(t *testing.T) { |
There was a problem hiding this comment.
LoggableHTTPRequest will probably be moved to internal in #7578
There was a problem hiding this comment.
I have it on my radar
There was a problem hiding this comment.
I have it on my radar
It has been moved over 🙂
Self-expalantory. We need to add more tests; and I wondered if LLMs could generate tests covering all the logic branches, so this is the result.
Assistance Disclosure
I used Amp to generate the tests, tweaked few by hand, and fixed the bug by hand. The generated code will not be taken and accepted at face value. Changes to the source code (not tests) by the agent will not be accepted. Only the tests cases with study of coverage.
Prompt: