Skip to content
Merged
Show file tree
Hide file tree
Changes from 74 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
c35e08a
feat: Adding integration tests
yhakbar Apr 22, 2025
7067ac8
feat: Adding SSH integration test
yhakbar Apr 22, 2025
634cda7
feat: Bumping versions for fixtures
yhakbar Apr 23, 2025
f53e2a9
feat: Adding SOPS integration tests
yhakbar Apr 23, 2025
73e2929
feat: Adding pre-commit hooks
yhakbar Apr 23, 2025
c968174
feat: Upgrading pre-commit
yhakbar Apr 23, 2025
399f056
feat: Adding pre-commit to mise.toml for precommit workflow
yhakbar Apr 23, 2025
7a7bd23
tmp: Pinning feature branch for pre-commit hooks
yhakbar Apr 23, 2025
75a867f
fix: Adjusting usage of `copyEnvironmentWithTflint`
yhakbar Apr 23, 2025
78354e2
fix: Adjusting usage of `copyEnvironmentToPath`
yhakbar Apr 23, 2025
5f8bf30
fix: Adjusting setup for tflint workflow
yhakbar Apr 23, 2025
ab52b5a
fix: Adding `-v` flag
yhakbar Apr 24, 2025
e365744
fix: Adjusting wordsplitting
yhakbar Apr 24, 2025
09eaa79
fix: Fixing race condition for CAS
yhakbar Apr 24, 2025
2018e20
fix: Adding race test
yhakbar Apr 24, 2025
efb5fc2
Merge remote-tracking branch 'origin/main' into feat/adding-integrati…
denis256 May 2, 2025
3f3af57
Pre commit switch to v0.1.29
denis256 May 2, 2025
8082f3d
Base test update
denis256 May 2, 2025
d5668b5
Base test update
denis256 May 2, 2025
8456fde
Base tests update
denis256 May 2, 2025
53c4a8e
Mise CICD
denis256 May 2, 2025
8331fbf
Precommit setup
denis256 May 2, 2025
d92b094
Updated report path
denis256 May 2, 2025
b8889e8
Added uploading of platform specific test results
denis256 May 2, 2025
8c13a8d
Added mise profile
denis256 May 2, 2025
cf96dec
Lint issues
denis256 May 2, 2025
a95f778
Base test update
denis256 May 2, 2025
c86b7c3
pre-commit simplification
denis256 May 2, 2025
e34f916
Goimports install
denis256 May 2, 2025
02bc39b
Output fetching
denis256 May 2, 2025
c3f9d09
Merge remote-tracking branch 'origin/main' into feat/adding-integrati…
denis256 May 5, 2025
c29abad
Add GCP test
denis256 May 5, 2025
dadcb42
GCP cleanup
denis256 May 5, 2025
8df51aa
Integration tests update
denis256 May 5, 2025
88cdb31
add secrets fetching
denis256 May 5, 2025
623bacf
Add auth config
denis256 May 5, 2025
5845404
Cleanup integration
denis256 May 5, 2025
46a3ce1
Secrets update
denis256 May 5, 2025
0cafd29
Tests update
denis256 May 5, 2025
793a234
Tests simplification
denis256 May 5, 2025
da070d5
Add cicd tools to install
denis256 May 5, 2025
e20b112
Add github keys
denis256 May 5, 2025
15dc7c9
updated passing of secrets
denis256 May 5, 2025
61542b0
Updated passing keys
denis256 May 5, 2025
aa12ceb
add engine download step
denis256 May 5, 2025
7066905
Added aws credentials for tflint
denis256 May 5, 2025
8b08116
Removed unused reference to secrets
denis256 May 5, 2025
bdb662c
secrets cleanup
denis256 May 5, 2025
95f3a1d
secrets update
denis256 May 5, 2025
0ffc274
Integration tests update
denis256 May 5, 2025
00c488d
Added run pattern and tags
denis256 May 5, 2025
c3d35c5
Cleanup
denis256 May 5, 2025
0b4e6d4
Cleanup
denis256 May 5, 2025
349251b
Setup update
denis256 May 5, 2025
1075702
Scripts update
denis256 May 5, 2025
e753ec0
Scripts update
denis256 May 5, 2025
1f5e6f4
Add logging of each script
denis256 May 5, 2025
dfb40c8
Add skip flag
denis256 May 5, 2025
a29cf4b
Fixed sops tests
denis256 May 5, 2025
77c61a7
Google project switch
denis256 May 5, 2025
b79d4cf
Creds update
denis256 May 6, 2025
730d5a7
gcp setting
denis256 May 6, 2025
d0bb727
PR fixes
denis256 May 6, 2025
f0838d6
Updated repo path
denis256 May 6, 2025
dede13c
tflint update
denis256 May 6, 2025
50d4fd1
Getter ssh test update
denis256 May 6, 2025
bff9d45
Test update
denis256 May 6, 2025
80f64dc
SSH fix
denis256 May 6, 2025
5be046a
GCP cleanup
denis256 May 6, 2025
e0bb10f
Merge branch 'main' into feat/adding-integration-tests
denis256 May 6, 2025
8359e43
Add secrets sourcing
denis256 May 6, 2025
f27c13f
Add setting of GOOGLE_SERVICE_ACCOUNT_JSON
denis256 May 6, 2025
09cae1a
GCP key generation
denis256 May 6, 2025
2407f3d
Add gcp skip flag
denis256 May 6, 2025
3ab43f8
PR comments
denis256 May 7, 2025
26f2f73
Script update
denis256 May 7, 2025
8a92977
fix: Moving workflow interpolation to env vars
yhakbar May 7, 2025
76c8f8d
fix: Fixing workflow references
yhakbar May 7, 2025
f0ad39e
fix: Adjusting permissions
yhakbar May 7, 2025
eaa59fc
fix: Marking `SCRIPT_PATHS` as optional
yhakbar May 7, 2025
360c437
fix: Join scripts
yhakbar May 7, 2025
679b2b8
fix: Join secrets
yhakbar May 7, 2025
3817f53
fix: Setting `ENV_FILE` appropriately
yhakbar May 7, 2025
48fcee7
fix: Marking `SECRETS` as optional
yhakbar May 7, 2025
4a97781
fix: Marking `SETUP_SCRIPTS` as optional
yhakbar May 7, 2025
9f02c60
fix: Adjusting usage of `SCRIPT_PATHS`
yhakbar May 7, 2025
db7bbf3
fix: Always make the env file
yhakbar May 7, 2025
b8b7b75
fix: Adjusting check for scripts
yhakbar May 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 0 additions & 89 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ env: &env
OPENTOFU_VERSION: "1.9.0"
TERRAFORM_VERSION: "1.11.3"
TFLINT_VERSION: "0.47.0"
TOFU_ENGINE_VERSION: "v0.0.16"

