Commit Graph

125 Commits

Author SHA1 Message Date
Julio Castillo
99adea9d4f Add index when needed 2026-04-27 15:20:59 +02:00
Julio Castillo
c2283aa405 Add hints to pytest failures 2026-04-27 14:05:37 +02:00
Julio Castillo
ff529cc4f3 Fix e2e 2026-04-27 12:15:57 +02:00
Julio Castillo
99f53d37f0 New generate_plan_summary.py tool 2026-04-27 12:00:54 +02:00
Ludovico Magnocavallo
a4eb4d24fd Compute VM module refactor (#3805)
* add ad for compute-vm refactor

* Exclue nic_type from validated fields, add split of main.tf and template.tf

* boot disk

* fix examples and fixtures

* attached disks

* fix further examples and module-level tests

* remove extra file

* fix mig examples

* finish refactoring variables

* align fast and other modules

* refactor(compute-vm): align examples and ADR with the newly implemented interface

This commit addresses the remaining references of the `instance_type` and `confidential_compute` parameters in the testing environment and updates the ADR.

* feat(compute-vm): add network_performance_config to instance and templates

This change implements the usage of the `network_performance_tier` variable we added earlier into the actual Terraform resources.

---------

Co-authored-by: Wiktor Niesiobędzki <wiktorn@google.com>
2026-03-26 11:31:40 +00:00
Wiktor Niesiobędzki
2687dd2b97 make a test self-link look like a self-link and fix tests 2025-12-19 11:05:25 +01:00
Wiktor Niesiobędzki
73664615a4 Correct test for Direct VPC egress for CFv2 2025-12-19 11:05:25 +01:00
Ludovico Magnocavallo
63a22cd9a2 Refactor secret manager module (#3315)
* wip

* wip

* wip

* wip

* tested, missing versions

* working

* fix secops stage

* readme

* tests

* tflint
2025-09-10 11:47:35 +00:00
Julio Castillo
fdf9191460 New Managed Kafka module (#3054) 2025-04-24 06:52:03 +00:00
simonebruzzechesse
03db2e45cf secops-rules module (#3023)
* secops-rules module
2025-04-11 15:44:31 +02:00
Wiktor Niesiobędzki
dcccb1a1d0 Improve failure message 2025-04-01 10:40:32 +02:00
Wiktor Niesiobędzki
ddd8382e7c fix failing tofu tests 2024-12-20 10:19:01 +01:00
Ludovico Magnocavallo
74427386b9 Add support for bundling net monitoring tool in a Docker image, and deploying via CR Job (#2609)
* dockerfile and reqs update

* deployment via cloud run jobs

* README

* boilerplate
2024-10-07 12:56:09 +00:00
Wiktor Niesiobędzki
44a4268afc Fix E2E tests 2024-09-04 12:16:50 +02:00
Julio Castillo
9386764f66 Introduce YAML schema validation for YAML examples (#2488)
* Add schema key to yaml examples

* Update testing requirements
2024-08-08 23:09:22 +02:00
Julio Castillo
d2d345d428 example testing improvements (#2487)
* Move away from regexps to parse tftest directives

* Update tfdoc

* Use namedtuple

* Make modules and resources optional in tftest directive

* Move get_tftest_directive to a separate file

* Fix imports

* Fix e2e tests
2024-08-08 21:22:27 +02:00
Luca Prete
092053b517 Adds a new certification authority service (CAS) module (#2481) 2024-08-08 09:55:48 +02:00
Wiktor Niesiobędzki
fa3817be6b E2E tests for ncc-spoke-ra 2024-07-13 13:54:34 +02:00
dibaskar-google
3d668170e5 Secret manager e2etests (#2280)
secret-manager e2e tests
2024-05-28 09:28:08 +02:00
Wiktor Niesiobędzki
6a3c7fe444 CloudSQL PSC Endpoints support (#2242)
* Add PSC endpoints consumers to net-address
* Cloud SQL E2E tests
2024-05-12 12:00:39 +02:00
Ludovico Magnocavallo
fbc7e891db Net LB App Internal Cross-Region recipe (#2214)
* reorder tfdoc methods

* add support for recipes to tfdoc

* fix repo url in tfdoc

* update module README

* validated untested recipe

* validated untested refactored recipe

* add optional proxy subnet creation, outputs, fixes

* tested

* tfdoc fix

* fix README

* exclude examples from test collector
2024-04-14 19:38:05 +03:00
dibaskar-google
4a187811d5 Kms e2e tests (#2151)
kms e2e tests
2024-03-13 11:31:21 +01:00
Ludovico Magnocavallo
525684faf3 Define service attachment interface for lb modules and implement in internal LBs (#2122)
* add service attachment support to lb app int module

* allow direct referencing of self managed ig in ilb module

* add service attachment support to net-ilb-int

* add service attachments example to net-lb-int

* fix resource name in net-lb-ext

* rename fwd rules resource in test inventories

* add toc to net-lb-int
2024-03-02 18:36:29 +00:00
Wiktor Niesiobędzki
bee3072568 Add support for Cloud Run v2 jobs (#1954)
Add support for Cloud Run v2 jobs

* create a separate file for service creation (service.tf) and job
  (job.tf) - for easy comparison
* add E2E tests where possibile
* remove default value for input variable `region`
* fix subnet range VPC Access Connector example
* add creation of service account for audit logs call (trigger requires
  service account)
* use provided trigger service account email in
  `local.trigger_sa_email`, so explicitly provided SA is passed to
  trigger
* set default value for vpc_connector_create.throughput.max, to match
  what is set by GCP API, as provider uses wrong default of 300 which
  results in perma-diff
* create inventory fiels for all examples

Global changes
* (tests) add input variable `project_number`, to allow assigning IAM permissions to Service Accounts in fixtures
* (tests) fix not outputting the path, when object is not found in inventory
* (tests) fix `create_e2e_sandbox.sh` - now it properly finds root of the repo

Secret Manager
* added `version_versions` output, to allow specifying versions in other modules. `versions` is sensitive and it makes it unsuitable for `for_each` values

New test fixtures
* `pubsub.tf` - creating one topic
* `secret-credential.tf` - creating Secret Manager `credential` secret
* `shared-vpc.tf` - creating two projects (host and service), and vpc in host project
* `vpc-connector.tf` - creating VPC Access Connector instance
2024-02-18 14:57:34 +01:00
apichick
5ba54aeaf7 Added Cross-region internal application load balancer module 2024-01-16 17:54:50 +01:00
Julio Castillo
fde7b76036 Allow per-module terraform fixtures (#1914)
* Allow terraform fixtures for examples

* Allow defining multiple fixtures, and named fixtures under tests/fixtures/

* Enable e2e for wiktorn

* Fix prepare_files call for e2e

* Move fixture to separate file, fix test

* Revert shallow-copying symlinks, performane penalty - 20%

* Update tfdoc.py to list used fixtures

---------

Co-authored-by: Wiktor Niesiobędzki <wiktorn@google.com>
2023-12-29 09:43:44 +00:00
andybubu
2ad109ae23 Fix variable region (#1953)
This PR changes variable region's default value in example tests to real region value.

Some of the modules parse the region name to decide whether to create regional or zonal resources.
2023-12-28 15:04:15 +01:00
Thangaraju R
e2d170c1a6 e2e tests for net-vpc-firewall module (#1896)
e2e tests for net-vpc-firewall module
2023-12-01 13:50:56 +01:00
Wiktor Niesiobędzki
985569fa83 Allow running E2E tests that are skipped in examples 2023-11-15 09:33:03 +00:00
Wiktor Niesiobędzki
03bf0b15b3 Organization module end-to-end tests (#1860)
* added tag serial to mark tests to be run serially
* always run tests using loadgroup distribution to make use of serial tag
* added end-to-end tests for organization, not adding to custom constraints as the name has to be unique
* fixed granting custom roles created in the same module call
2023-11-14 18:54:59 +01:00
Wiktor Niesiobędzki
fe485414e6 Add end-to-end tests for project module (#1823)
* Add end-to-end tests for project module
* Add inventory to data tests
* Add files to end-to-end test cases
* Review fixes - use named groups

---------

Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
2023-11-03 18:04:19 +01:00
Simone Ruffilli
6d89b88149 versions.tf maintenance + copyright notice bump (#1782)
* Bump copyright notice to 2023

* Delete versions.tf on blueprints

* Pin provider to major version 5

* Remove comment

* Fix lint

* fix bq-ml blueprint readme

---------

Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
Co-authored-by: Julio Castillo <jccb@google.com>
2023-10-20 18:17:47 +02:00
Wiktor Niesiobędzki
d07daf966a End-to-end tests for terraform modules (#1751)
Add end-to-end tests (apply, plan, destroy) for examples.

When run, `tests/examples_e2e`:
1. Create an environment for tests to run (folder, project vpc network) 
2. For each marked example (with `e2e` tftest directive), run apply, plan, destroy
3. Verify:
* no failure in apply
* empty plan after apply
* no failure during destroy
4. When all tests are done, destroy test environment

More details in `tests/examples_e2e/README.md`
2023-10-20 09:59:52 +02:00
Julio Castillo
46f4d22c87 Examples and tests 2023-09-07 11:31:40 +02:00
Ludovico Magnocavallo
819894d2ba IAM interface refactor (#1595)
* IAM modules refactor proposal

* policy

* subheading

* Update 20230816-iam-refactor.md

* log Julio's +1

* data-catalog-policy-tag

* dataproc

* dataproc

* folder

* folder

* folder

* folder

* project

* better filtering in test examples

* project

* folder

* folder

* organization

* fix variable descriptions

* kms

* net-vpc

* dataplex-datascan

* modules/iam-service-account

* modules/source-repository/

* blueprints/cloud-operations/vm-migration/

* blueprints/third-party-solutions/wordpress

* dataplex-datascan

* blueprints/cloud-operations/workload-identity-federation

* blueprints/data-solutions/cloudsql-multiregion/

* blueprints/data-solutions/composer-2

* Update 20230816-iam-refactor.md

* Update 20230816-iam-refactor.md

* capture discussion in architectural doc

* update variable names and refactor proposal

* project

* blueprints first round

* folder

* organization

* data-catalog-policy-tag

* re-enable folder inventory

* project module style fix

* dataproc

* source-repository

* source-repository tests

* dataplex-datascan

* dataplex-datascan tests

* net-vpc

* net-vpc test examples

* iam-service-account

* iam-service-account test examples

* kms

* boilerplate

* tfdoc

* fix module tests

* more blueprint fixes

* fix typo in data blueprints

* incomplete refactor of data platform foundations

* tfdoc

* data platform foundation

* refactor data platform foundation iam locals

* remove redundant example test

* shielded folder fix

* fix typo

* project factory

* project factory outputs

* tfdoc

* test workflow: less verbose tests, fix tf version

* re-enable -vv, shorter traceback, fix action version

* ignore github extension warning, re-enable action version

* fast bootstrap IAM, untested

* bootstrap stage IAM fixes

* stage 0 tests

* fast stage 1

* tenant stage 1

* minor changes to fast stage 0 and 1

* fast security stage

* fast mt stage 0

* fast mt stage 0

* fast pf
2023-08-20 09:44:20 +02:00
Julio Castillo
165515f9fd Update contributing guide with new test framework 2023-03-09 14:41:18 +01:00
Julio Castillo
edce6edd28 Update factories and apigee tests 2023-02-25 19:26:11 +01:00
Julio Castillo
3a0f69dc2d Revert examples/conftest.py 2023-02-25 19:26:11 +01:00
Julio Castillo
71e96dfdee Allow blueprints to be tested from README files without examples. 2023-02-25 19:26:11 +01:00
Julio Castillo
2aad7845a4 Allow dashes and underscores in tftest file ids 2023-01-19 17:47:14 +01:00
Julio Castillo
12f07ebeac Extend net-vpc README with more tested examples 2023-01-19 17:47:14 +01:00
Julio Castillo
c8bfe892a6 Update folder tests 2023-01-03 16:52:31 +01:00
Julio Castillo
4f7cb39a06 Simplify readme discovery 2022-12-18 14:00:20 +01:00
Julio Castillo
126227502e Fix tests paths for examples 2022-12-18 14:00:20 +01:00
Julio Castillo
4b77e484b1 Migrate project module to new tests 2022-12-18 14:00:19 +01:00
Julio Castillo
e700a27079 Enforce terraform fmt in examples 2022-12-18 14:00:19 +01:00
Julio Castillo
4e95645e69 Silence linting 2022-12-18 14:00:19 +01:00
Julio Castillo
8accf2ed91 Fix typo 2022-12-18 14:00:19 +01:00
Julio Castillo
513fdfe91a Make directive for supporting files in examples more explicit 2022-12-18 14:00:19 +01:00
Julio Castillo
aaacee2a70 Ignore multiple whitespace in tftest directives 2022-12-18 14:00:19 +01:00