-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
Windows - Cannot run Pact #9
Comments
Is there a Vagrant VM you're using for this perchance? |
This was run on Windows 10 Pro with VMWare Fusion. |
On Windows 10 Home (not emulated), I also get this error:
The Pact daemon is running on 6666. |
I'm wondering if perhaps the log path is the issue: Looks like the default path for the log file is set at https://github.com/pact-foundation/pact-go/blob/master/dsl/pact.go#L90, and includes a '/' which is probably not portable (I'll fix that if it turns out it's the issue). Could you please try manually setting the path and seeing if that helps? |
if p.Server == nil {
p.LogDir = filepath.FromSlash("C:/Users/Tony/Projects/Go/src/github.com/pact-foundation/pact-go/examples/log/pact.log")
args := []string{
fmt.Sprintf("--pact-specification-version %d", p.SpecificationVersion),
fmt.Sprintf("--pact-dir %s", p.PactDir),
fmt.Sprintf("--log %s", p.LogDir),
fmt.Sprintf("--consumer %s", p.Consumer),
fmt.Sprintf("--provider %s", p.Provider),
}
client := &PactClient{Port: p.Port}
p.pactClient = client
fmt.Println("ARGUMENTS ARE:", args)
p.Server = client.StartServer(args)
} Also printed out the arguments to see what they were:
Daemon was run with --logLevel DEBUG:
|
Thanks for this @serinth! Might be an issue with the latest mock service or how we provide the arguments to it, I'll dig into it. Out of interest, can you run the mock service independently of Pact Go? e.g. |
Have verified this issue locally. |
Update. With your client updates above and also modifying the flags sent to the Ruby Mock Service I have been able to get a successful test case running The flags must be sent individually, rather than as key-pair combinations (e.g. https://github.com/pact-foundation/pact-go/blob/master/dsl/pact.go#L88-L92) . I'll continue to look into it this week and find a solution that works nicely for both Windows and non-Windows clients. |
OK, I just have one remaining issue. When the tests complete, the connection to the Ruby service seems to remain open. The interrupt signal is being received, but Ruby doesn't want to shut down. Need to track down why there is a connection, but I have managed to create a workaround which I'll publish shortly to this branch. |
I've pushed a package that I've tested on a local Windows VM (Windows 11, 64bit). Could you please check it out? (v0.0.3) |
It seems due to the naming of my branch that was merged closed the ticket - reopening until you can confirm. |
I just pulled from master and ran the 0.0.3 release for windows. The following are the logs: from Pact Daemon:
And from the consumer example:
Seems to be working. |
Great - sorry about the logs though - eww! I'm looking into the underlying cause of the connection not closing (this work was probably required anyway). I'll close this for now and re-open another ticket to resolve the logging situation. |
After running the pact release for Windows (v0.0.3) and verifying that the daemon was listening on 6666, the consumer example could not connect to the daemon therefore failing the consumer tests.
pact-go/dsl/client.go
net.Dial and net.DialHttp issues with connecting to localhost. Specifying localhost solved the issue in the server name. This may possibly be linked to IPv6.
After modifying
client.go
and the daemon logs the connection we have this issue:It looks like the pact-mock-service.rb doesn't like Windows paths.
The text was updated successfully, but these errors were encountered: