Commit Graph

32 Commits

Author SHA1 Message Date
Ludovico Magnocavallo
1fd1c9ae98 Fix random test failures by ignoring .git in copytree (#3949) 2026-05-08 20:57:40 +02:00
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
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
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
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
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
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
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
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
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
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
126227502e Fix tests paths for examples 2022-12-18 14:00:20 +01:00
Julio Castillo
e700a27079 Enforce terraform fmt in examples 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
Julio Castillo
aba14fe574 Allow passing an inventory to examples test directive 2022-12-18 14:00:19 +01:00
Julio Castillo
2cd74823b1 Generate files based on readme contents 2022-11-18 17:48:52 +01:00
Julio Castillo
5cfa1062cc Ensure inline README file match fixture files 2022-11-18 17:48:52 +01:00
Julio Castillo
7be3288cc7 Add tests for factory examples 2022-11-18 17:48:52 +01:00
Ludovico Magnocavallo
9400eed2bf Add documentation example test for pf (#813)
* Add documentation example test for pf

* skip tmpdir for examples
2022-09-14 14:34:30 +02:00
Julio Castillo
7e9173d35d Create fully recursive e2e test runner 2022-09-12 13:58:11 +02:00
Julio Castillo
269894e92b Update all internal links examples -> blueprints 2022-09-09 16:39:01 +02:00
Julio Castillo
8df9ef9035 New folder structure 2022-01-11 11:53:19 +01:00
Simone Ruffilli
ee25965c89 Copyright bump (#410) 2022-01-01 15:52:31 +01:00
Julio Castillo
1e11c670f5 Update copyright to 2021 2021-02-15 09:38:10 +01:00
Ludovico Magnocavallo
14fe796885 Add missing role to GKE nodepool service account, refactor test runners and parallelize tests (#164)
* add missing role to GKE nodepool service account

* refactor plan test runners

* remove spurious print statements from test

* use concurrency via locking the fixture dir

* add filelock to test requirements

* fix pytest arg in cloud build

* and yet another dep and args fix

* fix e2e runner, use correct runner in env e2e test

* revert parallel test changes, split modules and environments triggers

* I should stop experimenting in PRs
2020-11-09 21:32:09 +01:00
Julio Castillo
524416ea03 Move example test suite to its own directory 2020-11-07 18:22:03 +01:00