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

e2e: add gRPC gateway Lease tests #9460

Merged
merged 1 commit into from
Mar 22, 2018

Conversation

hexfusion
Copy link
Contributor

@hexfusion hexfusion commented Mar 19, 2018

With a focus on Lease this is my initial stab at refactoring e2e grpc gateway tests. Next phase will be breaking out existing curl tests into separate files and providing full TLS coverage in prep for stable v3/.

ref: #9189, #9450

@hexfusion hexfusion force-pushed the e2e_watch_tests branch 3 times, most recently from 2c50ae3 to f400153 Compare March 19, 2018 13:32
@hexfusion
Copy link
Contributor Author

@gyuho PTAL re approach, thanks.

@hexfusion hexfusion changed the title e2e: refactor of grpc-gateway tests. e2e: add gRPC gateway Lease tests Mar 20, 2018
@hexfusion
Copy link
Contributor Author

semaphore failure seems unrelated

Broadcast message from root@semaphore-1802
	(unknown) at 2:16 ...
The system is going down for power off NOW!

If someone could restart test, thanks.

@hexfusion
Copy link
Contributor Author

hmm, maybe timeout is from the additional tests? Do we need to extend?

value: gwKVPutLease(cx, "foo", "bar", leaseID),
expected: `"revision":"`,
},
{
Copy link
Contributor

Choose a reason for hiding this comment

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

duplicate timetolive call

Copy link
Contributor Author

Choose a reason for hiding this comment

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

gwLeaseTTLWithKeys covers bases, thanks.

return s
}

func gwLeaseNoID(cx ctlCtx, ttl int64) string {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just combine as func gwLeaseGrant(cx ctlCtx, leaseID int64, ttl int64) string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

makes sense

pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
)

func TestV3CurlLeaseGrantNoTLS(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We already have a ton of TLS coverage, and now tests are taking too long.
Just keep the one with no TLS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK sounds good I misunderstood that you wanted to have all of these.

value: gwLeaseWithID(cx, leaseID),
expected: gwLeaseIDExpected(leaseID),
},
{
Copy link
Contributor

Choose a reason for hiding this comment

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

remove put and range.
e2e only needs to test lease API output

Copy link
Contributor Author

Choose a reason for hiding this comment

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

understood, thanks.

}
}

func testV3CurlLeaseTTL(cx ctlCtx) {
Copy link
Contributor

Choose a reason for hiding this comment

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

remove timetolive and move them to testV3CurlLeaseGrant

Copy link
Contributor Author

@hexfusion hexfusion left a comment

Choose a reason for hiding this comment

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

Thank you for comments @gyuho, rebasing shortly.

pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
)

func TestV3CurlLeaseGrantNoTLS(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK sounds good I misunderstood that you wanted to have all of these.

return s
}

func gwLeaseNoID(cx ctlCtx, ttl int64) string {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

makes sense

value: gwKVPutLease(cx, "foo", "bar", leaseID),
expected: `"revision":"`,
},
{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

gwLeaseTTLWithKeys covers bases, thanks.

value: gwLeaseWithID(cx, leaseID),
expected: gwLeaseIDExpected(leaseID),
},
{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

understood, thanks.

@codecov-io
Copy link

codecov-io commented Mar 21, 2018

Codecov Report

Merging #9460 into master will decrease coverage by 0.3%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9460      +/-   ##
==========================================
- Coverage   72.96%   72.65%   -0.31%     
==========================================
  Files         364      364              
  Lines       30883    30890       +7     
==========================================
- Hits        22533    22443      -90     
- Misses       6749     6829      +80     
- Partials     1601     1618      +17
Impacted Files Coverage Δ
clientv3/integration/util.go 66.66% <0%> (-33.34%) ⬇️
pkg/transport/timeout_conn.go 80% <0%> (-20%) ⬇️
proxy/grpcproxy/register.go 72.22% <0%> (-11.12%) ⬇️
etcdserver/api/v3rpc/lease.go 78.37% <0%> (-8.11%) ⬇️
pkg/fileutil/purge.go 73.68% <0%> (-7.9%) ⬇️
pkg/tlsutil/tlsutil.go 86.2% <0%> (-6.9%) ⬇️
clientv3/namespace/watch.go 72.72% <0%> (-6.07%) ⬇️
etcdctl/ctlv3/command/lease_command.go 65.34% <0%> (-5.95%) ⬇️
clientv3/yaml/config.go 81.25% <0%> (-5.42%) ⬇️
proxy/grpcproxy/watcher.go 89.79% <0%> (-4.09%) ⬇️
... and 27 more

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 f7714e2...8dab18a. Read the comment docs.

@hexfusion
Copy link
Contributor Author

hexfusion commented Mar 21, 2018

@gyuho knits should be all addressed, PTAL.


type v3cURLTest struct {
endpoint string
value interface{}
Copy link
Contributor

Choose a reason for hiding this comment

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

value should string type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gyuho yeah, because of the changing data types I am passing for example pb.LeaseTimeToLiveRequest then pb.LeaseKeepAliveRequest etc I found interface{} useful this generic typing. But perhaps that data flexibility is an issue in itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me revist this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gyuho you were right I simplified this so that it can handle a string. This is now resolved, thanks!

Copy link
Contributor

@gyuho gyuho left a comment

Choose a reason for hiding this comment

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

thanks!

@hexfusion
Copy link
Contributor Author

@gyuho looks like semaphore did not get included here in checks, is that expected?

@gyuho
Copy link
Contributor

gyuho commented Mar 22, 2018

@hexfusion Should be safe to merge. Previous run passed.

@hexfusion hexfusion merged commit 31de834 into etcd-io:master Mar 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants