Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Show all test failures for tests that cover multiple resources #170

Closed
GJKrupa opened this issue Oct 29, 2019 · 12 comments
Closed
Labels
accepted Feature Request has been accepted and will be incorporated soon. enhancement waiting for confirmation Workaround/Fix applied, waiting for confirmation

Comments

@GJKrupa
Copy link

GJKrupa commented Oct 29, 2019

Feature Request

Feature description :
When running scenarios against multiple resources (e.g. the example provided to test that all tag-able resources have tags), include the ability to show results for all failed resources, not just the first one encountered.

Suggested Solution description ( if you have any ) :
Possibly a command-line flag or an option in the feature/scenario to not stop on first failure

Describe alternatives you've considered :
N/A

Additional context :
We're trying to scan for AWS resources that don't have a standard set of billing tags attached but it's time-consuming to re-run the plan and the features after each individually-fixed resource to find the next failure.

@eerkunt
Copy link
Member

eerkunt commented Oct 29, 2019

Thanks for the feature request @GJKrupa 🎉

terraform-compliance never intended to be a linting tool that will visualise all the problems at once within the plan or state. Also, it will require quite a bit refactoring nearly all the steps that exist.

It looks like this is a common feature request for many people since we already rejected 2 of them that is similar to this.

I will have a deeper look about how we can re-structure the whole code to enable this kind of a feature and will update you in this Issue.

@eerkunt eerkunt changed the title Show all test failures for tests that cover multiple resources Feature Request: Show all test failures for tests that cover multiple resources Nov 8, 2019
@eerkunt eerkunt added the accepted Feature Request has been accepted and will be incorporated soon. label Nov 21, 2019
@eerkunt
Copy link
Member

eerkunt commented Feb 1, 2020

Hi @GJKrupa,
Can you please have a try with the new release ? 🎉

@eerkunt eerkunt added the waiting for confirmation Workaround/Fix applied, waiting for confirmation label Feb 1, 2020
@GJKrupa
Copy link
Author

GJKrupa commented Feb 3, 2020

Hi. Unfortunately I'm not able to test version 1.1.3 as I'm getting the following error:

ERROR: Failed to convert terraform plan file to JSON format via terraform. Here is the error :
None
Failed to marshal plan to json: error marshaling prior state: unsupported attribute "placement_group_id"

@eerkunt
Copy link
Member

eerkunt commented Feb 3, 2020

Hi @GJKrupa,

This is new, and and it is coming directly from terraform.

Is it possible to run terraform show -json <your plan file> ?

@GJKrupa
Copy link
Author

GJKrupa commented Feb 3, 2020

I'm getting the same error from that command. Looks like there's something out of sync with our state file. Will get back to you once I figure out what's wrong (hashicorp/terraform#23297 seems to be related)

@GJKrupa
Copy link
Author

GJKrupa commented Feb 11, 2020

I've managed to run the tool against our repo now (there were a few glitches to work out) and it's working like a dream. I'm seeing the full list of resources that are missing specific tags rather than just the first one. Thanks very much.

@eerkunt
Copy link
Member

eerkunt commented Feb 11, 2020

Great news!

I am curious about the glitches.

I found one already that I am working on it. In some systems, we see an additional Failure : empty line below the step.

let me know the others you find please :)

@GJKrupa
Copy link
Author

GJKrupa commented Feb 11, 2020

The glitches aren't all that interesting - some missing data items in our repo that prevented the plan from succeeding without targeting and the issue mentioned earlier prevents terraform-compliance from running on a targeted plan.

@eerkunt
Copy link
Member

eerkunt commented Feb 11, 2020

Ah I see, I thought it was glitches specific to terraform-compliance :)

@eerkunt
Copy link
Member

eerkunt commented Feb 11, 2020

Well, then I am closing this issue, if everything is ok for you ?

@GJKrupa
Copy link
Author

GJKrupa commented Feb 11, 2020

Sorry, should have been clearer with my language. Yes, please feel free to close the ticket.

@eerkunt eerkunt closed this as completed Feb 11, 2020
@ghost
Copy link

ghost commented Feb 11, 2020

This issue's conversation is now locked. If you want to continue this discussion please open a new issue.

@ghost ghost locked and limited conversation to collaborators Feb 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted Feature Request has been accepted and will be incorporated soon. enhancement waiting for confirmation Workaround/Fix applied, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

2 participants