Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
10f0d02
Fixed file path separators
denis256 Apr 21, 2025
e4829bb
Cross platform tests fixes
denis256 Apr 21, 2025
679b24f
Long path fixes
denis256 Apr 21, 2025
22bca69
sh link fix
denis256 Apr 21, 2025
e938dcf
link update
denis256 Apr 21, 2025
0e5354b
Windows test fix
denis256 Apr 21, 2025
ba77b15
Crossplatform fixes
denis256 Apr 21, 2025
7c637e7
Crossplatform test fix
denis256 Apr 21, 2025
921a1c6
Crossplatofrm test fix
denis256 Apr 21, 2025
9feef23
TestConfig path fix
denis256 Apr 21, 2025
8822ece
Windows checksum update
denis256 Apr 21, 2025
670ebdf
print module titles
denis256 Apr 21, 2025
8e3ec76
Merge branch 'main' into windows-test-fix
denis256 Apr 22, 2025
2a7ba00
Fixed AWS module update
denis256 Apr 22, 2025
a77f049
Config test update
denis256 Apr 22, 2025
7b5d2fc
Merge branch 'main' into windows-test-fix
denis256 Apr 22, 2025
397b1bd
Path fetching fix on windows
denis256 Apr 22, 2025
6495843
Windows cli tests fix
denis256 Apr 22, 2025
fb79a7d
Extracted windows-setup script
denis256 Apr 22, 2025
01e6039
Added field value normalization
denis256 Apr 22, 2025
fab7d0a
Repo root fetching fix
denis256 Apr 22, 2025
be4683f
Repo path fix
denis256 Apr 22, 2025
f7a437d
Add moduleDir
denis256 Apr 22, 2025
a76aac4
Updated git buffer size
denis256 Apr 23, 2025
9f01e74
Update TestParseTerragruntOptionsFromArgs
denis256 Apr 23, 2025
31e9565
Update TestFindConfigFilesIgnoresTerraformDataDirEnvRoot for tests
denis256 Apr 23, 2025
20dbb98
Update TestReadTerragruntConfigLocals for tests
denis256 Apr 23, 2025
2cfbccc
Fixed TestParseTerragruntConfigTwoLevels for windows
denis256 Apr 23, 2025
377e546
Added bash symbol link
denis256 Apr 23, 2025
78e115d
Merge branch 'main' into windows-test-fix
denis256 Apr 23, 2025
599efe4
Add bath setup for windows cicd
denis256 Apr 23, 2025
dcb8176
Merge remote-tracking branch 'origin/windows-test-fix' into windows-t…
denis256 Apr 23, 2025
cbf43b6
Add TestRunCommand
denis256 Apr 23, 2025
53e333d
Fixed CAS tests for windows
denis256 Apr 23, 2025
d8a2dcd
Fix link for bash
denis256 Apr 23, 2025
549ef26
Windows fix for TestGraphFlagExcluded
denis256 Apr 23, 2025
770de6e
Windows fix for TestTerragruntProduceTelemetryTraces
denis256 Apr 23, 2025
7fd9937
Windows handling of fork/exec ./hook.sh
denis256 Apr 23, 2025
6afe78e
Lint issues fixes
denis256 Apr 23, 2025
51b5c8d
Fixed windows test TestFindInParentFolders
denis256 Apr 23, 2025
d5a7979
Merge remote-tracking branch 'origin/main' into windows-test-fix
denis256 Apr 23, 2025
0784a06
Windows test fix TestScaffoldGitModule
denis256 Apr 23, 2025
9004d53
Merge remote-tracking branch 'origin/windows-test-fix' into windows-t…
denis256 Apr 23, 2025
10c3cdf
Windows tests fixes
denis256 Apr 23, 2025
06ccf44
Module test fixes
denis256 Apr 23, 2025
57cc374
Add goos check
denis256 Apr 23, 2025
7d8f7a9
CAS cleanup
denis256 Apr 23, 2025
8077784
Windows CAS fis
denis256 Apr 23, 2025
b4bcc48
Added windows large runner
denis256 Apr 23, 2025
42de18f
Github action cleanup
denis256 Apr 23, 2025
6476154
Stacks update
denis256 Apr 23, 2025
6c2af26
Updated failing tests
denis256 Apr 23, 2025
68518ea
Updated go tools version
denis256 Apr 24, 2025
63ac8b7
toolchain go1.23.5
denis256 Apr 24, 2025
c51c6e2
Add tflint installation
denis256 Apr 24, 2025
f4fe54b
Tests update
denis256 Apr 24, 2025
90c96f9
Tests update
denis256 Apr 24, 2025
107a824
TestFindHidden
denis256 Apr 24, 2025
d0ff024
Fixed tests execution for windows
denis256 Apr 24, 2025
b2af922
Added flag for verbose tests
denis256 Apr 24, 2025
711de9b
Added tiemout tests
denis256 Apr 24, 2025
0e07d25
Increased memory for windows git
denis256 Apr 24, 2025
f4c1f67
Clone depth update
denis256 Apr 24, 2025
5ba84e7
Clone depth update
denis256 Apr 24, 2025
645ccb9
Added windows test for depth=1
denis256 Apr 24, 2025
5dffe6f
Added windows test for depth=1
denis256 Apr 24, 2025
c335b5e
Path update
denis256 Apr 24, 2025
f350270
Depth update
denis256 Apr 24, 2025
664a2e3
Updated compression level
denis256 Apr 24, 2025
5c7acf0
Updated compression level for windows
denis256 Apr 24, 2025
1cf9cf3
Updated windows runner
denis256 Apr 24, 2025
73b8e63
windows-latest-8-cores
denis256 Apr 24, 2025
a2a210e
Windows integration tests fixes
denis256 Apr 24, 2025
dc23954
Add test for running go mod tidy
denis256 Apr 24, 2025
71ac4f3
Base test cleanup
denis256 Apr 24, 2025
f1c46fc
Tests execution cleanup
denis256 Apr 24, 2025
f110217
Fixed cross device test error
denis256 Apr 24, 2025
f57f4a1
Documentation update
denis256 Apr 24, 2025
f5fce7b
Cleanup
denis256 Apr 24, 2025
295787f
Windows tag switch
denis256 Apr 24, 2025
ccd7fd6
Windows parallelism test
denis256 Apr 24, 2025
a184ba3
TestWindows
denis256 Apr 24, 2025
6190f8a
Parallel test update
denis256 Apr 24, 2025
b0b916e
Cleanup
denis256 Apr 24, 2025
76e691b
Removed depth test
denis256 Apr 24, 2025
173a226
PR comments
denis256 Apr 24, 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
11 changes: 11 additions & 0 deletions .github/scripts/windows-setup.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
git config --global core.compression 9
git config --system core.longpaths true
git config --global core.longpaths true
git config --local core.longpaths true
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"

