forked from GoogleCloudPlatform/magic-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There's a whole bunch of different constraints that have to be met for these tests to pass consistently. * Backup schedules need to be run in a project with billing enabled, and the database needs a deletion policy to ensure it is properly swept. * The default-database examples were marked as skip-test. They're valuable as examples but not really as tests - there's nothing Terraform-specific about them worth testing - and the Field tests will fail if default database creation doesn't work in Terraform * The Document tests need to run against the (default) database due to an existing bug (hashicorp/terraform-provider-google#15550). So they will now create their own project and their own (default) database. * The basic Field example is also creating its own project and its own database now for test isolation purposes. It might be sufficient to just create a database the same way as for backup schedules; we can evaluate that once the tests have been passing for a while. * The other two Field examples are following the same pattern as the backup schedule examples. * The Firestore-native index example is using the inband project creation method, because then we can use the (default) database, which means we can use the Document resource (see the above-mentioned bug), which means that we don't need to use a manually-created project (because creating a Document implicitly creates its collection). * The Datastore mode Index example can't take that same approach, because it doesn't seem like the Document resource works on datastore-mode databases. So we will need to use the manually-created FIRESTORE_PROJECT_NAME project for that one, and it will need to have a Datastore mode database manually baked into it. This exercise has identified a fair number of places for improvement to the Firestore Terraform story, but as a stopgap to get the tests passing again, this will have to do.
- Loading branch information
Showing
21 changed files
with
341 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 12 additions & 1 deletion
13
mmv1/templates/terraform/examples/firestore_backup_schedule_daily.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 11 additions & 1 deletion
12
mmv1/templates/terraform/examples/firestore_backup_schedule_weekly.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
mmv1/templates/terraform/examples/firestore_database_in_datastore_mode.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 4 additions & 6 deletions
10
mmv1/templates/terraform/examples/firestore_default_database.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
resource "google_firestore_database" "<%= ctx[:primary_resource_id] %>" { | ||
project = "<%= ctx[:test_env_vars]['project_id'] %>" | ||
name = "(default)" | ||
location_id = "nam5" | ||
type = "FIRESTORE_NATIVE" | ||
delete_protection_state = "<%= ctx[:vars]['delete_protection_state'] %>" | ||
deletion_policy = "DELETE" | ||
project = "<%= ctx[:test_env_vars]['project_id'] %>" | ||
name = "(default)" | ||
location_id = "nam5" | ||
type = "FIRESTORE_NATIVE" | ||
} |
10 changes: 4 additions & 6 deletions
10
mmv1/templates/terraform/examples/firestore_default_database_in_datastore_mode.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
resource "google_firestore_database" "<%= ctx[:primary_resource_id] %>" { | ||
project = "<%= ctx[:test_env_vars]['project_id'] %>" | ||
name = "(default)" | ||
location_id = "nam5" | ||
type = "DATASTORE_MODE" | ||
delete_protection_state = "<%= ctx[:vars]['delete_protection_state'] %>" | ||
deletion_policy = "DELETE" | ||
project = "<%= ctx[:test_env_vars]['project_id'] %>" | ||
name = "(default)" | ||
location_id = "nam5" | ||
type = "DATASTORE_MODE" | ||
} |
32 changes: 31 additions & 1 deletion
32
mmv1/templates/terraform/examples/firestore_document_basic.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 35 additions & 3 deletions
38
mmv1/templates/terraform/examples/firestore_document_nested_document.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 32 additions & 3 deletions
35
mmv1/templates/terraform/examples/firestore_field_basic.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
mmv1/templates/terraform/examples/firestore_field_complex_field_name.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.