mirror of
https://github.com/opentofu/setup-opentofu.git
synced 2026-11-30 11:44:26 +01:00
feat(acc): Add provider_acceptance_tests input for automated acceptance test setup (#97)
Signed-off-by: hoivikaj <github@hoivik.co> Signed-off-by: Anthony Hoivik <38190936+hoivikaj@users.noreply.github.com>
This commit is contained in:
1 parent
4bcfe8cded
commit
34bf4e3161
6 files changed
+140
-14
No files matched your search
Vendored
+11
@@ -34811,6 +34811,7 @@ async function run () {
|
||||
const credentialsHostname = getInput('cli_config_credentials_hostname');
|
||||
const credentialsToken = getInput('cli_config_credentials_token');
|
||||
const wrapper = getInput('tofu_wrapper') === 'true';
|
||||
const providerAcceptanceTest = getInput('provider_acceptance_tests') === 'true';
|
||||
const useCache = getInput('cache') === 'true';
|
||||
const checksums = getMultilineInput('checksums');
|
||||
let githubToken = getInput('github_token');
|
||||
@@ -34884,6 +34885,16 @@ async function run () {
|
||||
// Add to path
|
||||
addPath(pathToCLI);
|
||||
|
||||
// Set up provider acceptance test environment variables
|
||||
if (providerAcceptanceTest) {
|
||||
const exeSuffix = (0,external_os_namespaceObject.platform)().startsWith('win') ? '.exe' : '';
|
||||
const binaryName = wrapper ? `tofu-bin${exeSuffix}` : `tofu${exeSuffix}`;
|
||||
exportVariable('TF_ACC', '1');
|
||||
exportVariable('TF_ACC_PROVIDER_NAMESPACE', 'hashicorp');
|
||||
exportVariable('TF_ACC_PROVIDER_HOST', 'registry.opentofu.org');
|
||||
exportVariable('TF_ACC_TERRAFORM_PATH', (0,external_path_namespaceObject.join)(pathToCLI, binaryName));
|
||||
}
|
||||
|
||||
// Add credentials to file if they are provided
|
||||
if (credentialsHostname && credentialsToken) {
|
||||
await addCredentials(credentialsHostname, credentialsToken, osPlatform);
|
||||
|
||||
Reference in new issue
Block a user