Skip to content

Commit b181821

Browse files
committed
Use all available arguments for terraform-docs during tests
1 parent ea6ca51 commit b181821

File tree

11 files changed

+225
-215
lines changed

11 files changed

+225
-215
lines changed

Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,21 @@ _test_run:
6060
@echo "------------------------------------------------------------"
6161
@echo "- Testing terraform-docs"
6262
@echo "------------------------------------------------------------"
63-
@if ! docker run --rm -v $(CURRENT_DIR)/tests/default:/data $(IMAGE) terraform-docs-replace md TEST-$(TAG).md; then \
63+
$(eval TFDOC_ARG_SORT = $(shell \
64+
if [ "$(TAG)" = "latest" ] || [ "$(TAG)" = "0.6.0" ] || [ "$(TAG)" = "0.5.0" ]; then \
65+
echo "--sort-inputs-by-required"; \
66+
fi; \
67+
))
68+
$(eval TFDOC_ARG_AGGREGATE = $(shell \
69+
if [ "$(TAG)" = "latest" ] || [ "$(TAG)" = "0.6.0" ] || [ "$(TAG)" = "0.5.0" ] || [ "$(TAG)" = "0.4.5" ] || [ "$(TAG)" = "0.4.0" ]; then \
70+
echo "--with-aggregate-type-defaults"; \
71+
fi; \
72+
))
73+
@if ! docker run --rm -v $(CURRENT_DIR)/tests/default:/data $(IMAGE) terraform-docs-replace $(TFDOC_ARG_SORT) $(TFDOC_ARG_AGGREGATE) md TEST-$(TAG).md; then \
6474
echo "Failed"; \
6575
exit 1; \
6676
fi
67-
@if ! docker run --rm -v $(CURRENT_DIR)/tests/0.12:/data $(IMAGE) terraform-docs-replace-012 md TEST-$(TAG).md; then \
77+
@if ! docker run --rm -v $(CURRENT_DIR)/tests/0.12:/data $(IMAGE) terraform-docs-replace-012 $(TFDOC_ARG_SORT) $(TFDOC_ARG_AGGREGATE) md TEST-$(TAG).md; then \
6878
echo "Failed"; \
6979
exit 1; \
7080
fi; \

tests/0.12/TEST-0.4.0.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,37 @@ Stuff before terraform-docs
88

