Skip to content

Conversation

@gchiesa
Copy link
Contributor

@gchiesa gchiesa commented Apr 16, 2024

🎯 What

Provide a concise description of the changes:

  • ❓ What changes have you made? (High-level overview)
    Implemented support for multiple TestCase analyzing the plan with JsonPath queryes

  • πŸŽ‰ What does it mean to the user? (In plain English)

User can run some tests with the following model:

//[...]
tc := []scenario.JsonPathTestCases{
		{
			TestName:           "isIRSA",
			JsonPathToCompare:  "{$.planned_values.outputs.is_irsa.value}",
			ExpectedValue:      false,
			TestType:           scenario.ShouldBeEqual,
			AllowDifferentType: false,
		},
		{
			TestName:           "isPodIdentity",
			JsonPathToCompare:  "{$.planned_values.outputs.is_pod_identity.value}",
			ExpectedValue:      true,
			TestType:           scenario.ShouldBeEqual,
			AllowDifferentType: false,
		},
}
s.Stg.PlanAndAssertJsonWithJsonPath(t, s.GetTerraformOptions(), tc)

@gchiesa gchiesa requested a review from Excoriate as a code owner April 16, 2024 10:06
Copy link
Owner

@Excoriate Excoriate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for this nice contribution. It's indeed a great addition to the library! I left small comments for your revision.

@Excoriate Excoriate self-assigned this Apr 16, 2024
@Excoriate Excoriate added the feature New functionality πŸš€. label Apr 16, 2024
@Excoriate Excoriate merged commit cb46401 into Excoriate:main Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New functionality πŸš€.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants