Skip to content

Commit

Permalink
Fix last non-working test :D
Browse files Browse the repository at this point in the history
  • Loading branch information
jocgir committed Oct 5, 2024
1 parent 2ee324a commit 7a35e42
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 23 deletions.
26 changes: 18 additions & 8 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ on:
branches:
- master
- main
env:
GoVersion: '1.23'

jobs:
static:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.23'
go-version: ${{ env.GoVersion }}
cache: false
- uses: actions/checkout@v4

- name: Run static checks
Expand All @@ -22,7 +25,8 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.23'
go-version: ${{ env.GoVersion }}
cache: false
- uses: actions/checkout@v4

- run: make build
Expand All @@ -32,7 +36,8 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.23'
go-version: ${{ env.GoVersion }}
cache: false
- uses: actions/checkout@v4

- run: make fmt
Expand All @@ -48,7 +53,9 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.23'
go-version: ${{ env.GoVersion }}
cache: false

- uses: actions/checkout@v4

- name: Install Terraform
Expand All @@ -64,11 +71,13 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.23'
go-version: ${{ env.GoVersion }}
cache: false

- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
version: '~> v2'
args: check

goreleaser-test-release:
Expand All @@ -79,12 +88,13 @@ jobs:
fetch-depth: 0 # goreleaser needs the whole history to build the release notes
- uses: actions/setup-go@v5
with:
go-version: '1.23'
go-version: ${{ env.GoVersion }}
cache: false

- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
version: '~> v2'
args: release --snapshot --clean

- uses: actions/upload-artifact@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: false

- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion cli/cli_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ AUTHOR(S):
`

// This uses the constraint syntax from https://github.com/hashicorp/go-version
const defaultTerraformVersionConstraint = ">= v1.9.0"
const defaultTerraformVersionConstraint = ">= v1.7.0"

var terragruntVersion string
var terragruntRunID string
Expand Down
12 changes: 6 additions & 6 deletions configstack/stack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ func TestFindStackInSubfolders(t *testing.T) {
t.Parallel()

filePaths := []string{
"stage/data-stores/redis/" + config.DefaultConfigName,
"stage/data-stores/postgres/" + config.DefaultConfigName,
"stage/ecs-cluster/" + config.DefaultConfigName,
"stage/kms-master-key/" + config.DefaultConfigName,
"stage/vpc/" + config.DefaultConfigName,
"/stage/data-stores/redis/" + config.DefaultConfigName,
"/stage/data-stores/postgres/" + config.DefaultConfigName,
"/stage/ecs-cluster/" + config.DefaultConfigName,
"/stage/kms-master-key/" + config.DefaultConfigName,
"/stage/vpc/" + config.DefaultConfigName,
}

tempFolder := createTempFolder()
Expand All @@ -37,10 +37,10 @@ func TestFindStackInSubfolders(t *testing.T) {

var modulePaths []string

tempFolder = strings.TrimSuffix(tempFolder, "/")
for _, module := range stack.Modules {
relPath := strings.Replace(module.Path, tempFolder, "", 1)
relPath = filepath.ToSlash(util.JoinPath(relPath, config.DefaultConfigName))

modulePaths = append(modulePaths, relPath)
}

Expand Down
16 changes: 8 additions & 8 deletions test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,16 @@ func TestTerragruntCustomConfig(t *testing.T) {
- path: fixture-custom-config/sub-project-1
- path: fixture-custom-config/sub-project-2/sub-project-2-1
dependencies:
- fixture-custom-config/sub-project-1
- fixture-custom-config/sub-project-1
- path: fixture-custom-config/sub-project-2/sub-project-2-2
dependencies:
- fixture-custom-config/sub-project-2/sub-project-2-1
- fixture-custom-config/sub-project-1
- fixture-custom-config/sub-project-2/sub-project-2-1
- fixture-custom-config/sub-project-1
- path: fixture-custom-config/sub-project-3
dependencies:
- fixture-custom-config/sub-project-2/sub-project-2-1
- fixture-custom-config/sub-project-2/sub-project-2-2
- fixture-custom-config/sub-project-1
- fixture-custom-config/sub-project-2/sub-project-2-1
- fixture-custom-config/sub-project-2/sub-project-2-2
- fixture-custom-config/sub-project-1
`)+"\n", out.String())
assert.Equal(t, "", err.String())
}
Expand Down Expand Up @@ -301,11 +301,11 @@ func TestDownloads(t *testing.T) {
},
{
path: "fixture-download/remote",
expectedOutput: `^test = <<EOT\nhello remote from remote$`,
expectedOutput: `^test = "Hello, remote"$`,
},
{
path: "fixture-download/remote-relative",
expectedOutput: `^test = <<EOT\nhello remote from remote-relative$`,
expectedOutput: `^test = "Hello, remote-relative"$`,
},
{
path: "fixture-download/override",
Expand Down

0 comments on commit 7a35e42

Please sign in to comment.