defaults: &defaults
docker:
Expand Down Expand Up @@ -112,12 +111,6 @@ run_integration_awsgcp_test: &run_integration_awsgcp_test
run-go-tests --packages "-tags=awsgcp -run ^TestAwsGcp ./..." | tee logs/test-results.log
no_output_timeout: 30m

run_integration_engine_test: &run_integration_engine_test
name: Run integration tests engine
command: |
run-go-tests --packages "-tags=engine -run ^TestEngine ./test" | tee logs/test-results.log
no_output_timeout: 30m

run_tflint_test: &run_tflint_test
name: Run TFlint tests
command: |
Expand Down Expand Up @@ -202,48 +195,6 @@ jobs:
command: |
go test -tags windows -v -run ^TestWindows ./... -timeout 45m

# We're running unit tests separately from integration tests - with no parallelization.
# With heavy parallelization coupled with re-use of test fixtures we've witnessed slight
# instability with the tests. The unit tests are fast to execute, so there is negligible
# performance penalty.
unit_test:
resource_class: large
<<: *defaults
<<: *env
steps:
- checkout
# Run pre-commit hooks and fail the build if any hook finds required changes.
- run:
name: run precommit
command: |
# Oct 26, 2019: Install the last known working version of pre-commit. Also, we have to pin the version of
# transitive dependencies that are being pulled in which released new versions that are no longer compatible
# with any python < 3.6.
pip3 install pre-commit==1.21.0 cfgv==2.0.1 zipp==1.1.0
go install golang.org/x/tools/cmd/goimports@latest
export GOPATH=~/go/bin && export PATH=$PATH:$GOPATH
pre-commit install
pre-commit run --all-files
- run:
name: generate mocks
command: |
make install-mockery
make generate-mocks
- run:
<<: *install_tofu
- run:
command: |
mkdir -p logs
go mod tidy
run-go-tests --parallelism 1 --packages "$(go list ./... | grep -v /test | tr '\n' ' ')" | tee logs/test-results.log
go test -run=TestParseDependencyBlockMultiple -race ./config | tee -a logs/block-multiple-test-results.log
- run:
<<: *run_terratest_log_parser
- store_artifacts:
path: logs
- store_test_results:
path: logs

integration_test_terraform_1_5:
resource_class: xlarge
<<: *defaults
Expand Down Expand Up @@ -401,25 +352,6 @@ jobs:
- store_test_results:
path: logs

integration_test_tofu_engine:
resource_class: xlarge
<<: *defaults
<<: *env
steps:
- checkout
- run:
<<: *install_tofu
- run:
<<: *setup_test_environment
- run:
<<: *run_integration_engine_test
- run:
<<: *run_terratest_log_parser
- store_artifacts:
path: logs
- store_test_results:
path: logs

