Skip to content

Commit

Permalink
fix windows
Browse files Browse the repository at this point in the history
  • Loading branch information
denik committed Jan 30, 2025
1 parent 501973b commit 4537807
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 5 additions & 1 deletion acceptance/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ func testAccept(t *testing.T, InprocessMode bool, singleTest string) int {
require.NoError(t, err)

// Download terraform and provider and create config; this also creates build directory.
RunCommand(t, []string{filepath.Join(cwd, "install_terraform.py")}, ".")
if runtime.GOOS == "windows" {
RunCommand(t, []string{"python", filepath.Join(cwd, "install_terraform.py")}, ".")
} else {
RunCommand(t, []string{filepath.Join(cwd, "install_terraform.py")}, ".")
}

buildDir := filepath.Join(cwd, "build")
coverDir := os.Getenv("CLI_GOCOVERDIR")
Expand Down
12 changes: 4 additions & 8 deletions acceptance/install_terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,10 @@

os_name = platform.system().lower()

current_arch = platform.machine().lower()
arch_mapping = {
"x86_64": "amd64",
"amd64": "amd64",
"arm64": "arm64",
"aarch64": "arm64",
}
arch = arch_mapping.get(current_arch, current_arch)
arch = platform.machine().lower()
if os_name == 'windows' and arch not in ('386', 'amd64'):
# terraform 1.5.5 only has builds for these two.
arch = 'amd64'

terraform_version = "1.5.5"
terraform_file = f"terraform_{terraform_version}_{os_name}_{arch}.zip"
Expand Down

0 comments on commit 4537807

Please sign in to comment.