Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use real terraform in acceptance tests #2267

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Conversation

denik
Copy link
Contributor

@denik denik commented Jan 29, 2025

Changes

  • Add a script install_terraform.py that downloads terraform and provider and generates a config to use, inspired by https://gist.github.com/pietern/1cb6b6f3e0a452328e13cdc75031105e
  • Make acceptance tests run this script once before running the tests and set the required env vars to make cli use this terraform installation.
  • Use OS-specific directory for things that are build by acceptance test runner (CLI and terraform).

This enables acceptance tests against cloud #2242 and local test for bundle deploy #2254.

Tests

  • Add an acceptance test for standalone terraform. This is useful to debug terraform with TF_LOG=DEBUG to see that it uses local provider.
  • Other acceptance tests are updated with regard to terraform exec path.
  • The overall time for tests locally is unchanged (if terraform is already fetched).

@denik denik temporarily deployed to test-trigger-is January 29, 2025 21:34 — with GitHub Actions Inactive
@denik denik force-pushed the denik/acc-terraform branch from 6ca8038 to 77d4931 Compare January 29, 2025 21:40
@denik denik temporarily deployed to test-trigger-is January 29, 2025 21:40 — with GitHub Actions Inactive
@denik denik force-pushed the denik/acc-terraform branch from 77d4931 to 86c8c5c Compare January 29, 2025 21:45
@denik denik temporarily deployed to test-trigger-is January 29, 2025 21:45 — with GitHub Actions Inactive
@denik denik force-pushed the denik/acc-terraform branch from 86c8c5c to c7587b5 Compare January 29, 2025 21:50
@denik denik temporarily deployed to test-trigger-is January 29, 2025 21:50 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is January 29, 2025 21:52 — with GitHub Actions Inactive
@denik denik marked this pull request as ready for review January 29, 2025 22:09
@denik denik temporarily deployed to test-trigger-is January 30, 2025 08:53 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is January 30, 2025 09:00 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is January 30, 2025 09:02 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is January 30, 2025 09:04 — with GitHub Actions Inactive
@denik denik changed the base branch from main to denik/ruff-line-length January 30, 2025 09:05
@denik denik temporarily deployed to test-trigger-is January 30, 2025 09:22 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is January 30, 2025 09:29 — with GitHub Actions Inactive
github-merge-queue bot pushed a commit that referenced this pull request Jan 30, 2025
The default is 88 which reformats too much.

This has no effect on templates but affects Python script in this PR
#2267

For context, we do not set any line length for golang and have 177 .go
files with max line length 150 or more.
Base automatically changed from denik/ruff-line-length to main January 30, 2025 10:00
acceptance/acceptance_test.go Show resolved Hide resolved
acceptance/terraform/main.tf Show resolved Hide resolved
acceptance/install_terraform.py Show resolved Hide resolved
@denik denik temporarily deployed to test-trigger-is January 30, 2025 10:17 — with GitHub Actions Inactive
@denik denik force-pushed the denik/acc-terraform branch from 0c13d7e to ca8aa72 Compare January 30, 2025 10:19
@denik denik temporarily deployed to test-trigger-is January 30, 2025 10:19 — with GitHub Actions Inactive
@denik denik changed the base branch from main to denik/acc-norepl January 30, 2025 10:20
@denik denik requested a review from andrewnester January 30, 2025 10:23
@denik denik temporarily deployed to test-trigger-is January 30, 2025 10:26 — with GitHub Actions Inactive
@denik denik temporarily deployed to test-trigger-is January 30, 2025 10:29 — with GitHub Actions Inactive
Base automatically changed from denik/acc-norepl to main January 30, 2025 10:44
denik added 15 commits January 30, 2025 12:48
to fix this on ubuntu-latest:

        -The current .terraform.lock.hcl file only includes checksums for
        -darwin_arm64, so Terraform running on another platform will fail to install
        -these providers.
        +The current .terraform.lock.hcl file only includes checksums for linux_amd64,
        +so Terraform running on another platform will fail to install these
        +providers.
@denik denik force-pushed the denik/acc-terraform branch from a07f23e to e9e47c5 Compare January 30, 2025 11:51
@denik denik temporarily deployed to test-trigger-is January 30, 2025 11:51 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants