mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-19 17:59:05 -05:00
Replace AWS with local provider to fix end-to-end test on darwin_amd64 (#3224)
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
This commit is contained in:
committed by
GitHub
parent
c7afcdf9b4
commit
720961605d
2
.github/workflows/checks.yml
vendored
2
.github/workflows/checks.yml
vendored
@@ -41,7 +41,7 @@ jobs:
|
||||
- id: diff
|
||||
run: |
|
||||
git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin ${{github.event.pull_request.base.ref}}
|
||||
echo "go=$(git diff --name-only origin/${{github.event.pull_request.base.ref}} | grep -e '\.go' -e '\.github' -e 'go\.mod' -e 'go\.sum' -e '\.gitattributes' | wc -l)" | tee -a "$GITHUB_OUTPUT"
|
||||
echo "go=$(git diff --name-only origin/${{github.event.pull_request.base.ref}} | grep -e '\.go' -e '\.github' -e 'go\.mod' -e 'go\.sum' -e '\.tf' -e '\.gitattributes' | wc -l)" | tee -a "$GITHUB_OUTPUT"
|
||||
outputs:
|
||||
go: ${{ steps.diff.outputs.go }}
|
||||
|
||||
|
||||
@@ -53,12 +53,12 @@ func TestFunction_Simple(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestFunction_ProviderDefinedFunctionWithoutConfigure(t *testing.T) {
|
||||
func TestFunction_ProviderUnconfigured(t *testing.T) {
|
||||
// This test reaches out to registry.opentofu.org to download the
|
||||
// test functions provider, so it can only run if network access is allowed
|
||||
skipIfCannotAccessNetwork(t)
|
||||
|
||||
fixturePath := filepath.Join("testdata", "functions_aws")
|
||||
fixturePath := filepath.Join("testdata", "provider_unconfigured_functions")
|
||||
tf := e2e.NewBinary(t, tofuBin, fixturePath)
|
||||
|
||||
// tofu init
|
||||
@@ -88,8 +88,8 @@ func TestFunction_ProviderDefinedFunctionWithoutConfigure(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, out := range plan.Changes.Outputs {
|
||||
if !strings.Contains(string(out.After), "arn:aws:s3:::bucket-prod") {
|
||||
t.Fatalf("unexpected plan output: %s", string(out.After))
|
||||
if !strings.Contains(string(out.After), "exists") {
|
||||
t.Fatalf("unexpected plan output: %s", out.After)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
aws = {
|
||||
source = "hashicorp/aws"
|
||||
version = "6.9.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
variable "bucket_name" {
|
||||
type = string
|
||||
default = "bucket-prod"
|
||||
}
|
||||
|
||||
output "stuff" {
|
||||
value = provider::aws::arn_build("aws", "s3", "", "", var.bucket_name)
|
||||
}
|
||||
12
internal/command/e2etest/testdata/provider_unconfigured_functions/main.tf
vendored
Normal file
12
internal/command/e2etest/testdata/provider_unconfigured_functions/main.tf
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
local = {
|
||||
source = "hashicorp/local"
|
||||
version = "2.5.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
output "stuff" {
|
||||
value = provider::local::direxists("${path.module}/test-folder") ? "exists" : "does not exist"
|
||||
}
|
||||
0
internal/command/e2etest/testdata/provider_unconfigured_functions/test-folder/.gitkeep
vendored
Normal file
0
internal/command/e2etest/testdata/provider_unconfigured_functions/test-folder/.gitkeep
vendored
Normal file
Reference in New Issue
Block a user