99
| Name | Description | Type | Default | Required |
1010
|------|-------------|:----:|:-----:|:-----:|
11-
| computed_egress_rules | List of computed egress rules to create by name | list(string) | `<list>` | no |
12-
| computed_egress_with_cidr_blocks | List of computed egress rules to create where 'cidr_blocks' is used | list(map(string)) | `<list>` | no |
13-
| computed_egress_with_ipv6_cidr_blocks | List of computed egress rules to create where 'ipv6_cidr_blocks' is used | list(map(string)) | `<list>` | no |
14-
| computed_egress_with_self | List of computed egress rules to create where 'self' is defined | list(map(string)) | `<list>` | no |
15-
| computed_egress_with_source_security_group_id | List of computed egress rules to create where 'source_security_group_id' is used | list(map(string)) | `<list>` | no |
16-
| computed_ingress_rules | List of computed ingress rules to create by name | list(string) | `<list>` | no |
17-
| computed_ingress_with_cidr_blocks | List of computed ingress rules to create where 'cidr_blocks' is used | list(map(string)) | `<list>` | no |
18-
| computed_ingress_with_ipv6_cidr_blocks | List of computed ingress rules to create where 'ipv6_cidr_blocks' is used | list(map(string)) | `<list>` | no |
19-
| computed_ingress_with_self | List of computed ingress rules to create where 'self' is defined | list(map(string)) | `<list>` | no |
20-
| computed_ingress_with_source_security_group_id | List of computed ingress rules to create where 'source_security_group_id' is used | list(map(string)) | `<list>` | no |
11+
| computed_egress_rules | List of computed egress rules to create by name | list(string) | `[]` | no |
12+
| computed_egress_with_cidr_blocks | List of computed egress rules to create where 'cidr_blocks' is used | list(map(string)) | `[]` | no |
13+
| computed_egress_with_ipv6_cidr_blocks | List of computed egress rules to create where 'ipv6_cidr_blocks' is used | list(map(string)) | `[]` | no |
14+
| computed_egress_with_self | List of computed egress rules to create where 'self' is defined | list(map(string)) | `[]` | no |
15+
| computed_egress_with_source_security_group_id | List of computed egress rules to create where 'source_security_group_id' is used | list(map(string)) | `[]` | no |
16+
| computed_ingress_rules | List of computed ingress rules to create by name | list(string) | `[]` | no |
17+
| computed_ingress_with_cidr_blocks | List of computed ingress rules to create where 'cidr_blocks' is used | list(map(string)) | `[]` | no |
18+
| computed_ingress_with_ipv6_cidr_blocks | List of computed ingress rules to create where 'ipv6_cidr_blocks' is used | list(map(string)) | `[]` | no |
19+
| computed_ingress_with_self | List of computed ingress rules to create where 'self' is defined | list(map(string)) | `[]` | no |
20+
| computed_ingress_with_source_security_group_id | List of computed ingress rules to create where 'source_security_group_id' is used | list(map(string)) | `[]` | no |
2121
| create | Whether to create security group and all rules | bool | `true` | no |
22-
| database_outbound_acl_rules | Database subnets outbound network ACL rules | list(map(string)) | `<list>` | no |
22+
| database_outbound_acl_rules | Database subnets outbound network ACL rules | list(map(string)) | `[ { "cidr_block": "0.0.0.0/0", "from_port": 0, "protocol": "-1", "rule_action": "allow", "rule_number": 100, "to_port": 0 } ]` | no |
2323
| description | Description of security group | string | `Security Group managed by Terraform` | no |
24-
| egress_cidr_blocks | List of IPv4 CIDR ranges to use on all egress rules | list(string) | `<list>` | no |
25-
| egress_ipv6_cidr_blocks | List of IPv6 CIDR ranges to use on all egress rules | list(string) | `<list>` | no |
26-
| egress_prefix_list_ids | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | list(string) | `<list>` | no |
27-
| egress_rules | List of egress rules to create by name | list(string) | `<list>` | no |
28-
| egress_with_cidr_blocks | List of egress rules to create where 'cidr_blocks' is used | list(map(string)) | `<list>` | no |
29-
| egress_with_ipv6_cidr_blocks | List of egress rules to create where 'ipv6_cidr_blocks' is used | list(map(string)) | `<list>` | no |
30-
| egress_with_self | List of egress rules to create where 'self' is defined | list(map(string)) | `<list>` | no |
31-
| egress_with_source_security_group_id | List of egress rules to create where 'source_security_group_id' is used | list(map(string)) | `<list>` | no |
32-
| ingress_cidr_blocks | List of IPv4 CIDR ranges to use on all ingress rules | list(string) | `<list>` | no |
33-
| ingress_ipv6_cidr_blocks | List of IPv6 CIDR ranges to use on all ingress rules | list(string) | `<list>` | no |
34-
| ingress_prefix_list_ids | List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules | list(string) | `<list>` | no |
35-
| ingress_rules | List of ingress rules to create by name | list(string) | `<list>` | no |
36-
| ingress_with_cidr_blocks | List of ingress rules to create where 'cidr_blocks' is used | list(map(string)) | `<list>` | no |
37-
| ingress_with_ipv6_cidr_blocks | List of ingress rules to create where 'ipv6_cidr_blocks' is used | list(map(string)) | `<list>` | no |
38-
| ingress_with_self | List of ingress rules to create where 'self' is defined | list(map(string)) | `<list>` | no |
39-
| ingress_with_source_security_group_id | List of ingress rules to create where 'source_security_group_id' is used | list(map(string)) | `<list>` | no |
24+
| egress_cidr_blocks | List of IPv4 CIDR ranges to use on all egress rules | list(string) | `[ "0.0.0.0/0" ]` | no |
25+
| egress_ipv6_cidr_blocks | List of IPv6 CIDR ranges to use on all egress rules | list(string) | `[ "::/0" ]` | no |
26+
| egress_prefix_list_ids | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | list(string) | `[]` | no |
27+
| egress_rules | List of egress rules to create by name | list(string) | `[]` | no |
28+
| egress_with_cidr_blocks | List of egress rules to create where 'cidr_blocks' is used | list(map(string)) | `[]` | no |
29+
| egress_with_ipv6_cidr_blocks | List of egress rules to create where 'ipv6_cidr_blocks' is used | list(map(string)) | `[]` | no |
30+
| egress_with_self | List of egress rules to create where 'self' is defined | list(map(string)) | `[]` | no |
31+
| egress_with_source_security_group_id | List of egress rules to create where 'source_security_group_id' is used | list(map(string)) | `[]` | no |
32+
| ingress_cidr_blocks | List of IPv4 CIDR ranges to use on all ingress rules | list(string) | `[]` | no |
33+
| ingress_ipv6_cidr_blocks | List of IPv6 CIDR ranges to use on all ingress rules | list(string) | `[]` | no |
34+
| ingress_prefix_list_ids | List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules | list(string) | `[]` | no |
35+
| ingress_rules | List of ingress rules to create by name | list(string) | `[]` | no |
36+
| ingress_with_cidr_blocks | List of ingress rules to create where 'cidr_blocks' is used | list(map(string)) | `[]` | no |
37+
| ingress_with_ipv6_cidr_blocks | List of ingress rules to create where 'ipv6_cidr_blocks' is used | list(map(string)) | `[]` | no |
38+
| ingress_with_self | List of ingress rules to create where 'self' is defined | list(map(string)) | `[]` | no |
39+
| ingress_with_source_security_group_id | List of ingress rules to create where 'source_security_group_id' is used | list(map(string)) | `[]` | no |
4040
| name | Name of security group | string | - | yes |
41-
| network | The network | object | `<map>` | no |
41+
| network | The network | object | `{ "subnets": [ { "cidr_block": "10.0.0.0/16", "id": "vpc-123456" } ], "vpc": [ { "cidr_block": "10.0.0.0/16", "id": "vpc-123456" } ] }` | no |
4242
| number_of_computed_egress_rules | Number of computed egress rules to create by name | number | `0` | no |
4343
| number_of_computed_egress_with_cidr_blocks | Number of computed egress rules to create where 'cidr_blocks' is used | number | `0` | no |
4444
| number_of_computed_egress_with_ipv6_cidr_blocks | Number of computed egress rules to create where 'ipv6_cidr_blocks' is used | number | `0` | no |
@@ -49,7 +49,7 @@ Stuff before terraform-docs
4949
| number_of_computed_ingress_with_ipv6_cidr_blocks | Number of computed ingress rules to create where 'ipv6_cidr_blocks' is used | number | `0` | no |
5050
| number_of_computed_ingress_with_self | Number of computed ingress rules to create where 'self' is defined | number | `0` | no |
5151
| number_of_computed_ingress_with_source_security_group_id | Number of computed ingress rules to create where 'source_security_group_id' is used | number | `0` | no |
52-
| tags | A mapping of tags to assign to security group | map(string) | `<map>` | no |
52+
| tags | A mapping of tags to assign to security group | map(string) | `{}` | no |
5353
| use_name_prefix | Whether to use name_prefix or fixed name. Should be true to able to update security group name after initial creation | bool | `true` | no |
5454
| vpc_id | ID of the VPC where to create security group | string | - | yes |
5555

