-
Notifications
You must be signed in to change notification settings - Fork 757
Add release scripts for the Go client #703
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some update to .travis.yml and question about the cov.sh
.travis.yml
Outdated
- go test -i -race ./... | ||
- go test -v -run=TestNoRace -p=1 ./... | ||
- if [[ "$TRAVIS_GO_VERSION" =~ 1.16 ]]; then ./scripts/cov.sh TRAVIS; else go test -race -v -p=1 ./... --failfast; fi | ||
- go test -modfile=go_test.mod -i -race ./... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonder if we not simply remove this line. It is even deprecated since go 1.16: https://travis-ci.com/github/nats-io/nats.go/jobs/495796803#L264
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems will be fine if we just remove, so took it out: golang/go#41696
- if [[ "$TRAVIS_GO_VERSION" =~ 1.16 ]]; then ./scripts/cov.sh TRAVIS; else go test -race -v -p=1 ./... --failfast; fi | ||
- go test -modfile=go_test.mod -i -race ./... | ||
- go test -modfile=go_test.mod -v -run=TestNoRace -p=1 ./... | ||
- if [[ "$TRAVIS_GO_VERSION" =~ 1.16 ]]; then ./scripts/cov.sh TRAVIS; else go test -modfile=go_test.mod -race -v -p=1 ./... --failfast; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: we use -modfile
here and line above, but ./scripts/cov.sh is not. Is that a problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes those entries were missing -modfile
so have updated now.
Signed-off-by: Waldemar Quevedo <[email protected]> Signed-off-by: Jaime Piña <[email protected]>
The minimal
when the app is built using In order to get around that issue, we need to refactor/move the tests that depend on the server currently in
Once that separation is done, then nats.go users that run @variadico and I took a stab at making that to see how it would like in this branch, and seems that most tests can be moved though without issues, with the exception of a couple reconnection tests such as TestReconnectServerStats and TestConnAsyncCBDeadlockt that rely on some of the private functions of the client. |
To me this is quite annoying to have tests in different package. I like to be able to check internals. After all, we are checking the behavior of the library and sometimes it means checking that internals are what they should be. Also, in go, you should have file with I appreciate the effort, but all that we are doing here, correct me if my understanding is wrong, is to have users be able to do |
Reconsidering that this is too much to effort, would be simpler to add a different modfile for the go test (#705) so closing. |
This PR introduces a couple of scripts to facilitate the release and tagging of the Go client. The motivation for this is to be able to tag versions of the client that do not include the test dependencies so that users of a tagged version of the library do not have to clone the nats-server to use the client.
As a result the go module for the Go client will look like this in tagged versions of the library:
After the tagging of the repo happens, then the test dependencies are reintroduced so that
go test ./..
will continue to work as usual.Example usage
Let's say that we are releasing the
v1.11.0
version of the library. First we do this:This will create a release branch called
release/v1.11.0
that creates the module without test dependencies and split them into anothergo_test.mod
which will be used instead by Travis to run CI withgo test -modfile=go_test.mod ./...
.After running the script, the repo with the go module without dependencies can be tagged and pushed.
Once pushing the tag and release branch, main branch is put back into development mode with all the test dependencies included:
Example result of this is the following app that only uses a tagged version of the client and go.sum does not include the server.
Signed-off-by: Waldemar Quevedo [email protected]
Signed-off-by: Jaime Piña [email protected]