refactor: make project buildable under go1.7 and newer#6
Conversation
….21.1) * add go module * fix string formatting using %s and %q templates / placeholders * fix error messages in tests verifying negative results * skp and mark failing tests with appropriate TODO comments
| // TODO: Fix integration - Update ends with 404 Not Found ✓ | ||
| t.Skip() |
There was a problem hiding this comment.
Did the original version code act the same?
I am talking about all skipped tests.
There was a problem hiding this comment.
The original version didn't actually compile without changes (even when I tried with go1.6.4).
Not sure yet why, but the following error occurred:
Cloning into 'braintree-go/src/gopkg.in/yaml.v3'...
fatal: unable to access 'https://gopkg.in/yaml.v3/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
No idea why I couldn't verify that certificate when running go1.6.4.
When tried to run with newer go version (go1.21.1) using GO111MODULE=off (no module compatibility), I could run tests and these failed with the same results as in the submitted version.
There was a problem hiding this comment.
I think Petro meant why do we need to skip those tests - and whether those new TODOs could be resolved? Or those are around things we are not using?
Also worth checking - whether those tests failed previously (on master etc.)
There was a problem hiding this comment.
Well, I couldn't run tests on master, because without any changes, I couldn't even compile the project on master.
Maybe someone might try to compile and run tests with entire repo untouched, but I didn't manage to.
After having added go module, project compiled and these tests failed, as described here - Slack thread.
Adding go module was just a set of commands:
go mod init github.com/processout/braintree-go
go get github.com/stretchr/testifyAnd then, running go test ./... failed with the failures I mentioned before.
wojciech-niedbala-cko
left a comment
There was a problem hiding this comment.
Looks good but let's test as much as we can on sandbox and be cautious with deployment
refactor: make project buildable under go1.7 and newer