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

[FIXED] Get rid of server dev dependencies in nats package #1441

Merged
merged 12 commits into from
Oct 15, 2023

Conversation

piotrpio
Copy link
Collaborator

@piotrpio piotrpio commented Oct 13, 2023

  • When possible, tests were moved under test directory
  • Some tests were refactored/removed to not use unexported properties
  • Introduced -tags=internal_testing for tests that depend on internals not exposed via public API

@wallyqs
Copy link
Member

wallyqs commented Oct 13, 2023

Confirmed this approach would work as below ✅

$ echo '
package main

import (
	"github.com/nats-io/nats.go"
)

func main() {
	// Connect to a server
	nc, _ := nats.Connect(nats.DefaultURL)

	// Simple Publisher
	nc.Publish("foo", []byte("Hello World"))
}
' > main.go

$ go mod init example.com/example
$ go mod edit -require github.com/nats-io/nats.go@move-server-tests
$ go mod tidy
go: downloading github.com/nats-io/nats.go v1.30.3-0.20231013231123-4065e270471b

$ cat go.mod

module example.com/example

go 1.21.2

require github.com/nats-io/nats.go v1.30.3-0.20231013231123-4065e270471b

require (
	github.com/klauspost/compress v1.17.0 // indirect
	github.com/nats-io/nkeys v0.4.5 // indirect
	github.com/nats-io/nuid v1.0.1 // indirect
	golang.org/x/crypto v0.6.0 // indirect
	golang.org/x/sys v0.5.0 // indirect
)

$ go build .
$ go version -m example
example: go1.21.2
	path	example.com/example
	mod	example.com/example	(devel)	
	dep	github.com/klauspost/compress	v1.17.0	h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM=
	dep	github.com/nats-io/nats.go	v1.30.3-0.20231013231123-4065e270471b	h1:gFa8SUr5qFCHvtpGoDMvGwzs106hBZiDWo37JO7EaHU=
	dep	github.com/nats-io/nkeys	v0.4.5	h1:Zdz2BUlFm4fJlierwvGK+yl20IAKUm7eV6AAZXEhkPk=
	dep	github.com/nats-io/nuid	v1.0.1	h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
	dep	golang.org/x/crypto	v0.6.0	h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc=
	dep	golang.org/x/sys	v0.5.0	h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
	build	-buildmode=exe
	build	-compiler=gc
	build	CGO_ENABLED=1
	build	CGO_CFLAGS=
	build	CGO_CPPFLAGS=
	build	CGO_CXXFLAGS=
	build	CGO_LDFLAGS=
	build	GOARCH=amd64
	build	GOOS=darwin
	build	GOAMD64=v1
	build	vcs=git
	build	vcs.revision=960f37f30fc9728329b75b5a937d1714c94e1ad3
	build	vcs.time=2023-10-13T23:12:01Z
	build	vcs.modified=true

Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

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

LGTM, when it is ready and CI green.

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
@piotrpio piotrpio marked this pull request as ready for review October 14, 2023 13:38
@piotrpio piotrpio merged commit 6570ee2 into main Oct 15, 2023
2 checks passed
@piotrpio piotrpio deleted the move-server-tests branch October 15, 2023 16:59
@wallyqs wallyqs mentioned this pull request Oct 16, 2023
2 tasks
@AlexCuse
Copy link

This is awesome thanks so much 🫡

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