integration_test_tofu_gcp:
<<: *defaults
<<: *env
Expand Down Expand Up @@ -748,16 +680,6 @@ workflows:
- AWS__PHXDEVOPS__circle-ci-test
- GCP__automated-tests
- GITHUB__PAT__gruntwork-ci
- unit_test:
filters:
tags:
only:
- /^v.*/
- /^alpha.*/
context:
- AWS__PHXDEVOPS__circle-ci-test
- GCP__automated-tests
- GITHUB__PAT__gruntwork-ci
- integration_test_terraform_1_5:
filters:
tags:
Expand Down Expand Up @@ -868,17 +790,6 @@ workflows:
- AWS__PHXDEVOPS__circle-ci-test
- GCP__automated-tests
- GITHUB__PAT__gruntwork-ci
- integration_test_tofu_engine:
filters:
tags:
only:
- /^v.*/
- /^alpha.*/
context:
- AWS__PHXDEVOPS__circle-ci-test
- GCP__automated-tests
- GITHUB__PAT__gruntwork-ci
- APPLE__OSX__code-signing
- integration_test_tofu_gcp:
filters:
tags:
Expand Down
3 changes: 3 additions & 0 deletions .github/scripts/setup/aws.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

set -euo pipefail
13 changes: 13 additions & 0 deletions .github/scripts/setup/engine.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -euo pipefail
export TOFU_ENGINE_VERSION="v0.0.16"
export REPO="gruntwork-io/terragrunt-engine-opentofu"
export ASSET_NAME="terragrunt-iac-engine-opentofu_rpc_${TOFU_ENGINE_VERSION}_linux_amd64.zip"
pushd .
# Download the engine binary
mkdir -p /tmp/engine
cd /tmp/engine
wget -O "engine.zip" "https://github.com/${REPO}/releases/download/${TOFU_ENGINE_VERSION}/${ASSET_NAME}"
unzip -o "engine.zip"
popd
5 changes: 5 additions & 0 deletions .github/scripts/setup/gcp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

set -euo pipefail
echo "$GCLOUD_SERVICE_KEY" > "${HOME}/gcloud-service-key.json"
export GOOGLE_APPLICATION_CREDENTIALS="${HOME}/gcloud-service-key.json"
5 changes: 5 additions & 0 deletions .github/scripts/setup/sops.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

set -euo pipefail

gpg --import --no-tty --batch --yes ./test/fixtures/sops/test_pgp_key.asc
9 changes: 9 additions & 0 deletions .github/scripts/setup/ssh.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -euo pipefail

SSH_KEY="${GHA_DEPLOY_KEY:?Required environment variable GHA_DEPLOY_KEY}"

mkdir -p ~/.ssh
echo "$SSH_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
5 changes: 5 additions & 0 deletions .github/scripts/setup/tflint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

set -euo pipefail

echo 'tflint = "0.47.0"' >> mise.toml
24 changes: 23 additions & 1 deletion .github/workflows/base-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu, macos]
env:
MISE_PROFILE: cicd

steps:
- name: Checkout code
Expand All @@ -24,6 +26,7 @@ jobs:
uses: jdx/mise-action@v2
with:
version: 2025.4.4
experimental: true
env:
# Adding token here to reduce the likelihood of hitting rate limit issues.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -47,8 +50,27 @@ jobs:
key: ${{ runner.os }}-go-mod-base-test-${{ hashFiles('**/go.sum') }}

- name: Run Tests
run: go test -v ./... -timeout 45m
id: run-tests
run: |
set -o pipefail
go test -v ./... -timeout 45m | tee test-output.log | go-junit-report -set-exit-code > result.xml
shell: bash
env:
# Adding token here to reduce the likelihood of hitting rate limit issues.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload JUnit XML Report
uses: actions/upload-artifact@v4
with:
name: test-report-${{ matrix.os }}
path: result.xml

- name: Display JUnit Results with action-junit-report
uses: mikepenz/action-junit-report@v5
if: always()
with:
report_paths: result.xml
detailed_summary: 'true'
include_time_in_summary: 'true'
group_suite: 'true'

7 changes: 0 additions & 7 deletions .github/workflows/build-no-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,13 @@ jobs:
- id: go-cache-paths
run: |
echo "go-build=$(go env GOCACHE)" >> "$GITHUB_OUTPUT"
echo "go-mod=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"

- name: Go Build Cache
uses: actions/cache@v4
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}-${{ matrix.os }}-${{ matrix.arch }}

- name: Go Mod Cache
uses: actions/cache@v4
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}-${{ matrix.os }}-${{ matrix.arch }}

- name: Build Terragrunt without Go proxy
env:
GOPROXY: direct
Expand Down
Loading
Loading