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

add tests for test package #75

Closed
wants to merge 1 commit into from

Conversation

jgramoll
Copy link
Contributor

also:
• fix ExitStatus for test package
• Allow POST for test package

@CLAassistant
Copy link

CLAassistant commented Jun 30, 2021

CLA assistant check
All committers have signed the CLA.

also:
• fix ExitStatus for test package
• Allow POST for test package
@@ -119,7 +119,7 @@ func MockFunc(e mockEnvironment) net.Conn {
for {
d, err := readPbFrame(conB)
if err != nil {
e.Errorf("Can't read method name")
// Conn probably closed
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was getting an error with go test -race trying to access e from this goroutine. Open to ideas how to fix this better, but it got my tests working

if req.Body != "" {
return fmt.Errorf("GET requests must not have body, found \"%v\"", req.Body)
}
return nil
case "POST":
return nil
default:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a reason to only whitelist certain methods?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like unfinished code.

@@ -442,9 +446,9 @@ func (e *TestEnv) Handle(method string, args_d []byte) []byte {
args := kong_plugin_protocol.ExitArgs{}
e.noErr(proto.Unmarshal(args_d, &args))
e.ClientRes.Status = int(args.Status)
e.state = finished
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ExitStatus was not finishing

Copy link

Choose a reason for hiding this comment

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

ack for this addition

@kikito
Copy link
Member

kikito commented Aug 22, 2023

@fffonion please review

@StarlightIbuki
Copy link
Contributor

StarlightIbuki commented Nov 16, 2023

Hi. @jgramoll Do you still want to push this forward? Please rebase the branch and solve the conflict.

@gszr
Copy link
Member

gszr commented Mar 13, 2024

Opened #196 picking the changes here.

@gszr gszr closed this Mar 13, 2024
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.

7 participants