Skip to content

Commit 700c0aa

Browse files
test: increase test coverage for provider plugins (#204)
* chore: increase max call send&receive message size * feat: initialize no_op provider * chore: add get roles,get account type,grant and revoke access * fix: fix permission validation * chore: add no_op to server * chore: add tests for bigquery resource and provider * chore: add tests for metabase resource file * chore: add tests for grafana provider and resource * chore: add tests for BQ provider * chore: add tests for metabase provider * test: add tests for providers * test: fix unused method * test: improved tableau provider tests * test: added tests for gcloud config and provider files * fix: added the BQ client interface, fixed metabase client struct also added tests for client * Test: Added interface for BQ Client, also tests for BigQuery provider and config files * test: added tests for grafana, metabase,tableau clients * test(grafana): fix test for grafana client * test(metabase): fix test for metabase client * test(tableau): fix test for tableau client * test(tableau):add tests for client * test(tableau):add tests for client * test: add tests for bq, gcloud provider files, and tests for metabase, tableau and grafana clients * test: fix metabase test * test(metabase):add client tests * test(metabase):add client tests * test(metabase):fix client tests * test: apply suggestions from code review Co-authored-by: Rahmat Hidayat <[email protected]> * test: apply suggestions from code review Co-authored-by: Rahmat Hidayat <[email protected]> * test(metabase):add provider,client test * test(bigquery):apply suggestions from code review Co-authored-by: Rahmat Hidayat <[email protected]> * test(metabase): apply code changes from suggestions * test(metabase): apply suggestions from code review * test: apply suggestions from code review Co-authored-by: Rahmat Hidayat <[email protected]>
1 parent 5193a45 commit 700c0aa

20 files changed

+7422
-252
lines changed

Diff for: mocks/BigQueryClient.go

+340
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: plugins/providers/bigquery/bigquery.go

+10
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ import (
1111
"google.golang.org/api/option"
1212
)
1313

14+
//go:generate mockery --name=BigQueryClient --exported --with-expecter
15+
type BigQueryClient interface {
16+
GetDatasets(context.Context) ([]*Dataset, error)
17+
GetTables(ctx context.Context, datasetID string) ([]*Table, error)
18+
GrantDatasetAccess(ctx context.Context, d *Dataset, user, role string) error
19+
RevokeDatasetAccess(ctx context.Context, d *Dataset, user, role string) error
20+
GrantTableAccess(ctx context.Context, t *Table, accountType, accountID, role string) error
21+
RevokeTableAccess(ctx context.Context, t *Table, accountType, accountID, role string) error
22+
ResolveDatasetRole(role string) (bq.AccessRole, error)
23+
}
1424
type bigQueryClient struct {
1525
projectID string
1626
client *bq.Client

0 commit comments

Comments
 (0)