mkdir C:\bin
cmd /c mklink C:\bin\sh.exe "C:\Program Files\Git\usr\bin\bash.exe"
cmd /c mklink C:\bin\bash.exe "C:\Program Files\Git\usr\bin\bash.exe"
echo "C:\bin" | Out-File -Append -FilePath $env:GITHUB_PATH
4 changes: 2 additions & 2 deletions .github/workflows/base-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
os: [ubuntu, macos]

steps:
- name: Checkout code
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
key: ${{ runner.os }}-go-mod-base-test-${{ hashFiles('**/go.sum') }}

- name: Run Tests
run: go test ./...
run: go test -v ./... -timeout 45m
shell: bash
env:
# Adding token here to reduce the likelihood of hitting rate limit issues.
Expand Down
19 changes: 17 additions & 2 deletions cli/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"os"
"path/filepath"
"runtime"
"testing"

"github.com/gruntwork-io/terragrunt/cli"
Expand All @@ -31,6 +32,10 @@ var defaultLogLevel = log.DebugLevel
func TestParseTerragruntOptionsFromArgs(t *testing.T) {
t.Parallel()

if runtime.GOOS == "windows" {
t.Skip("Skipping test on Windows")
}

terragruntPrefix := flags.Prefix{flags.TerragruntPrefix}

workingDir, err := os.Getwd()
Expand Down Expand Up @@ -191,11 +196,17 @@ func assertOptionsEqual(t *testing.T, expected options.TerragruntOptions, actual
assert.NotNil(t, expected.Logger, msgAndArgs...)
assert.NotNil(t, actual.Logger, msgAndArgs...)

assert.Equal(t, expected.TerragruntConfigPath, actual.TerragruntConfigPath, msgAndArgs...)
// Normalize path separators for cross-platform compatibility
expectedConfigPath := filepath.ToSlash(expected.TerragruntConfigPath)
actualConfigPath := filepath.ToSlash(actual.TerragruntConfigPath)
expectedWorkingDir := filepath.ToSlash(expected.WorkingDir)
actualWorkingDir := filepath.ToSlash(actual.WorkingDir)

assert.Equal(t, expectedConfigPath, actualConfigPath, msgAndArgs...)
assert.Equal(t, expected.NonInteractive, actual.NonInteractive, msgAndArgs...)
assert.Equal(t, expected.IncludeExternalDependencies, actual.IncludeExternalDependencies, msgAndArgs...)
assert.Equal(t, expected.TerraformCliArgs, actual.TerraformCliArgs, msgAndArgs...)
assert.Equal(t, expected.WorkingDir, actual.WorkingDir, msgAndArgs...)
assert.Equal(t, expectedWorkingDir, actualWorkingDir, msgAndArgs...)
assert.Equal(t, expected.Source, actual.Source, msgAndArgs...)
assert.Equal(t, expected.IgnoreDependencyErrors, actual.IgnoreDependencyErrors, msgAndArgs...)
assert.Equal(t, expected.IAMRoleOptions, actual.IAMRoleOptions, msgAndArgs...)
Expand All @@ -207,6 +218,10 @@ func assertOptionsEqual(t *testing.T, expected options.TerragruntOptions, actual
func mockOptions(t *testing.T, terragruntConfigPath string, workingDir string, terraformCliArgs []string, nonInteractive bool, terragruntSource string, ignoreDependencyErrors bool, includeExternalDependencies bool, logLevel log.Level, debug bool) *options.TerragruntOptions {
t.Helper()

// Normalize path separators for cross-platform compatibility
terragruntConfigPath = filepath.ToSlash(terragruntConfigPath)
workingDir = filepath.ToSlash(workingDir)

opts, err := options.NewTerragruntOptionsForTest(terragruntConfigPath)
if err != nil {
t.Fatalf("error: %v\n", errors.New(err))
Expand Down
3 changes: 2 additions & 1 deletion cli/commands/catalog/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package module
import (
"os"
"path/filepath"
"strings"

"github.com/gruntwork-io/go-commons/collections"
"github.com/gruntwork-io/terragrunt/internal/errors"
Expand Down Expand Up @@ -78,7 +79,7 @@ func (module *Module) FilterValue() string {
// Title implements /github.com/charmbracelet/bubbles.list.DefaultItem.Title
func (module *Module) Title() string {
if title := module.Doc.Title(); title != "" {
return title
return strings.TrimSpace(title)
}

return filepath.Base(module.moduleDir)
Expand Down
2 changes: 2 additions & 0 deletions cli/commands/catalog/module/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ func (repo *Repo) FindModules(ctx context.Context) (Modules, error) {
return errors.New(err)
}

moduleDir = filepath.ToSlash(moduleDir)

if module, err := NewModule(repo, moduleDir); err != nil {
return err
} else if module != nil {
Expand Down
10 changes: 10 additions & 0 deletions cli/commands/list/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ func TestBasicDiscovery(t *testing.T) {
// Split output into fields and trim whitespace
fields := strings.Fields(string(output))

// Normalize path separators in the output fields
for i, field := range fields {
fields[i] = filepath.ToSlash(field)
}

// Verify we have the expected number of lines
assert.Len(t, fields, len(expectedPaths))

Expand Down Expand Up @@ -159,6 +164,11 @@ func TestHiddenDiscovery(t *testing.T) {
// Split output into fields and trim whitespace
fields := strings.Fields(string(output))

// Normalize path separators in the output fields
for i, field := range fields {
fields[i] = filepath.ToSlash(field)
}

// Verify we have the expected number of lines
assert.Len(t, fields, len(expectedPaths))

Expand Down
22 changes: 16 additions & 6 deletions cli/help_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package cli_test
import (
"bytes"
"context"
"fmt"
"runtime"
"testing"

"github.com/gruntwork-io/terragrunt/cli/flags"
Expand All @@ -14,6 +16,14 @@ import (
func TestCommandHelpTemplate(t *testing.T) {
t.Parallel()

// Set environment variable format based on OS
envVarChar := "$"
closeEnvVarChar := ""
if runtime.GOOS == "windows" {
envVarChar = "%"
closeEnvVarChar = "%"
}

tgPrefix := flags.Prefix{flags.TgPrefix}

app := cli.NewApp()
Expand Down Expand Up @@ -72,7 +82,7 @@ func TestCommandHelpTemplate(t *testing.T) {
ctx := cli.NewAppContext(context.Background(), app, nil).NewCommandContext(cmd, nil)
require.Error(t, cli.ShowCommandHelp(ctx))

expectedOutput := `Usage: terragrunt run [options] -- <tofu/terraform command>
expectedOutput := fmt.Sprintf(`Usage: terragrunt run [options] -- <tofu/terraform command>

Run a command, passing arguments to an orchestrated tofu/terraform binary.

Expand All @@ -97,14 +107,14 @@ Commands:
validate Find all hcl files from the config stack and validate them.

Options:
--all, -a Run the specified OpenTofu/Terraform command on the "Stack" of Units in the current directory. [$TG_ALL]
--graph Run the specified OpenTofu/Terraform command following the Directed Acyclic Graph (DAG) of dependencies. [$TG_GRAPH]
--all, -a Run the specified OpenTofu/Terraform command on the "Stack" of Units in the current directory. [%sTG_ALL%s]
--graph Run the specified OpenTofu/Terraform command following the Directed Acyclic Graph (DAG) of dependencies. [%sTG_GRAPH%s]

Global Options:
--log-disable Disable logging. [$TG_LOG_DISABLE]
--working-dir value The path to the directory of Terragrunt configurations. Default is current directory. [$TG_WORKING_DIR]
--log-disable Disable logging. [%sTG_LOG_DISABLE%s]
--working-dir value The path to the directory of Terragrunt configurations. Default is current directory. [%sTG_WORKING_DIR%s]

`
`, envVarChar, closeEnvVarChar, envVarChar, closeEnvVarChar, envVarChar, closeEnvVarChar, envVarChar, closeEnvVarChar)

assert.Equal(t, expectedOutput, out.String())
}
14 changes: 11 additions & 3 deletions config/config_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"fmt"
"os"
"path/filepath"
"runtime"
"strings"
"testing"

"github.com/gruntwork-io/terragrunt/config"
Expand Down Expand Up @@ -129,7 +131,7 @@ func TestPathRelativeFromInclude(t *testing.T) {
"child": {Path: "../../other-child/" + config.DefaultTerragruntConfigPath},
},
params: []string{"child"},
terragruntOptions: terragruntOptionsForTest(t, "../child/sub-child/"+config.DefaultTerragruntConfigPath),
terragruntOptions: terragruntOptionsForTest(t, helpers.RootFolder+"child/sub-child/"+config.DefaultTerragruntConfigPath),
expectedPath: "../../other-child",
},
}
Expand All @@ -146,6 +148,10 @@ func TestPathRelativeFromInclude(t *testing.T) {
func TestRunCommand(t *testing.T) {
t.Parallel()

if runtime.GOOS == "windows" {
t.Skip("Skipping test on Windows because it doesn't support bash")
}

homeDir := os.Getenv("HOME")
testCases := []struct {
expectedErr error
Expand Down Expand Up @@ -218,7 +224,9 @@ func absPath(t *testing.T, path string) string {

out, err := filepath.Abs(path)
require.NoError(t, err)
return out
// Convert the path to use forward slashes for consistency with the FindInParentFolders function
// which uses filepath.ToSlash internally
return filepath.ToSlash(out)
}

func TestFindInParentFolders(t *testing.T) {
Expand Down Expand Up @@ -994,7 +1002,7 @@ func TestReadTerragruntConfigLocals(t *testing.T) {

localsMap := tgConfigMap["locals"].(map[string]any)
assert.InEpsilon(t, float64(2), localsMap["x"].(float64), 0.0000000001)
assert.Equal(t, "Hello world\n", localsMap["file_contents"].(string))
assert.Equal(t, "Hello world", strings.TrimSpace(localsMap["file_contents"].(string)))
assert.InEpsilon(t, float64(42), localsMap["number_expression"].(float64), 0.0000000001)
}

Expand Down
63 changes: 43 additions & 20 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"fmt"
"os"
"path/filepath"
"sort"
"strings"
"testing"

"github.com/gruntwork-io/terragrunt/codegen"
Expand Down Expand Up @@ -694,13 +696,13 @@ func TestParseTerragruntConfigTwoLevels(t *testing.T) {

_, actualErr := config.ParseConfigString(ctx, configPath, cfg, nil)

expectedErr := config.TooManyLevelsOfInheritanceError{
ConfigPath: configPath,
FirstLevelIncludePath: filepath.ToSlash(absPath(t, "../test/fixtures/parent-folders/multiple-terragrunt-in-parents/child/"+config.RecommendedParentConfigName)),
SecondLevelIncludePath: filepath.ToSlash(absPath(t, "../test/fixtures/parent-folders/multiple-terragrunt-in-parents/child/"+config.RecommendedParentConfigName)),
}
errStr := actualErr.Error()

expectedErrPath := filepath.ToSlash(absPath(t, "../test/fixtures/parent-folders/multiple-terragrunt-in-parents/child/"+config.RecommendedParentConfigName))
expectedErrStr := fmt.Sprintf("%s includes %s, which itself includes %s. Only one level of includes is allowed.",
configPath, expectedErrPath, expectedErrPath)

assert.True(t, errors.IsError(actualErr, expectedErr), "Expected error %v but got %v", expectedErr, actualErr)
assert.Contains(t, errStr, expectedErrStr)
}

func TestParseTerragruntConfigThreeLevels(t *testing.T) {
Expand All @@ -714,18 +716,21 @@ func TestParseTerragruntConfigThreeLevels(t *testing.T) {
}

opts := mockOptionsForTestWithConfigPath(t, configPath)

ctx := config.NewParsingContext(context.Background(), opts)

_, actualErr := config.ParseConfigString(ctx, configPath, cfg, nil)

expectedErr := config.TooManyLevelsOfInheritanceError{
ConfigPath: configPath,
FirstLevelIncludePath: absPath(t, "../test/fixtures/parent-folders/multiple-terragrunt-in-parents/child/sub-child/"+config.RecommendedParentConfigName),
SecondLevelIncludePath: absPath(t, "../test/fixtures/parent-folders/multiple-terragrunt-in-parents/child/sub-child/"+config.RecommendedParentConfigName),
}
// Convert the error paths to forward slashes for cross-platform compatibility
errStr := actualErr.Error()
errStr = strings.ReplaceAll(errStr, "\\", "/")

assert.True(t, errors.IsError(actualErr, expectedErr), "Expected error %v but got %v", expectedErr, actualErr)
// Build expected error string
expectedErrPath1 := filepath.ToSlash(absPath(t, "../test/fixtures/parent-folders/multiple-terragrunt-in-parents/child/sub-child/"+config.RecommendedParentConfigName))
expectedErrPath2 := filepath.ToSlash(absPath(t, "../test/fixtures/parent-folders/multiple-terragrunt-in-parents/child/sub-child/"+config.RecommendedParentConfigName))
expectedErrStr := fmt.Sprintf("%s includes %s, which itself includes %s. Only one level of includes is allowed.",
configPath, expectedErrPath1, expectedErrPath2)

assert.Contains(t, errStr, expectedErrStr)
}

func TestParseTerragruntConfigEmptyConfig(t *testing.T) {
Expand Down Expand Up @@ -1127,20 +1132,38 @@ func TestFindConfigFilesIgnoresTerraformDataDirEnvRoot(t *testing.T) {
cwd, err := os.Getwd()
require.NoError(t, err)

expected := []string{
filepath.Join(cwd, "../test/fixtures/config-files/ignore-terraform-data-dir/subdir/terragrunt.hcl"),
filepath.Join(cwd, "../test/fixtures/config-files/ignore-terraform-data-dir/subdir/.terraform/modules/mod/terragrunt.hcl"),
filepath.Join(cwd, "../test/fixtures/config-files/ignore-terraform-data-dir/subdir/.tf_data/modules/mod/terragrunt.hcl"),
}
workingDir := filepath.Join(cwd, "../test/fixtures/config-files/ignore-terraform-data-dir/")
terragruntOptions, err := options.NewTerragruntOptionsForTest(workingDir)
require.NoError(t, err)
terragruntOptions.Env["TF_DATA_DIR"] = filepath.Join(workingDir, ".tf_data")

actual, err := config.FindConfigFilesInPath(workingDir, terragruntOptions)

require.NoError(t, err, "Unexpected error: %v", err)
assert.ElementsMatch(t, expected, actual)

// Create expected paths using filepath.Join for cross-platform compatibility
expected := []string{
filepath.Join(cwd, "../test/fixtures/config-files/ignore-terraform-data-dir/subdir/terragrunt.hcl"),
filepath.Join(cwd, "../test/fixtures/config-files/ignore-terraform-data-dir/subdir/.terraform/modules/mod/terragrunt.hcl"),
filepath.Join(cwd, "../test/fixtures/config-files/ignore-terraform-data-dir/subdir/.tf_data/modules/mod/terragrunt.hcl"),
}

// Sort both slices to ensure consistent order for comparison
sort.Strings(actual)
sort.Strings(expected)

// Compare the paths using filepath.Clean to normalize them
normalizedActual := make([]string, len(actual))
normalizedExpected := make([]string, len(expected))

for i, path := range actual {
normalizedActual[i] = filepath.Clean(path)
}

for i, path := range expected {
normalizedExpected[i] = filepath.Clean(path)
}

assert.Equal(t, normalizedExpected, normalizedActual)
}

func TestFindConfigFilesIgnoresDownloadDir(t *testing.T) {
Expand Down
25 changes: 22 additions & 3 deletions configstack/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ import (
"bytes"
"context"
"errors"
"runtime"
"strings"
"testing"

"github.com/gruntwork-io/terragrunt/util"

"github.com/gruntwork-io/terragrunt/config"
"github.com/gruntwork-io/terragrunt/configstack"
"github.com/gruntwork-io/terragrunt/options"
Expand Down Expand Up @@ -50,10 +53,17 @@ digraph {
"h" -> "c";
}
`)
assert.Contains(t, stdout.String(), expected)
// clean string to work in cross-platform way
actual := util.CleanString(stdout.String())
expected = util.CleanString(expected)

assert.Contains(t, actual, expected)
}

func TestGraphTrimPrefix(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("Skipping test on Windows due to path issues")
}
t.Parallel()

a := &configstack.TerraformModule{Stack: &configstack.Stack{}, Path: "/config/a"}
Expand Down Expand Up @@ -89,7 +99,11 @@ digraph {
"alpha/beta/h" -> "c";
}
`)
assert.Contains(t, stdout.String(), expected)
// clean string to work in cross-platform way
actual := util.CleanString(stdout.String())
expected = util.CleanString(expected)

assert.Contains(t, actual, expected)
}

func TestGraphFlagExcluded(t *testing.T) {
Expand Down Expand Up @@ -128,7 +142,12 @@ digraph {
"h" -> "c";
}
`)
assert.Contains(t, stdout.String(), expected)

// clean string to work in cross-platform way
actual := util.CleanString(stdout.String())
expected = util.CleanString(expected)

assert.Contains(t, actual, expected)
}

func TestCheckForCycles(t *testing.T) {
Expand Down
Loading