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

Added request headers to http tests #496

Merged
merged 5 commits into from
Nov 23, 2019

Conversation

dacamp
Copy link
Contributor

@dacamp dacamp commented Nov 21, 2019

No description provided.

Copy link

@sean- sean- left a comment

Choose a reason for hiding this comment

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

Awesome, this looks really good.

@dacamp
Copy link
Contributor Author

dacamp commented Nov 21, 2019

Build is failing because Travis is pinned to go1.11 up to @aelsabbahy to weigh in on either updating the go version or maintain compatibility:

diff --git a/system/http.go b/system/http.go
index fc18225..7de0646 100644
--- a/system/http.go
+++ b/system/http.go
@@ -74,7 +74,7 @@ func (u *DefHTTP) setup() error {
        if err != nil {
                return u.err
        }
-       req.Header = u.RequestHeader.Clone()
+       req.Header = u.RequestHeader
        if u.Username != "" || u.Password != "" {
                req.SetBasicAuth(u.Username, u.Password)
        }

@aelsabbahy
Copy link
Member

aelsabbahy commented Nov 21, 2019

I'm fine with updating go if it doesn't break anything else.

Feel free to submit a different PR for that or just tack it on this one.

@aelsabbahy
Copy link
Member

https://github.com/aelsabbahy/goss/blob/master/.travis.yml#L4

I think this is what you meant to change.

@dacamp
Copy link
Contributor Author

dacamp commented Nov 22, 2019

Ahh that's what I was looking for! Want me to backout the changes on go.mod?

@aelsabbahy
Copy link
Member

Can you point me to the docs on the go.mod change. Go has changed dep management systems so many times, I actually haven't read up on go.mod yet.

Guess what I'm saying is, I don't understand the implications of the go.mod change you made. :)

@aelsabbahy
Copy link
Member

If you get this PR green today I'll probably cut a Goss release with it tomorrow.

@dacamp
Copy link
Contributor Author

dacamp commented Nov 22, 2019

This is the best doc I've found to describe the go directive in go.mod. Looks like it defines the expected language version. Because header.Clone was released in go 1.13 I think it makes sense to set the go version.

@dacamp
Copy link
Contributor Author

dacamp commented Nov 22, 2019

Looks like the build if failing in Travis. I've noticed these fail locally prior to making any changes. If you think they're just flaky tests would you mind retrying the build in Travis so I don't have to push a no-op change?

@aelsabbahy
Copy link
Member

Count: 94, Failed: 0, Skipped: 5
+[[ centos7 == \a\r\c\h ]]
+egrep -q 'Count: 93, Failed: 0, Skipped: 5'

The counts are mismatching since you added a test.

@aelsabbahy
Copy link
Member

Also, docs need to be updated. I'm doing quick eyeball review on my phone currently.

@aelsabbahy
Copy link
Member

Thanks for the document on go.mod, explained it very well.

@aelsabbahy aelsabbahy merged commit aa0fc08 into goss-org:master Nov 23, 2019
BenjaminHerbert pushed a commit to BenjaminHerbert/goss that referenced this pull request May 28, 2020
* Added request headers to http tests

* Pinning go 1.13

* Pinning Travis version of go to 1.13

* Bumping the count of tests being run

* Updating the docs to reflect new request headers
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

4 participants