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

Convert cluster test to a testable Go example. #38

Merged
merged 9 commits into from
Jun 26, 2018
Merged

Conversation

doug-perlin
Copy link
Contributor

@doug-perlin doug-perlin commented Jun 26, 2018

Converted the simple cluster test to be goexample compliant:
https://blog.golang.org/examples

Usage:

$ vgo test -v ./...

...
=== RUN   ExampleSetupClusters
--- PASS: ExampleSetupClusters (4.02s)
PASS
...

Copy link
Contributor

@iwasaki-kenta iwasaki-kenta left a comment

Choose a reason for hiding this comment

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

Errorf and code style.

time.Sleep(1 * time.Second)

if result := nodes[0].PopMessage(); result != nil {
glog.Errorf("Expected nothing in node 0, got %v", result)
Copy link
Contributor

Choose a reason for hiding this comment

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

Lowercase and no punctuation for error messages.

}
for i := 1; i < len(nodes); i++ {
if result := nodes[i].PopMessage(); result == nil {
fmt.Printf("Expected a message in node %d but it was blank", i)
Copy link
Contributor

Choose a reason for hiding this comment

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

Errorf and code styling.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This comment guideline pretty long, give me a minute to go through it

@iwasaki-kenta iwasaki-kenta changed the title Convert cluster test to a go example Convert cluster test to a testable Go example. Jun 26, 2018
@iwasaki-kenta iwasaki-kenta added the feature New feature or request label Jun 26, 2018
@iwasaki-kenta iwasaki-kenta added this to the Release milestone Jun 26, 2018
@iwasaki-kenta iwasaki-kenta merged commit 078c4f7 into master Jun 26, 2018
@iwasaki-kenta iwasaki-kenta deleted the go-example branch June 26, 2018 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants