Skip to content

Commit

Permalink
test: update plugins test
Browse files Browse the repository at this point in the history
  • Loading branch information
scortier committed Apr 7, 2022
1 parent 853b1e2 commit 88b9ddd
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/plugin_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main
- fix-plugin-tests
pull_request:
workflow_dispatch:

jobs:
Expand Down
2 changes: 2 additions & 0 deletions plugins/extractors/cassandra/cassandra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ func getExpected() []models.Record {
Resource: &commonv1beta1.Resource{
Urn: keyspace + ".applicant",
Name: "applicant",
Type: "table",
},
Schema: &facetsv1beta1.Columns{
Columns: []*facetsv1beta1.Column{
Expand All @@ -209,6 +210,7 @@ func getExpected() []models.Record {
Resource: &commonv1beta1.Resource{
Urn: keyspace + ".jobs",
Name: "jobs",
Type: "table",
},
Schema: &facetsv1beta1.Columns{
Columns: []*facetsv1beta1.Column{
Expand Down
2 changes: 2 additions & 0 deletions plugins/extractors/clickhouse/clickhouse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ func getExpected() []models.Record {
Resource: &commonv1beta1.Resource{
Urn: "mockdata_meteor_metadata_test.applicant",
Name: "applicant",
Type: "table",
},
Schema: &facetsv1beta1.Columns{
Columns: []*facetsv1beta1.Column{
Expand All @@ -148,6 +149,7 @@ func getExpected() []models.Record {
Resource: &commonv1beta1.Resource{
Urn: "mockdata_meteor_metadata_test.jobs",
Name: "jobs",
Type: "table",
},
Schema: &facetsv1beta1.Columns{
Columns: []*facetsv1beta1.Column{
Expand Down
3 changes: 3 additions & 0 deletions plugins/extractors/csv/csv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func TestExtract(t *testing.T) {
Urn: "test.csv",
Name: "test.csv",
Service: "csv",
Type: "table",
},
Schema: &facetsv1beta1.Columns{
Columns: []*facetsv1beta1.Column{
Expand Down Expand Up @@ -84,6 +85,7 @@ func TestExtract(t *testing.T) {
Urn: "test-2.csv",
Name: "test-2.csv",
Service: "csv",
Type: "table",
},
Schema: &facetsv1beta1.Columns{
Columns: []*facetsv1beta1.Column{
Expand All @@ -98,6 +100,7 @@ func TestExtract(t *testing.T) {
Urn: "test.csv",
Name: "test.csv",
Service: "csv",
Type: "table",
},
Schema: &facetsv1beta1.Columns{
Columns: []*facetsv1beta1.Column{
Expand Down
2 changes: 2 additions & 0 deletions plugins/extractors/elastic/elastic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ func getExpectedVal() []models.Record {
Resource: &commonv1beta1.Resource{
Urn: "elasticsearch.index1",
Name: "index1",
Type: "table",
},
Schema: &facetsv1beta1.Columns{
Columns: []*facetsv1beta1.Column{
Expand All @@ -216,6 +217,7 @@ func getExpectedVal() []models.Record {
Resource: &commonv1beta1.Resource{
Urn: "elasticsearch.index2",
Name: "index2",
Type: "table",
},
Schema: &facetsv1beta1.Columns{
Columns: []*facetsv1beta1.Column{
Expand Down
2 changes: 2 additions & 0 deletions plugins/extractors/grafana/grafana_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func TestExtract(t *testing.T) {
Service: "grafana",
Url: fmt.Sprintf("%s/d/HzK8qNW7z/new-dashboard-copy", testServer.URL),
Description: "",
Type: "dashboard",
},
Charts: []*assetsv1beta1.Chart{
{
Expand All @@ -88,6 +89,7 @@ func TestExtract(t *testing.T) {
Service: "grafana",
Url: fmt.Sprintf("%s/d/5WsKOvW7z/test-dashboard-updated", testServer.URL),
Description: "this is description for testing",
Type: "dashboard",
},
Charts: []*assetsv1beta1.Chart{
{
Expand Down
3 changes: 3 additions & 0 deletions plugins/extractors/kafka/kafka_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ func TestExtract(t *testing.T) {
Urn: "kafka::my-kafka-cluster/meteor-test-topic-1",
Name: "meteor-test-topic-1",
Service: "kafka",
Type: "topic",
},
Profile: &assetsv1beta1.TopicProfile{
NumberOfPartitions: 1,
Expand All @@ -139,6 +140,7 @@ func TestExtract(t *testing.T) {
Urn: "kafka::my-kafka-cluster/meteor-test-topic-2",
Name: "meteor-test-topic-2",
Service: "kafka",
Type: "topic",
},
Profile: &assetsv1beta1.TopicProfile{
NumberOfPartitions: 1,
Expand All @@ -149,6 +151,7 @@ func TestExtract(t *testing.T) {
Urn: "kafka::my-kafka-cluster/meteor-test-topic-3",
Name: "meteor-test-topic-3",
Service: "kafka",
Type: "topic",
},
Profile: &assetsv1beta1.TopicProfile{
NumberOfPartitions: 1,
Expand Down
1 change: 1 addition & 0 deletions plugins/extractors/metabase/testdata/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"urn": "metabase::https://my-metabase.com/dashboard/1",
"name": "Main",
"service": "metabase",
"type": "dashboard",
"description": "HELPFUL DESCRIPTION"
},
"properties": {
Expand Down
3 changes: 3 additions & 0 deletions plugins/extractors/mongodb/mongodb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ func getExpected() []models.Record {
Resource: &commonv1beta1.Resource{
Urn: testDB + ".connections",
Name: "connections",
Type: "table",
},
Profile: &assetsv1beta1.TableProfile{
TotalRows: 3,
Expand All @@ -174,6 +175,7 @@ func getExpected() []models.Record {
Resource: &commonv1beta1.Resource{
Urn: testDB + ".posts",
Name: "posts",
Type: "table",
},
Profile: &assetsv1beta1.TableProfile{
TotalRows: 2,
Expand All @@ -183,6 +185,7 @@ func getExpected() []models.Record {
Resource: &commonv1beta1.Resource{
Urn: testDB + ".stats",
Name: "stats",
Type: "table",
},
Profile: &assetsv1beta1.TableProfile{
TotalRows: 1,
Expand Down
2 changes: 2 additions & 0 deletions plugins/extractors/mssql/mssql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ func getExpected() []models.Record {
Resource: &commonv1beta1.Resource{
Urn: "mockdata_meteor_metadata_test.applicant",
Name: "applicant",
Type: "table",
},
Schema: &facetsv1beta1.Columns{
Columns: []*facetsv1beta1.Column{
Expand Down Expand Up @@ -176,6 +177,7 @@ func getExpected() []models.Record {
Resource: &commonv1beta1.Resource{
Urn: "mockdata_meteor_metadata_test.jobs",
Name: "jobs",
Type: "table",
},
Schema: &facetsv1beta1.Columns{
Columns: []*facetsv1beta1.Column{
Expand Down
2 changes: 2 additions & 0 deletions plugins/extractors/mysql/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ func getExpected() []models.Record {
Resource: &commonv1beta1.Resource{
Urn: "mockdata_meteor_metadata_test.applicant",
Name: "applicant",
Type: "table",
},
Schema: &facetsv1beta1.Columns{
Columns: []*facetsv1beta1.Column{
Expand Down Expand Up @@ -185,6 +186,7 @@ func getExpected() []models.Record {
Resource: &commonv1beta1.Resource{
Urn: "mockdata_meteor_metadata_test.jobs",
Name: "jobs",
Type: "table",
},
Schema: &facetsv1beta1.Columns{
Columns: []*facetsv1beta1.Column{
Expand Down
2 changes: 2 additions & 0 deletions plugins/extractors/optimus/testdata/expected.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[{
"resource": {
"urn": "optimus::optimus:80/project-A.namespace-A.job-A",
"type": "job",
"name": "job-A",
"service": "optimus",
"description": "sample description for job-A"
Expand Down Expand Up @@ -52,6 +53,7 @@
"urn": "optimus::optimus:80/project-A.namespace-A.job-B",
"name": "job-B",
"service": "optimus",
"type": "job",
"description": "sample description for job-B"
},
"ownership": {
Expand Down
2 changes: 2 additions & 0 deletions plugins/extractors/oracle/oracle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ func getExpected() []models.Record {
Urn: "XE.EMPLOYEE",
Name: "EMPLOYEE",
Service: "Oracle",
Type: "table",
},
Profile: &assetsv1beta1.TableProfile{
TotalRows: 3,
Expand Down Expand Up @@ -190,6 +191,7 @@ func getExpected() []models.Record {
Urn: "XE.DEPARTMENT",
Name: "DEPARTMENT",
Service: "Oracle",
Type: "table",
},
Profile: &assetsv1beta1.TableProfile{
TotalRows: 4,
Expand Down
7 changes: 5 additions & 2 deletions plugins/extractors/tableau/testdata/dashboards_proto.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"resource": {
"urn": "tableau::https://server.tableau.com/workbook/d74564cf-931c-2df2-fd8f-8b974fbc0b14",
"name": "Regional",
"service": "tableau"
"service": "tableau",
"type": "dashboard"
},
"charts": [
{
Expand Down Expand Up @@ -275,6 +276,7 @@
"urn": "tableau::https://server.tableau.com/workbook/e1f0aab7-e3ff-8727-8461-4d4294e220f0",
"name": "Superstore",
"service": "tableau",
"type": "dashboard",
"description": "A sample superstore"
},
"charts": [
Expand Down Expand Up @@ -751,7 +753,8 @@
"resource": {
"urn": "tableau::https://server.tableau.com/workbook/d7db01c0-b311-6f47-31bf-ad1c42e67629",
"name": "InMail Engagement",
"service": "tableau"
"service": "tableau",
"type": "dashboard"
},
"charts": [
{
Expand Down

0 comments on commit 88b9ddd

Please sign in to comment.