Skip to content

refactor: make project buildable under go1.7 and newer#6

Merged
tomasz-pazdziurek-cko merged 1 commit intomasterfrom
refactor/make-project-buildable-using-go-newer-than-1.6
Sep 22, 2023
Merged

refactor: make project buildable under go1.7 and newer#6
tomasz-pazdziurek-cko merged 1 commit intomasterfrom
refactor/make-project-buildable-using-go-newer-than-1.6

Conversation

@tomasz-pazdziurek-cko
Copy link
Copy Markdown

@tomasz-pazdziurek-cko tomasz-pazdziurek-cko commented Sep 21, 2023

refactor: make project buildable under go1.7 and newer

  • tested under go1.21.1
  • add go module
  • fix string formatting using %s and %q templates / placeholders
  • fix error messages in tests verifying negative results
  • skip and mark failing tests with appropriate TODO comments

….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
Comment on lines +8 to +9
// TODO: Fix integration - Update ends with 404 Not Found ✓
t.Skip()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Did the original version code act the same?
I am talking about all skipped tests.

Copy link
Copy Markdown
Author

@tomasz-pazdziurek-cko tomasz-pazdziurek-cko Sep 21, 2023

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.)

Copy link
Copy Markdown
Author

@tomasz-pazdziurek-cko tomasz-pazdziurek-cko Sep 22, 2023

Choose a reason for hiding this comment

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

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/testify

And then, running go test ./... failed with the failures I mentioned before.

Copy link
Copy Markdown

@wojciech-niedbala-cko wojciech-niedbala-cko left a comment

Choose a reason for hiding this comment

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

Looks good but let's test as much as we can on sandbox and be cautious with deployment

@tomasz-pazdziurek-cko tomasz-pazdziurek-cko merged commit 7c68ea8 into master Sep 22, 2023
@tomasz-pazdziurek-cko tomasz-pazdziurek-cko deleted the refactor/make-project-buildable-using-go-newer-than-1.6 branch September 22, 2023 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants