Skip to content

Commit 54f99ee

Browse files
brianhyderYour_First_Name Your_Last_Name
andauthored
Fix for broken integration test (#51)
This merge requests modifies the existing tests to match existing test data in the test instance of Cortex that is used for the integration tests. - [x] Integration tests pass - [x] Example works --------- Co-authored-by: Your_First_Name Your_Last_Name <[email protected]>
1 parent 8ce3edf commit 54f99ee

File tree

3 files changed

+4
-23
lines changed

3 files changed

+4
-23
lines changed

examples/resources/catalog_entity_openapi/resource.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ terraform {
77
}
88

99
provider "cortex" {
10-
token = "access-token-here"
10+
token = "access-token-here" # or set CORTEX_API_TOKEN env var
1111
}
1212

1313
resource "cortex_catalog_entity_openapi" "test_service_oas1" {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ go 1.24.1
44

55
require (
66
github.com/dghubble/sling v1.4.1
7+
github.com/google/go-cmp v0.5.9
78
github.com/hashicorp/terraform-plugin-docs v0.16.0
89
github.com/hashicorp/terraform-plugin-framework v1.4.1
910
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0
@@ -29,7 +30,6 @@ require (
2930
github.com/davecgh/go-spew v1.1.1 // indirect
3031
github.com/fatih/color v1.15.0 // indirect
3132
github.com/golang/protobuf v1.5.3 // indirect
32-
github.com/google/go-cmp v0.5.9 // indirect
3333
github.com/google/go-querystring v1.1.0 // indirect
3434
github.com/google/uuid v1.3.0 // indirect
3535
github.com/hashicorp/errwrap v1.1.0 // indirect

internal/provider/catalog_entity_openapi_resource_test.go

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,9 @@ import (
99

1010
func TestAccCatalogEntityOpenAPIResource(t *testing.T) {
1111
entityTag := "test-service"
12-
spec := `openapi: 3.0.0
13-
info:
14-
title: Test API
15-
version: 1.0.0
16-
paths:
17-
/test:
18-
get:
19-
responses:
20-
'200':
21-
description: OK`
22-
23-
updatedSpec := `openapi: 3.0.0
24-
info:
25-
title: Updated Test API
26-
version: 1.0.1
27-
paths:
28-
/test:
29-
get:
30-
responses:
31-
'200':
32-
description: OK`
12+
spec := `{"info":{"title":"Test API","version":"1.0.0"},"paths":{"/test":{"get":{"responses":{"200":{"description":"OK"}}}}},"openapi":"3.0.0","servers":[{"url":"/"}]}`
3313

14+
updatedSpec := `{"info":{"title":"UpdatedTest API","version":"1.0.1"},"paths":{"/test":{"get":{"responses":{"200":{"description":"OK"}}}}},"openapi":"3.0.0","servers":[{"url":"/"}]}`
3415
resource.Test(t, resource.TestCase{
3516
PreCheck: func() { testAccPreCheck(t) },
3617
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,

0 commit comments

Comments
 (0)