Skip to content

Conversation

@kaixinbaba
Copy link

Try to add new API for zk 3.6, this commit is just for GetEphemerals

@codecov
Copy link

codecov bot commented Jan 13, 2021

Codecov Report

Merging #45 (50a2f1b) into master (54f4812) will increase coverage by 0.09%.
The diff coverage is 55.55%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #45      +/-   ##
==========================================
+ Coverage   76.11%   76.21%   +0.09%     
==========================================
  Files           7        7              
  Lines        1189     1198       +9     
==========================================
+ Hits          905      913       +8     
  Misses        195      195              
- Partials       89       90       +1     
Impacted Files Coverage Δ
constants.go 75.00% <ø> (ø)
conn.go 73.29% <42.85%> (+0.13%) ⬆️
structs.go 80.91% <100.00%> (+0.15%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54f4812...50a2f1b. Read the comment docs.

@kaixinbaba
Copy link
Author

How to fix the 'Codecov Report'?

@nemith
Copy link

nemith commented Jan 13, 2021

It's probably fine, but we need a better way to handle unit testing in this package in general. There are integration tests which may be good for this as well?

@kaixinbaba
Copy link
Author

What should I do next? Waiting? close? Because I want to add more new API of ZK 3.6, your project is well written, clear and easy to read

conn.go Outdated
}


// Synchronously gets all the ephemeral nodes matching `path` created by this session.
Copy link

Choose a reason for hiding this comment

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

This comment needs to match the rest and should also match Go best practices (i.e using complete sentences, starting with the method name). Argument and returns here should be obvious and don't need documentation.

All calls are synchronous in this library so that is also not needed.

https://golang.org/doc/effective_go.html#commentary

Also can you place this method near the rest of the request methods? Maybe around Get?

Copy link
Author

Choose a reason for hiding this comment

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

Sure~I will revise it according to your suggestion

case <-okChan:
case <-time.After(3 * time.Second):
t.Fatal("apparent deadlock!")
}
Copy link

Choose a reason for hiding this comment

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

Why did you remove the test?

Copy link
Author

Choose a reason for hiding this comment

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

At that time, I wrote a unit test for GetEphemerals, which uses the ZK service of direct connection 127.0.0.1. This requires me to start a ZK service locally. However, after the first two commits were submitted, GitHub's default unit test check failed directly. So I tried to remove this unit test and verify whether the automatic check would pass. Obviously, another problem I mentioned above appeared One question (How to fix the 'Codecov Report'?) Maybe I should comment on the test? Because it seems that there is no corresponding test method for other public methods

@kaixinbaba
Copy link
Author

My latest modification has been submitted. Obviously, ZK in version 3.5 can't run unittest, because the API comes from version 3.6.

@nemith
Copy link

nemith commented Jan 19, 2021

We can't land broken tests. We should create a new test file gaurded by build flags. zk3.6 would work and update github actions to add the tag for specific versions.

If you aren't comfortable with that I can code it up real quick and then rebase this on top?

@kaixinbaba
Copy link
Author

Of course, waiting for your good news

@kaixinbaba
Copy link
Author

How's going on

@nemith
Copy link

nemith commented Jan 27, 2021

Sorry I am on a "mini vacation" between jobs right now. No ETA yet.

@kaixinbaba
Copy link
Author

Take it easy. I'm not pushing you

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