connection: add ContextDialer interface and support for custom dialers#41
connection: add ContextDialer interface and support for custom dialers#41noxiouz merged 1 commit intovarlink:masterfrom
Conversation
|
I would like to see a small test for this, but the code does not have a lot of test coverage so that might be a high ask. |
I think it might be easy enough to just connect to a simple tcp listener without doing any varlink call's ... |
|
Cool! LGTM :) I pinged the other maintainers just in case there are any more input before the merge |
|
@Foxboron ive added a connection_test.go - it only checks if the socket connects (and if the dialer was used) - does not do any varlink calls |
|
It should be noted that if we try to test the whole thing, it fails: $ go test -v ./...
# github.com/varlink/go/cmd/varlink-go-certification
cmd/varlink-go-certification/main.go:145:26: undefined: orgvarlinkcertification.VarlinkInterface
cmd/varlink-go-certification/main.go:194:69: undefined: orgvarlinkcertification.VarlinkCall
cmd/varlink-go-certification/main.go:198:70: undefined: orgvarlinkcertification.VarlinkCall
cmd/varlink-go-certification/main.go:206:70: undefined: orgvarlinkcertification.VarlinkCall
cmd/varlink-go-certification/main.go:218:70: undefined: orgvarlinkcertification.VarlinkCall
cmd/varlink-go-certification/main.go:230:70: undefined: orgvarlinkcertification.VarlinkCall
cmd/varlink-go-certification/main.go:241:70: undefined: orgvarlinkcertification.VarlinkCall
cmd/varlink-go-certification/main.go:253:70: undefined: orgvarlinkcertification.VarlinkCall
cmd/varlink-go-certification/main.go:288:70: undefined: orgvarlinkcertification.VarlinkCall
cmd/varlink-go-certification/main.go:321:70: undefined: orgvarlinkcertification.VarlinkCall
cmd/varlink-go-certification/main.go:321:70: too many errors
FAIL github.com/varlink/go/cmd/varlink-go-certification [build failed]
? github.com/varlink/go/cmd/varlink-go-certification/orgvarlinkcertification [no test files]
....But i dont know if its releated to these changes - these issues seem to be present in master as well: |
|
You need to run |
Nice catch - if running the generate command beforehand, everything passes :) |
At its core, this adds a NewConnectionWithDialer. The main usecase, at least for me, was to connect to unix sockets on remote machines...