tests/0.12/TEST-0.4.5.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,37 @@ Stuff before terraform-docs
77

88
| Name | Description | Type | Default | Required |
99
|------|-------------|:----:|:-----:|:-----:|
10-
| computed_egress_rules | List of computed egress rules to create by name | list(string) | `<list>` | no |
11-
| computed_egress_with_cidr_blocks | List of computed egress rules to create where 'cidr_blocks' is used | list(map(string)) | `<list>` | no |
12-
| computed_egress_with_ipv6_cidr_blocks | List of computed egress rules to create where 'ipv6_cidr_blocks' is used | list(map(string)) | `<list>` | no |
13-
| computed_egress_with_self | List of computed egress rules to create where 'self' is defined | list(map(string)) | `<list>` | no |
14-
| computed_egress_with_source_security_group_id | List of computed egress rules to create where 'source_security_group_id' is used | list(map(string)) | `<list>` | no |
15-
| computed_ingress_rules | List of computed ingress rules to create by name | list(string) | `<list>` | no |
16-
| computed_ingress_with_cidr_blocks | List of computed ingress rules to create where 'cidr_blocks' is used | list(map(string)) | `<list>` | no |
17-
| computed_ingress_with_ipv6_cidr_blocks | List of computed ingress rules to create where 'ipv6_cidr_blocks' is used | list(map(string)) | `<list>` | no |
18-
| computed_ingress_with_self | List of computed ingress rules to create where 'self' is defined | list(map(string)) | `<list>` | no |
19-
| computed_ingress_with_source_security_group_id | List of computed ingress rules to create where 'source_security_group_id' is used | list(map(string)) | `<list>` | no |
10+
| computed_egress_rules | List of computed egress rules to create by name | list(string) | `[]` | no |
11+
| computed_egress_with_cidr_blocks | List of computed egress rules to create where 'cidr_blocks' is used | list(map(string)) | `[]` | no |
12+
| computed_egress_with_ipv6_cidr_blocks | List of computed egress rules to create where 'ipv6_cidr_blocks' is used | list(map(string)) | `[]` | no |
13+
| computed_egress_with_self | List of computed egress rules to create where 'self' is defined | list(map(string)) | `[]` | no |
14+
| computed_egress_with_source_security_group_id | List of computed egress rules to create where 'source_security_group_id' is used | list(map(string)) | `[]` | no |
15+
| computed_ingress_rules | List of computed ingress rules to create by name | list(string) | `[]` | no |
16+
| computed_ingress_with_cidr_blocks | List of computed ingress rules to create where 'cidr_blocks' is used | list(map(string)) | `[]` | no |
17+
| computed_ingress_with_ipv6_cidr_blocks | List of computed ingress rules to create where 'ipv6_cidr_blocks' is used | list(map(string)) | `[]` | no |
18+
| computed_ingress_with_self | List of computed ingress rules to create where 'self' is defined | list(map(string)) | `[]` | no |
19+
| computed_ingress_with_source_security_group_id | List of computed ingress rules to create where 'source_security_group_id' is used | list(map(string)) | `[]` | no |
2020
| create | Whether to create security group and all rules | bool | `true` | no |
21-
| database_outbound_acl_rules | Database subnets outbound network ACL rules | list(map(string)) | `<list>` | no |
21+
| database_outbound_acl_rules | Database subnets outbound network ACL rules | list(map(string)) | `[ { "cidr_block": "0.0.0.0/0", "from_port": 0, "protocol": "-1", "rule_action": "allow", "rule_number": 100, "to_port": 0 } ]` | no |
2222
| description | Description of security group | string | `Security Group managed by Terraform` | no |
23-
| egress_cidr_blocks | List of IPv4 CIDR ranges to use on all egress rules | list(string) | `<list>` | no |
24-
| egress_ipv6_cidr_blocks | List of IPv6 CIDR ranges to use on all egress rules | list(string) | `<list>` | no |
25-
| egress_prefix_list_ids | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | list(string) | `<list>` | no |
26-
| egress_rules | List of egress rules to create by name | list(string) | `<list>` | no |
27-
| egress_with_cidr_blocks | List of egress rules to create where 'cidr_blocks' is used | list(map(string)) | `<list>` | no |
28-
| egress_with_ipv6_cidr_blocks | List of egress rules to create where 'ipv6_cidr_blocks' is used | list(map(string)) | `<list>` | no |
29-
| egress_with_self | List of egress rules to create where 'self' is defined | list(map(string)) | `<list>` | no |
30-
| egress_with_source_security_group_id | List of egress rules to create where 'source_security_group_id' is used | list(map(string)) | `<list>` | no |
31-
| ingress_cidr_blocks | List of IPv4 CIDR ranges to use on all ingress rules | list(string) | `<list>` | no |
32-
| ingress_ipv6_cidr_blocks | List of IPv6 CIDR ranges to use on all ingress rules | list(string) | `<list>` | no |
33-
| ingress_prefix_list_ids | List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules | list(string) | `<list>` | no |
34-
| ingress_rules | List of ingress rules to create by name | list(string) | `<list>` | no |
35-
| ingress_with_cidr_blocks | List of ingress rules to create where 'cidr_blocks' is used | list(map(string)) | `<list>` | no |
36-
| ingress_with_ipv6_cidr_blocks | List of ingress rules to create where 'ipv6_cidr_blocks' is used | list(map(string)) | `<list>` | no |
37-
| ingress_with_self | List of ingress rules to create where 'self' is defined | list(map(string)) | `<list>` | no |
38-
| ingress_with_source_security_group_id | List of ingress rules to create where 'source_security_group_id' is used | list(map(string)) | `<list>` | no |
23+
| egress_cidr_blocks | List of IPv4 CIDR ranges to use on all egress rules | list(string) | `[ "0.0.0.0/0" ]` | no |
24+
| egress_ipv6_cidr_blocks | List of IPv6 CIDR ranges to use on all egress rules | list(string) | `[ "::/0" ]` | no |
25+
| egress_prefix_list_ids | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | list(string) | `[]` | no |
26+
| egress_rules | List of egress rules to create by name | list(string) | `[]` | no |
27+
| egress_with_cidr_blocks | List of egress rules to create where 'cidr_blocks' is used | list(map(string)) | `[]` | no |
28+
| egress_with_ipv6_cidr_blocks | List of egress rules to create where 'ipv6_cidr_blocks' is used | list(map(string)) | `[]` | no |
29+
| egress_with_self | List of egress rules to create where 'self' is defined | list(map(string)) | `[]` | no |
30+
| egress_with_source_security_group_id | List of egress rules to create where 'source_security_group_id' is used | list(map(string)) | `[]` | no |
31+
| ingress_cidr_blocks | List of IPv4 CIDR ranges to use on all ingress rules | list(string) | `[]` | no |
32+
| ingress_ipv6_cidr_blocks | List of IPv6 CIDR ranges to use on all ingress rules | list(string) | `[]` | no |
33+
| ingress_prefix_list_ids | List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules | list(string) | `[]` | no |
34+
| ingress_rules | List of ingress rules to create by name | list(string) | `[]` | no |
35+
| ingress_with_cidr_blocks | List of ingress rules to create where 'cidr_blocks' is used | list(map(string)) | `[]` | no |
36+
| ingress_with_ipv6_cidr_blocks | List of ingress rules to create where 'ipv6_cidr_blocks' is used | list(map(string)) | `[]` | no |
37+
| ingress_with_self | List of ingress rules to create where 'self' is defined | list(map(string)) | `[]` | no |
38+
| ingress_with_source_security_group_id | List of ingress rules to create where 'source_security_group_id' is used | list(map(string)) | `[]` | no |
3939
| name | Name of security group | string | - | yes |
40-
| network | The network | object | `<map>` | no |
40+
| network | The network | object | `{ "subnets": [ { "cidr_block": "10.0.0.0/16", "id": "vpc-123456" } ], "vpc": [ { "cidr_block": "10.0.0.0/16", "id": "vpc-123456" } ] }` | no |
4141
| number_of_computed_egress_rules | Number of computed egress rules to create by name | number | `0` | no |
4242
| number_of_computed_egress_with_cidr_blocks | Number of computed egress rules to create where 'cidr_blocks' is used | number | `0` | no |
4343
| number_of_computed_egress_with_ipv6_cidr_blocks | Number of computed egress rules to create where 'ipv6_cidr_blocks' is used | number | `0` | no |
@@ -48,7 +48,7 @@ Stuff before terraform-docs
4848
| number_of_computed_ingress_with_ipv6_cidr_blocks | Number of computed ingress rules to create where 'ipv6_cidr_blocks' is used | number | `0` | no |
4949
| number_of_computed_ingress_with_self | Number of computed ingress rules to create where 'self' is defined | number | `0` | no |
5050
| number_of_computed_ingress_with_source_security_group_id | Number of computed ingress rules to create where 'source_security_group_id' is used | number | `0` | no |
51-
| tags | A mapping of tags to assign to security group | map(string) | `<map>` | no |
51+
| tags | A mapping of tags to assign to security group | map(string) | `{}` | no |
5252
| use_name_prefix | Whether to use name_prefix or fixed name. Should be true to able to update security group name after initial creation | bool | `true` | no |
5353
| vpc_id | ID of the VPC where to create security group | string | - | yes |
5454

0 commit comments

Comments
 (0)