2024-02-08 03:48:59 -06:00
|
|
|
// Copyright (c) The OpenTofu Authors
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
// Copyright (c) 2023 HashiCorp, Inc.
|
2023-05-02 10:33:06 -05:00
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2023-12-13 10:35:41 -06:00
|
|
|
// Package e2etest contains a set of tests that run against a real OpenTofu
|
2022-08-17 13:46:02 -05:00
|
|
|
// binary, compiled on the fly at the start of the test run.
|
2017-07-07 20:46:24 -05:00
|
|
|
//
|
2023-12-13 10:35:41 -06:00
|
|
|
// These tests help ensure that key end-to-end OpenTofu use-cases are working
|
2017-07-07 20:46:24 -05:00
|
|
|
// for a real binary, whereas other tests always have at least _some_ amount
|
|
|
|
// of test stubbing.
|
|
|
|
//
|
|
|
|
// The goal of this package is not to duplicate the functional testing done
|
|
|
|
// in other packages but rather to fully exercise a few important workflows
|
|
|
|
// in a realistic way.
|
|
|
|
//
|
|
|
|
// These tests can be used in two ways. The simplest way is to just run them
|
|
|
|
// with "go test" as normal:
|
|
|
|
//
|
2023-09-20 06:35:35 -05:00
|
|
|
// go test -v github.com/opentofu/opentofu/internal/command/e2etest
|
2017-07-07 20:46:24 -05:00
|
|
|
//
|
2023-12-13 10:35:41 -06:00
|
|
|
// This will compile on the fly a OpenTofu binary and run the tests against
|
2017-07-07 20:46:24 -05:00
|
|
|
// it.
|
|
|
|
//
|
|
|
|
// Alternatively, the make-archive.sh script can be used to produce a
|
|
|
|
// self-contained zip file that can be shipped to another machine to run
|
|
|
|
// the tests there without needing a locally-installed Go compiler. This
|
2022-08-17 13:46:02 -05:00
|
|
|
// is primarily useful for testing cross-compiled builds during our release
|
|
|
|
// process. For more information, see the commentary in make-archive.sh.
|
2017-07-07 20:46:24 -05:00
|
|
|
//
|
|
|
|
// The TF_ACC environment variable must be set for the tests to reach out
|
|
|
|
// to external network services. Since these are end-to-end tests, only a
|
|
|
|
// few very basic tests can execute without this environment variable set.
|
|
|
|
package e2etest
|