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

Fix #11 by separating the responsibility to store and run hooks #27

Merged
merged 6 commits into from
Jun 13, 2017
Merged

Fix #11 by separating the responsibility to store and run hooks #27

merged 6 commits into from
Jun 13, 2017

Conversation

IngmarStein
Copy link
Contributor

This PR fixes the warnings printed for each method in Hooks that doesn't have a matching signature for RPC.

IngmarStein and others added 2 commits June 10, 2017 23:34
Remove unused fields from hooks.DummyRunner
Fix type name in DummyRunner description

Fix some warnings during testing:
```
warn: Parser warning in file './apiary.apib': (warning code 10) message-body asset is expected to be a pre-formatted code block, separate it by a newline and indent every of its line by 8 spaces or 2 tabs on lines 3-4
warn: Parser warning in file './apiary.apib': (warning code 10) message-body asset is expected to be a pre-formatted code block, separate it by a newline and indent every of its line by 8 spaces or 2 tabs on lines 5-6
```
@ddelnano
Copy link
Collaborator

@IngmarStein thanks for opening this! I have been meaning to get these fixed but haven't gotten around to it. Unfortunately the e2e tests seem to be failing. Since they haven't been run in a while I opened #28 to just test master to make sure any upstream dredd changes did not change anything (since the dredd version is not pinned in the build). Since that passed these changes have caused a breakage. I'll try to look at this sometime today to dig into why its failing.

@IngmarStein
Copy link
Contributor Author

I think one of the issues is that the example app vendors a specific goodman version which of course doesn't include the commits above and therefore doesn't compile. The vendor.json file could be updated after merging.
Not sure about the TimeoutErrors though…

@ddelnano ddelnano mentioned this pull request Jun 12, 2017
@IngmarStein
Copy link
Contributor Author

The cucumber tests now pass and the only remaining error is due to the old vendored goodman code in the example app. I hope you don't mind adding Go 1.8 to the test matrix.

@@ -51,7 +51,7 @@ func main() {
}
}()
for retries := 5; retries > 0; retries-- {
runner, err := goodman.NewRunner("Hooks", hookServerInitalPort)
runner, err := goodman.NewRunner("HooksRunner", hookServerInitalPort)
Copy link
Collaborator

Choose a reason for hiding this comment

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

😢 for magic strings. I wonder if its possible to look this up using reflection or some other mechanism?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would look like this:

rpcService := reflect.TypeOf((*hooks.HooksRunner)(nil)).Elem().Name()
for retries := 5; retries > 0; retries-- {
	runner, err := goodman.NewRunner(rpcService, hookServerInitalPort)

and needs an import of github.com/snikch/goodman/hooks
Do you prefer that?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm guessing this was the change that fixed the timeouts correct?

I was hoping to introduce a change that threw a more obvious error instead of experiencing timeouts. Now that I think about it I don't think that would have changed anything. I'm fine with things either way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, that was the cause for the timeouts.

I've pushed the change to retrieve the struct name via reflection.

@ddelnano
Copy link
Collaborator

@IngmarStein +1 for the addition of Go 1.8.

@ddelnano
Copy link
Collaborator

ddelnano commented Jun 13, 2017

@IngmarStein can we remove the vendoring of the goodman packages from the example's vendor.json? I think that will fix the example run in the CI build. I want to keep that apart of the CI build to make sure its always working but didn't realize the drawbacks of vendoring it like I did.

I did a proof of concept in #29 to see if it would still pass and I'm hoping if you make the same change it will work.

Once the example works I think this is good to merge.

@ddelnano
Copy link
Collaborator

@IngmarStein going to merge and tag a new release! Thanks for fixing this.

@ddelnano ddelnano merged commit 6b21283 into snikch:master Jun 13, 2017
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.

2 participants