Skip to content

Commit

Permalink
chore: add test for overlapping resource name in augemented logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Maed223 committed Dec 20, 2023
1 parent ccafc08 commit 1fc205a
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions packages/@cdktf/cli-core/src/test/lib/execution-logs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,62 @@ describe("enhanceLogs", () => {
`"This is a message where some_thing.different (ThisConstruct) is used"`
);
});
it("properly matches to the resource when names overlap", () => {
expect(
createEnhanceLogMessage({
name: "demo",
content: JSON.stringify({
"//": {
metadata: {
backend: "local",
stackName: "demo",
version: "0.0.0",
},
outputs: {},
},
provider: {
null: [{}],
},
resource: {
null_resource: {
null_resource: {
"//": {
metadata: {
path: "demo/null_resource",
uniqueId: "null_resource",
},
},
},
null_resource2: {
"//": {
metadata: {
path: "demo/null_resource2",
uniqueId: "null_resource2",
},
},
},
},
},
terraform: {
backend: {
local: {
path: "path",
},
},
required_providers: {
null: {
source: "hashicorp/null",
version: "3.2.2",
},
},
},
}),
} as SynthesizedStack)(
"This is a message where null_resource.null_resource is used \n This is a message where null_resource.null_resource2 is used"
)
).toMatchInlineSnapshot(`
"This is a message where null_resource.null_resource (null_resource) is used
This is a message where null_resource.null_resource2 (null_resource2) is used"
`);
});
});

0 comments on commit 1fc205a

Please sign in to comment.