Skip to content

Commit

Permalink
Merge pull request #252 from authzed/flesh-out-tests
Browse files Browse the repository at this point in the history
Flesh out client tests
  • Loading branch information
tstirrat15 authored Oct 23, 2024
2 parents 3014bbf + 8af9101 commit d740bc0
Show file tree
Hide file tree
Showing 5 changed files with 420 additions and 29 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/build.yaml

This file was deleted.

5 changes: 5 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
- "main"
pull_request:
branches: ["*"]
# NOTE: this is required for checks to be run in the
# merge queue.
merge_group:
types:
- "checks_requested"
jobs:
tests:
name: "Unit and Integration Tests"
Expand Down
9 changes: 9 additions & 0 deletions v1/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ import (
//
// Clients are backed by a gRPC client and as such are thread-safe.
type Client struct {
// Provide a handle on the underlying connection to enable cleanup
// behaviors (among others)
conn *grpc.ClientConn
v1.SchemaServiceClient
v1.PermissionsServiceClient
v1.WatchServiceClient
}

func (c *Client) Close() error {
return c.conn.Close()
}

// ClientWithExperimental represents and open connection to Authzed with
// experimental services available.
//
Expand All @@ -34,6 +41,7 @@ func NewClient(endpoint string, opts ...grpc.DialOption) (*Client, error) {
}

return &Client{
conn,
v1.NewSchemaServiceClient(conn),
v1.NewPermissionsServiceClient(conn),
v1.NewWatchServiceClient(conn),
Expand All @@ -50,6 +58,7 @@ func NewClientWithExperimentalAPIs(endpoint string, opts ...grpc.DialOption) (*C

return &ClientWithExperimental{
Client{
conn,
v1.NewSchemaServiceClient(conn),
v1.NewPermissionsServiceClient(conn),
v1.NewWatchServiceClient(conn),
Expand Down
Loading

0 comments on commit d740bc0

Please sign in to comment.