-
Notifications
You must be signed in to change notification settings - Fork 152
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
Count giving unexpected and unclear number #242
Comments
Hi @Verhaeg, It is hard to understand since this looks like a custom provider. Would it be possible post a |
I had to comment out the members (not important right now) and changed the names by leaving only 3 groups created. Sorry for not being able to leave as an example, but here is the test output for this file: Feature: Email groups should be created with three levels and users inside
Scenario: Ensure I have all groups
Given I have gsuite_group defined
When it contains email
And I count them
Then its value must be equal to 3 $ terraform-compliance -p ./plan.out.txt --features tests/compliance
terraform-compliance v1.1.12 initiated
🚩 Features : /Users/verhaeg/Projects/terraform-gsuit/tests/compliance
🚩 Plan File : /Users/verhaeg/Projects/terraform-gsuit/plan.out.txt
🚩 Running tests. 🎉
Feature: Email groups should be created with three levels and users inside # /Users/verhaeg/Projects/terraform-gsuit/tests/compliance/groups.feature
Scenario: Ensure I have all groups
Given I have gsuite_group defined
When it contains email
And I count them
Failure: for ['module.team_myteam.gsuite_group.gcp-level-i', 'module.team_myteam.gsuite_group.gcp-level-ii', 'module.team_myteam.gsuite_group.gcp-level-iii'] on email. 81 is not equal to 3.
Then its value must be equal to 3
Failure:
1 features (0 passed, 1 failed)
1 scenarios (0 passed, 1 failed)
4 steps (3 passed, 1 failed)
Run 1585583094 finished within a moment |
Yep, reproduced the problem with your plan output, thank you! Having a deeper look. |
Yep, found the problem. It looks like there is slight problem on the count function where we count the characters within those emails :) Testing my fix. |
Just released Could you please try and let me know about the result ? Thanks! |
Awesome! Tests passed now! thanks for the quick fix |
This issue's conversation is now locked. If you want to continue this discussion please open a new issue. |
Description :
Trying to write a simple count of resources created but the expected value is 615 instead of 18.
Using terraform-gsuite plugin to manage new groups and using a module to create those groups with certain people already in them. Expected to assert that all groups I created are present in the plan using the count check but the tests fail with unrealistic count.
To Reproduce
terraform
code, or yourterraform plan
file if it doesn't have any confidential information>terraform-compliance -p .plan.out --features .tests/compliance
Failure: for ['module.my_team.gsuite_group.level-i', 'module.my_team.gsuite_group.level-ii', 'module.my_team.gsuite_group.level-iii', ...] on email. 615 is not equal to 18.
Expected behavior :
Test should pass
Tested versions :
Additional context
The examples I gave (the codes) are reduced since we have some internal names for this case. But should suffice.
Also, I'm currently unaware of all existing groups we have, but those are the only managed ones
The text was updated successfully, but these errors were encountered: