Commit Graph

62 Commits

Author SHA1 Message Date
Martin Atkins
1b9b5cea79 Use modern helpers from Go's testing.T API (#2692)
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-04-23 07:48:41 -04:00
Ilia Gogotchuri
baed1f2df5 Adds support for run block outputs in the test provider block (#2543)
Signed-off-by: Ilia Gogotchuri <ilia.gogotchuri0@gmail.com>
2025-03-18 12:29:37 +04:00
Oleksandr Levchenkov
5f8eee4708 add simulated state serialization between tofu test runs (#2274)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-12-10 16:34:25 +02:00
Oleksandr Levchenkov
2758f2cfbf fix mock provider validation (#2140)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-11-20 16:45:17 +02:00
Arel Rabinowitz
3d4bf29c56 Add exclude flag support (#1900)
Signed-off-by: RLRabinowitz <rlrabinowitz2@gmail.com>
2024-11-05 10:16:00 -05:00
Andy Hayes
7215ee2ed8 Adds warning if tests don't provide valid variable (#2057)
Signed-off-by: Andrew Hayes <andrew.hayes@harness.io>
2024-10-15 09:20:11 +01:00
Siddhartha Sonker
9138470a67 Allowed variable to pass inside variables block (#1488)
Signed-off-by: siddharthasonker95 <158144589+siddharthasonker95@users.noreply.github.com>
2024-06-03 18:44:05 +05:30
Siddhartha Sonker
6065bc593f Fixed tofu test when module has no resource (#1409)
Signed-off-by: siddharthasonker95 <158144589+siddharthasonker95@users.noreply.github.com>
2024-05-06 14:49:42 +02:00
Siddhartha Sonker
de30707b6b Fix for tofu init failure when test have spaces in their name (#1489)
Signed-off-by: siddharthasonker95 <158144589+siddharthasonker95@users.noreply.github.com>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Co-authored-by: Christian Mesh <christianmesh1@gmail.com>
2024-04-25 11:11:38 -04:00
Sanskruti Shahu
08f9a740ac Added support to use .tfvars files from tests folder (#1386)
Signed-off-by: sanskruti-shahu <sanskruti.shahu@harness.io>
2024-03-29 08:44:27 -04:00
Siddhartha Sonker
accfe1c412 Allow referencing output from test run in local variables block (tofu test) (#1254)
Signed-off-by: siddharthasonker95 <158144589+siddharthasonker95@users.noreply.github.com>
2024-02-19 10:18:56 +00:00
namgyalangmo
cb2e9119aa Update copyright notice (#1232)
Signed-off-by: namgyalangmo <75657887+namgyalangmo@users.noreply.github.com>
2024-02-08 09:48:59 +00:00
Christian Mesh
249ed42fb1 Run block variable references (#1129)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-01-17 06:57:14 -05:00
Ronny Orot
1aa92856b1 Fix test command teardown order (#1043)
Signed-off-by: Ronny Orot <ronny.orot@gmail.com>
2023-12-20 16:38:42 +02:00
Christian Mesh
abd324ea7c Revert "Fixes #898: Replace hashicorp and terraform references" (#995) 2023-12-11 15:10:03 -05:00
Janos
15bef1428a Fixes #898: Replace hashicorp and terraform references (#973)
Signed-off-by: Janos Bonic <86970079+janosdebugs@users.noreply.github.com>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Co-authored-by: Christian Mesh <christianmesh1@gmail.com>
2023-12-08 08:03:09 -05:00
RLRabinowitz
e0ecd2ebb3 Use registry.opentofu.org as the default registry (#379)
Signed-off-by: RLRabinowitz <rlrabinowitz2@gmail.com>
2023-10-03 10:49:38 +03:00
Yaron Yarimi
487d9bc6a4 Rename multiple packages to OpenTofu (addrs, backend, command) (#506) 2023-09-21 15:38:46 +03:00
Yaron Yarimi
794e3413bb Rename opentf package to tofu (#466) 2023-09-20 15:16:53 +03:00
Yaron Yarimi
c8acedd885 Rename github.com/placeholderplaceholderplaceholder/opentf to github.com/opentofu/opentofu (#461) 2023-09-20 14:35:35 +03:00
Elbaz
4d9404a59e Fix opentf test crash on nil output (#267)
Co-authored-by: Elbaz <eran.elbaz@env0.com>
2023-09-06 13:40:12 +03:00
Elbaz
20aa339579 Merge remote-tracking branch 'origin/main' into chore-add-is-files-sorted-test
# Conflicts:
#	internal/command/test_test.go
2023-09-05 15:15:35 +03:00
Elbaz
c676d74fc6 Add Tests
Signed-off-by: Elbaz <eran.elbaz@env0.com>
2023-09-03 16:54:24 +03:00
RLRabinowitz
c3ec988d94 Rely on StdOut and StdError in tests, to avoid issues with output order
Signed-off-by: RLRabinowitz <rlrabinowitz2@gmail.com>
2023-09-03 16:37:05 +03:00
RLRabinowitz
650caafafb Test: Refresh-only and refresh:false should fail validation
Signed-off-by: RLRabinowitz <rlrabinowitz2@gmail.com>
2023-09-03 13:20:21 +03:00
RLRabinowitz
08536a74a2 Add test cases for opentf test - refresh-only, and making sure target actually runs a single target
Signed-off-by: RLRabinowitz <rlrabinowitz2@gmail.com>
2023-09-03 13:20:21 +03:00
Elbaz
abf03204d8 expect_runtime_check_pass_command_plan_expected 2023-08-29 12:20:34 +03:00
Elbaz
4988185c58 fix test 2023-08-29 11:47:11 +03:00
Elbaz
a444b7e6f2 expect_runtime_check_fail_command_plan 2023-08-29 11:17:42 +03:00
Elbaz
94400dfebb expect_runtime_check_pass_with_expect 2023-08-29 11:02:42 +03:00
Elbaz
a330254be2 another case 2023-08-29 10:19:26 +03:00
Elbaz
c38b6cd46b fix expected 2023-08-28 16:23:03 +03:00
Elbaz
cf04e25f79 more cases 2023-08-28 16:21:40 +03:00
Elbaz
02c0c44bdd add data test case 2023-08-28 16:11:22 +03:00
Elbaz
5c9a332ad6 added use cases 2023-08-28 16:02:16 +03:00
Elbaz
aea45de290 adding test cases 2023-08-28 15:00:33 +03:00
Marcin Białoń
34b3043be4 Update user-facing references to Terraform in internal/command/views (#88)
* Update `internal/command/views`

Signed-off-by: Marcin Białoń <mbialon@spacelift.io>

* fix tests

Signed-off-by: Marcin Białoń <mbialon@spacelift.io>

* Fix some tests.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Fix some tests.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* update tests golden files

Signed-off-by: Marcin Białoń <mbialon@spacelift.io>

* Fix tests

Signed-off-by: Marcin Białoń <mbialon@spacelift.io>

* Fix tests

Signed-off-by: Marcin Białoń <mbialon@spacelift.io>

* Fix tests

Signed-off-by: Marcin Białoń <mbialon@spacelift.io>

---------

Signed-off-by: Marcin Białoń <mbialon@spacelift.io>
Signed-off-by: Jakub Martin <kubam@spacelift.io>
Co-authored-by: Jakub Martin <kubam@spacelift.io>
2023-08-23 14:49:37 +02:00
Elbaz
a782b8eb38 fix tests 2023-08-23 15:25:05 +03:00
Elbaz
612238fe38 fix more tests 2023-08-22 11:59:26 +03:00
Kuba Martin
ebcf7455eb Rename root module name. (#4)
* Rename module name from "github.com/hashicorp/terraform" to "github.com/placeholderplaceholderplaceholder/opentf".

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Gofmt.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Regenerate protobuf.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Fix comments.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Undo issue and pull request link changes.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Undo comment changes.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Fix comment.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Undo some link changes.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* make generate && make protobuf

Signed-off-by: Jakub Martin <kubam@spacelift.io>

---------

Signed-off-by: Jakub Martin <kubam@spacelift.io>
2023-08-17 14:45:11 +02:00
Liam Cervante
126f34e4e8 Implement updates to testing framework based on recent feedback 2023-08-10 10:49:01 +02:00
Liam Cervante
3bea1171af test framework: expand variables available to test assertions (#33611) 2023-08-01 09:59:29 +02:00
Liam Cervante
4560a83721 test framework: include transformed config before validating config (#33608) 2023-08-01 09:47:00 +02:00
Liam Cervante
f397954c52 testing framework: allow users to specify deeply nested testing directories (#33584) 2023-07-27 10:38:21 +02:00
Liam Cervante
4122ba86fc terraform test: fix crash when using nested modules from test run blocks (#33589) 2023-07-27 10:22:53 +02:00
Liam Cervante
e1019b3641 testing framework: validate the configuration before terraform test (#33559)
* testing framework: call validate on the configuration before running terraform test

* address comments

* make tests pass after merge

* fix tests
2023-07-26 10:56:44 +02:00
Liam Cervante
080ddead6e testing framework: perform a plan before starting any tests (#33561) 2023-07-26 10:24:25 +02:00
Liam Cervante
c91f91cc9e testing framework: change test file extension to .tftest.hcl (#33553) 2023-07-20 16:57:05 +02:00
Liam Cervante
ca85d3bf85 Implement word wrapping in the terraform test view functions (#33547)
* Implement word wrapping in the terraform test view functions

* Update internal/command/views/test.go

Co-authored-by: CJ Horton <17039873+radditude@users.noreply.github.com>

---------

Co-authored-by: CJ Horton <17039873+radditude@users.noreply.github.com>
2023-07-20 08:29:09 +02:00
Liam Cervante
6c7db16566 testing framework: refactor interrupt logic for immediate exits (#33532)
* testing framework: refactor interrupt logic

* fix formatting
2023-07-19 10:31:32 +02:00