Skip to content

Commit 90b465e

Browse files
committed
fix tests
1 parent d24ce5f commit 90b465e

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

tests/terraform_toolchain_integration_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ func TestTerraformToolchain_WithDependencies(t *testing.T) {
141141
func TestTerraformToolchain_WithoutDependencies(t *testing.T) {
142142
defer perf.Track(nil, "tests.TestTerraformToolchain_WithoutDependencies")()
143143

144+
// Skip if running in short mode (CI without terraform).
145+
if testing.Short() {
146+
t.Skip("Skipping toolchain integration test in short mode")
147+
}
148+
144149
workDir := "fixtures/scenarios/toolchain-terraform-integration"
145150
t.Chdir(workDir)
146151

toolchain/set_helpers.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import (
77
"github.com/charmbracelet/bubbles/viewport"
88
tea "github.com/charmbracelet/bubbletea"
99
"github.com/charmbracelet/lipgloss"
10+
11+
errUtils "github.com/cloudposse/atmos/errors"
12+
"github.com/cloudposse/atmos/internal/tui/templates/term"
1013
)
1114

1215
// toolSpec holds resolved owner, repo, and key for a tool.
@@ -99,7 +102,13 @@ func createVersionListModel(owner, repo string, items []versionItem, scrollSpeed
99102
}
100103

101104
// runInteractiveSelection runs the interactive version selection UI and returns the selected version.
105+
// Requires a TTY for interactive input; returns an error in non-TTY environments (CI, piped input).
102106
func runInteractiveSelection(m *versionListModel) (string, error) {
107+
// Check if we have a TTY for interactive selection.
108+
if !term.IsTTYSupportForStdin() {
109+
return "", fmt.Errorf("%w: interactive version selection requires a TTY. Please specify a version explicitly", errUtils.ErrTTYRequired)
110+
}
111+
103112
p := tea.NewProgram(m)
104113
finalModel, err := p.Run()
105114
if err != nil {

0 commit comments

Comments
 (0)