Skip to content

Commit 0127efc

Browse files
committed
fix existing unit tests for proto5 and proto6 server
1 parent 3856820 commit 0127efc

File tree

2 files changed

+74
-46
lines changed

2 files changed

+74
-46
lines changed

internal/proto5server/server_getproviderschema_test.go

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ func TestServerGetProviderSchema(t *testing.T) {
107107
},
108108
EphemeralResourceSchemas: map[string]*tfprotov5.Schema{},
109109
Functions: map[string]*tfprotov5.Function{},
110+
ListResourceSchemas: map[string]*tfprotov5.Schema{},
110111
Provider: &tfprotov5.Schema{
111112
Block: &tfprotov5.SchemaBlock{},
112113
},
@@ -163,8 +164,7 @@ func TestServerGetProviderSchema(t *testing.T) {
163164
},
164165
request: &tfprotov5.GetProviderSchemaRequest{},
165166
expectedResponse: &tfprotov5.GetProviderSchemaResponse{
166-
DataSourceSchemas: map[string]*tfprotov5.Schema{},
167-
EphemeralResourceSchemas: map[string]*tfprotov5.Schema{},
167+
DataSourceSchemas: map[string]*tfprotov5.Schema{},
168168
Diagnostics: []*tfprotov5.Diagnostic{
169169
{
170170
Severity: tfprotov5.DiagnosticSeverityError,
@@ -174,7 +174,9 @@ func TestServerGetProviderSchema(t *testing.T) {
174174
"This is always an issue with the provider and should be reported to the provider developers.",
175175
},
176176
},
177-
Functions: map[string]*tfprotov5.Function{},
177+
EphemeralResourceSchemas: map[string]*tfprotov5.Schema{},
178+
Functions: map[string]*tfprotov5.Function{},
179+
ListResourceSchemas: map[string]*tfprotov5.Schema{},
178180
Provider: &tfprotov5.Schema{
179181
Block: &tfprotov5.SchemaBlock{},
180182
},
@@ -206,8 +208,7 @@ func TestServerGetProviderSchema(t *testing.T) {
206208
},
207209
request: &tfprotov5.GetProviderSchemaRequest{},
208210
expectedResponse: &tfprotov5.GetProviderSchemaResponse{
209-
DataSourceSchemas: map[string]*tfprotov5.Schema{},
210-
EphemeralResourceSchemas: map[string]*tfprotov5.Schema{},
211+
DataSourceSchemas: map[string]*tfprotov5.Schema{},
211212
Diagnostics: []*tfprotov5.Diagnostic{
212213
{
213214
Severity: tfprotov5.DiagnosticSeverityError,
@@ -216,7 +217,9 @@ func TestServerGetProviderSchema(t *testing.T) {
216217
"This is always an issue with the provider and should be reported to the provider developers.",
217218
},
218219
},
219-
Functions: map[string]*tfprotov5.Function{},
220+
EphemeralResourceSchemas: map[string]*tfprotov5.Schema{},
221+
Functions: map[string]*tfprotov5.Function{},
222+
ListResourceSchemas: map[string]*tfprotov5.Schema{},
220223
Provider: &tfprotov5.Schema{
221224
Block: &tfprotov5.SchemaBlock{},
222225
},
@@ -298,7 +301,8 @@ func TestServerGetProviderSchema(t *testing.T) {
298301
},
299302
},
300303
},
301-
Functions: map[string]*tfprotov5.Function{},
304+
Functions: map[string]*tfprotov5.Function{},
305+
ListResourceSchemas: map[string]*tfprotov5.Schema{},
302306
Provider: &tfprotov5.Schema{
303307
Block: &tfprotov5.SchemaBlock{},
304308
},
@@ -355,8 +359,7 @@ func TestServerGetProviderSchema(t *testing.T) {
355359
},
356360
request: &tfprotov5.GetProviderSchemaRequest{},
357361
expectedResponse: &tfprotov5.GetProviderSchemaResponse{
358-
DataSourceSchemas: map[string]*tfprotov5.Schema{},
359-
EphemeralResourceSchemas: map[string]*tfprotov5.Schema{},
362+
DataSourceSchemas: map[string]*tfprotov5.Schema{},
360363
Diagnostics: []*tfprotov5.Diagnostic{
361364
{
362365
Severity: tfprotov5.DiagnosticSeverityError,
@@ -366,7 +369,9 @@ func TestServerGetProviderSchema(t *testing.T) {
366369
"This is always an issue with the provider and should be reported to the provider developers.",
367370
},
368371
},
369-
Functions: map[string]*tfprotov5.Function{},
372+
Functions: map[string]*tfprotov5.Function{},
373+
EphemeralResourceSchemas: map[string]*tfprotov5.Schema{},
374+
ListResourceSchemas: map[string]*tfprotov5.Schema{},
370375
Provider: &tfprotov5.Schema{
371376
Block: &tfprotov5.SchemaBlock{},
372377
},
@@ -398,8 +403,7 @@ func TestServerGetProviderSchema(t *testing.T) {
398403
},
399404
request: &tfprotov5.GetProviderSchemaRequest{},
400405
expectedResponse: &tfprotov5.GetProviderSchemaResponse{
401-
DataSourceSchemas: map[string]*tfprotov5.Schema{},
402-
EphemeralResourceSchemas: map[string]*tfprotov5.Schema{},
406+
DataSourceSchemas: map[string]*tfprotov5.Schema{},
403407
Diagnostics: []*tfprotov5.Diagnostic{
404408
{
405409
Severity: tfprotov5.DiagnosticSeverityError,
@@ -408,7 +412,9 @@ func TestServerGetProviderSchema(t *testing.T) {
408412
"This is always an issue with the provider and should be reported to the provider developers.",
409413
},
410414
},
411-
Functions: map[string]*tfprotov5.Function{},
415+
EphemeralResourceSchemas: map[string]*tfprotov5.Schema{},
416+
Functions: map[string]*tfprotov5.Function{},
417+
ListResourceSchemas: map[string]*tfprotov5.Schema{},
412418
Provider: &tfprotov5.Schema{
413419
Block: &tfprotov5.SchemaBlock{},
414420
},
@@ -473,6 +479,7 @@ func TestServerGetProviderSchema(t *testing.T) {
473479
},
474480
},
475481
},
482+
ListResourceSchemas: map[string]*tfprotov5.Schema{},
476483
Provider: &tfprotov5.Schema{
477484
Block: &tfprotov5.SchemaBlock{},
478485
},
@@ -521,8 +528,7 @@ func TestServerGetProviderSchema(t *testing.T) {
521528
},
522529
request: &tfprotov5.GetProviderSchemaRequest{},
523530
expectedResponse: &tfprotov5.GetProviderSchemaResponse{
524-
DataSourceSchemas: map[string]*tfprotov5.Schema{},
525-
EphemeralResourceSchemas: map[string]*tfprotov5.Schema{},
531+
DataSourceSchemas: map[string]*tfprotov5.Schema{},
526532
Diagnostics: []*tfprotov5.Diagnostic{
527533
{
528534
Severity: tfprotov5.DiagnosticSeverityError,
@@ -532,7 +538,9 @@ func TestServerGetProviderSchema(t *testing.T) {
532538
"This is always an issue with the provider and should be reported to the provider developers.",
533539
},
534540
},
535-
Functions: map[string]*tfprotov5.Function{},
541+
EphemeralResourceSchemas: map[string]*tfprotov5.Schema{},
542+
Functions: map[string]*tfprotov5.Function{},
543+
ListResourceSchemas: map[string]*tfprotov5.Schema{},
536544
Provider: &tfprotov5.Schema{
537545
Block: &tfprotov5.SchemaBlock{},
538546
},
@@ -564,8 +572,7 @@ func TestServerGetProviderSchema(t *testing.T) {
564572
},
565573
request: &tfprotov5.GetProviderSchemaRequest{},
566574
expectedResponse: &tfprotov5.GetProviderSchemaResponse{
567-
DataSourceSchemas: map[string]*tfprotov5.Schema{},
568-
EphemeralResourceSchemas: map[string]*tfprotov5.Schema{},
575+
DataSourceSchemas: map[string]*tfprotov5.Schema{},
569576
Diagnostics: []*tfprotov5.Diagnostic{
570577
{
571578
Severity: tfprotov5.DiagnosticSeverityError,
@@ -574,7 +581,9 @@ func TestServerGetProviderSchema(t *testing.T) {
574581
"This is always an issue with the provider and should be reported to the provider developers.",
575582
},
576583
},
577-
Functions: map[string]*tfprotov5.Function{},
584+
EphemeralResourceSchemas: map[string]*tfprotov5.Schema{},
585+
Functions: map[string]*tfprotov5.Function{},
586+
ListResourceSchemas: map[string]*tfprotov5.Schema{},
578587
Provider: &tfprotov5.Schema{
579588
Block: &tfprotov5.SchemaBlock{},
580589
},
@@ -607,6 +616,7 @@ func TestServerGetProviderSchema(t *testing.T) {
607616
DataSourceSchemas: map[string]*tfprotov5.Schema{},
608617
EphemeralResourceSchemas: map[string]*tfprotov5.Schema{},
609618
Functions: map[string]*tfprotov5.Function{},
619+
ListResourceSchemas: map[string]*tfprotov5.Schema{},
610620
Provider: &tfprotov5.Schema{
611621
Block: &tfprotov5.SchemaBlock{
612622
Attributes: []*tfprotov5.SchemaAttribute{
@@ -648,6 +658,7 @@ func TestServerGetProviderSchema(t *testing.T) {
648658
DataSourceSchemas: map[string]*tfprotov5.Schema{},
649659
EphemeralResourceSchemas: map[string]*tfprotov5.Schema{},
650660
Functions: map[string]*tfprotov5.Function{},
661+
ListResourceSchemas: map[string]*tfprotov5.Schema{},
651662
Provider: &tfprotov5.Schema{
652663
Block: &tfprotov5.SchemaBlock{},
653664
},
@@ -718,6 +729,7 @@ func TestServerGetProviderSchema(t *testing.T) {
718729
DataSourceSchemas: map[string]*tfprotov5.Schema{},
719730
EphemeralResourceSchemas: map[string]*tfprotov5.Schema{},
720731
Functions: map[string]*tfprotov5.Function{},
732+
ListResourceSchemas: map[string]*tfprotov5.Schema{},
721733
Provider: &tfprotov5.Schema{
722734
Block: &tfprotov5.SchemaBlock{},
723735
},
@@ -797,8 +809,7 @@ func TestServerGetProviderSchema(t *testing.T) {
797809
},
798810
request: &tfprotov5.GetProviderSchemaRequest{},
799811
expectedResponse: &tfprotov5.GetProviderSchemaResponse{
800-
DataSourceSchemas: map[string]*tfprotov5.Schema{},
801-
EphemeralResourceSchemas: map[string]*tfprotov5.Schema{},
812+
DataSourceSchemas: map[string]*tfprotov5.Schema{},
802813
Diagnostics: []*tfprotov5.Diagnostic{
803814
{
804815
Severity: tfprotov5.DiagnosticSeverityError,
@@ -808,7 +819,9 @@ func TestServerGetProviderSchema(t *testing.T) {
808819
"This is always an issue with the provider and should be reported to the provider developers.",
809820
},
810821
},
811-
Functions: map[string]*tfprotov5.Function{},
822+
EphemeralResourceSchemas: map[string]*tfprotov5.Schema{},
823+
Functions: map[string]*tfprotov5.Function{},
824+
ListResourceSchemas: map[string]*tfprotov5.Schema{},
812825
Provider: &tfprotov5.Schema{
813826
Block: &tfprotov5.SchemaBlock{},
814827
},
@@ -840,8 +853,7 @@ func TestServerGetProviderSchema(t *testing.T) {
840853
},
841854
request: &tfprotov5.GetProviderSchemaRequest{},
842855
expectedResponse: &tfprotov5.GetProviderSchemaResponse{
843-
DataSourceSchemas: map[string]*tfprotov5.Schema{},
844-
EphemeralResourceSchemas: map[string]*tfprotov5.Schema{},
856+
DataSourceSchemas: map[string]*tfprotov5.Schema{},
845857
Diagnostics: []*tfprotov5.Diagnostic{
846858
{
847859
Severity: tfprotov5.DiagnosticSeverityError,
@@ -850,7 +862,9 @@ func TestServerGetProviderSchema(t *testing.T) {
850862
"This is always an issue with the provider and should be reported to the provider developers.",
851863
},
852864
},
853-
Functions: map[string]*tfprotov5.Function{},
865+
EphemeralResourceSchemas: map[string]*tfprotov5.Schema{},
866+
Functions: map[string]*tfprotov5.Function{},
867+
ListResourceSchemas: map[string]*tfprotov5.Schema{},
854868
Provider: &tfprotov5.Schema{
855869
Block: &tfprotov5.SchemaBlock{},
856870
},

0 commit comments

Comments
 (0)