Skip to content

Commit

Permalink
Fix RPCContext related test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanck committed Sep 28, 2023
1 parent b100516 commit 060b88e
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions internal/terraform/module/module_ops_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1143,15 +1143,15 @@ func TestSchemaModuleValidation_FullModule(t *testing.T) {
}

fs := filesystem.NewFilesystem(ss.DocumentStore)
err = ParseModuleConfiguration(ctx, fs, ss.Modules, modPath)
if err != nil {
t.Fatal(err)
}
ctx = lsctx.WithRPCContext(ctx, lsctx.RPCContextData{
Method: "textDocument/didOpen",
URI: "file:///test/variables.tf",
})
ctx = lsctx.WithLanguageId(ctx, ilsp.Terraform.String())
err = ParseModuleConfiguration(ctx, fs, ss.Modules, modPath)
if err != nil {
t.Fatal(err)
}
err = SchemaModuleValidation(ctx, ss.Modules, ss.ProviderSchemas, modPath)
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -1188,15 +1188,15 @@ func TestSchemaModuleValidation_SingleFile(t *testing.T) {
}

fs := filesystem.NewFilesystem(ss.DocumentStore)
err = ParseModuleConfiguration(ctx, fs, ss.Modules, modPath)
if err != nil {
t.Fatal(err)
}
ctx = lsctx.WithRPCContext(ctx, lsctx.RPCContextData{
Method: "textDocument/didChange",
URI: "file:///test/variables.tf",
})
ctx = lsctx.WithLanguageId(ctx, ilsp.Terraform.String())
err = ParseModuleConfiguration(ctx, fs, ss.Modules, modPath)
if err != nil {
t.Fatal(err)
}
err = SchemaModuleValidation(ctx, ss.Modules, ss.ProviderSchemas, modPath)
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -1233,6 +1233,11 @@ func TestSchemaVarsValidation_FullModule(t *testing.T) {
}

fs := filesystem.NewFilesystem(ss.DocumentStore)
ctx = lsctx.WithRPCContext(ctx, lsctx.RPCContextData{
Method: "textDocument/didOpen",
URI: "file:///test/terraform.tfvars",
})
ctx = lsctx.WithLanguageId(ctx, ilsp.Tfvars.String())
err = ParseModuleConfiguration(ctx, fs, ss.Modules, modPath)
if err != nil {
t.Fatal(err)
Expand All @@ -1245,11 +1250,6 @@ func TestSchemaVarsValidation_FullModule(t *testing.T) {
if err != nil {
t.Fatal(err)
}
ctx = lsctx.WithRPCContext(ctx, lsctx.RPCContextData{
Method: "textDocument/didOpen",
URI: "file:///test/terraform.tfvars",
})
ctx = lsctx.WithLanguageId(ctx, ilsp.Tfvars.String())
err = SchemaVariablesValidation(ctx, ss.Modules, ss.ProviderSchemas, modPath)
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -1286,6 +1286,11 @@ func TestSchemaVarsValidation_SingleFile(t *testing.T) {
}

fs := filesystem.NewFilesystem(ss.DocumentStore)
ctx = lsctx.WithRPCContext(ctx, lsctx.RPCContextData{
Method: "textDocument/didChange",
URI: "file:///test/terraform.tfvars",
})
ctx = lsctx.WithLanguageId(ctx, ilsp.Tfvars.String())
err = ParseModuleConfiguration(ctx, fs, ss.Modules, modPath)
if err != nil {
t.Fatal(err)
Expand All @@ -1298,11 +1303,6 @@ func TestSchemaVarsValidation_SingleFile(t *testing.T) {
if err != nil {
t.Fatal(err)
}
ctx = lsctx.WithRPCContext(ctx, lsctx.RPCContextData{
Method: "textDocument/didChange",
URI: "file:///test/terraform.tfvars",
})
ctx = lsctx.WithLanguageId(ctx, ilsp.Tfvars.String())
err = SchemaVariablesValidation(ctx, ss.Modules, ss.ProviderSchemas, modPath)
if err != nil {
t.Fatal(err)
Expand Down

0 comments on commit 060b88e

Please sign in to comment.