Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
e87e944
updates
aknysh Feb 25, 2025
2e57423
Merge remote-tracking branch 'refs/remotes/origin/main' into update-o…
aknysh Feb 26, 2025
9018295
updates
aknysh Feb 26, 2025
5c12452
updates
aknysh Feb 27, 2025
33b3cad
Merge remote-tracking branch 'refs/remotes/origin/main' into update-o…
aknysh Feb 28, 2025
8103901
updates
aknysh Feb 28, 2025
180e9a9
Merge remote-tracking branch 'refs/remotes/origin/main' into update-o…
aknysh Feb 28, 2025
a0230c8
updates
aknysh Feb 28, 2025
d3ec699
Merge remote-tracking branch 'refs/remotes/origin/main' into update-o…
aknysh Mar 1, 2025
4afa07c
updates
aknysh Mar 1, 2025
9c05401
Merge remote-tracking branch 'refs/remotes/origin/main' into update-o…
aknysh Mar 1, 2025
3213361
Merge remote-tracking branch 'refs/remotes/origin/main' into update-o…
aknysh Mar 1, 2025
7a3b0e6
updates
aknysh Mar 1, 2025
3ab1324
Merge remote-tracking branch 'refs/remotes/origin/main' into update-o…
aknysh Mar 3, 2025
a0abd71
updates
aknysh Mar 3, 2025
d2ac755
updates
aknysh Mar 3, 2025
dbae24c
Merge remote-tracking branch 'refs/remotes/origin/main' into update-o…
aknysh Mar 4, 2025
60c79e2
Merge remote-tracking branch 'refs/remotes/origin/main' into update-o…
aknysh Mar 5, 2025
83dcb7d
Merge remote-tracking branch 'refs/remotes/origin/main' into update-o…
aknysh Mar 5, 2025
b7fd479
updates
aknysh Mar 5, 2025
dfd7810
updates
aknysh Mar 6, 2025
a78edea
updates
aknysh Mar 6, 2025
ba71825
updates
aknysh Mar 6, 2025
6d1ceea
Merge remote-tracking branch 'refs/remotes/origin/main' into update-o…
aknysh Mar 6, 2025
7fc7609
Merge remote-tracking branch 'refs/remotes/origin/main' into update-o…
aknysh Mar 6, 2025
7b8a753
Merge remote-tracking branch 'refs/remotes/origin/main' into update-o…
aknysh Mar 7, 2025
6b04e9d
updates
aknysh Mar 8, 2025
13ccd7a
updates
aknysh Mar 8, 2025
96fc196
updates
aknysh Mar 8, 2025
815a0b3
updates
aknysh Mar 8, 2025
0cf449a
add unit tests
aknysh Mar 9, 2025
6ef13c4
add unit tests
aknysh Mar 10, 2025
bb7e0e9
add unit tests
aknysh Mar 10, 2025
ea8edbb
add unit tests
aknysh Mar 10, 2025
66aa85c
Merge remote-tracking branch 'origin/main' into update-overrides-in-i…
aknysh Mar 10, 2025
693b0b5
Merge branch 'main' into update-overrides-in-imports
aknysh Mar 10, 2025
327a616
Merge remote-tracking branch 'origin/update-overrides-in-imports' int…
aknysh Mar 11, 2025
e4e9ea9
add unit tests
aknysh Mar 11, 2025
bbebfde
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 11, 2025
af023e2
add unit tests
aknysh Mar 11, 2025
ffc4471
Merge remote-tracking branch 'origin/update-overrides-in-imports' int…
aknysh Mar 11, 2025
df94fc4
add unit tests
aknysh Mar 11, 2025
930fbd7
add unit tests
aknysh Mar 11, 2025
beae59b
add unit tests
aknysh Mar 11, 2025
cfa2360
add unit tests
aknysh Mar 11, 2025
e796963
Update pkg/utils/markdown_utils.go
aknysh Mar 11, 2025
295446e
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 11, 2025
46f3f1f
add unit tests
aknysh Mar 11, 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
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ issues:
- funlen
- revive
- gci
- errcheck

output:
formats:
Expand Down
5 changes: 3 additions & 2 deletions cmd/about.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package cmd
import (
_ "embed"

"github.com/cloudposse/atmos/pkg/utils"
"github.com/spf13/cobra"

"github.com/cloudposse/atmos/pkg/utils"
)

//go:embed markdown/about.md
Expand All @@ -17,7 +18,7 @@ var aboutCmd = &cobra.Command{
Long: `Display information about Atmos, its features, and benefits.`,
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
utils.PrintfMarkdown(aboutMarkdown)
utils.PrintfMarkdown("%s", aboutMarkdown)
return nil
},
}
Expand Down
35 changes: 35 additions & 0 deletions cmd/about_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package cmd

import (
"bytes"
"io"
"os"
"testing"

"github.com/stretchr/testify/assert"
)

func TestAboutCmd(t *testing.T) {
// Capture stdout since utils.PrintfMarkdown writes directly to os.Stdout
oldStdout := os.Stdout
r, w, _ := os.Pipe()
os.Stdout = w

// Execute the command
err := aboutCmd.RunE(aboutCmd, []string{})
assert.NoError(t, err, "'atmos about' command should execute without error")

// Close the writer and restore stdout
err = w.Close()
assert.NoError(t, err, "'atmos about' command should execute without error")

os.Stdout = oldStdout

// Read captured output
var output bytes.Buffer
_, err = io.Copy(&output, r)
assert.NoError(t, err, "'atmos about' command should execute without error")

// Check if output contains expected markdown content
assert.Contains(t, output.String(), aboutMarkdown, "'atmos about' output should contain information about Atmos")
}
5 changes: 3 additions & 2 deletions cmd/support.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package cmd
import (
_ "embed"

"github.com/cloudposse/atmos/pkg/utils"
"github.com/spf13/cobra"

"github.com/cloudposse/atmos/pkg/utils"
)

//go:embed markdown/support.md
Expand All @@ -20,7 +21,7 @@ var supportCmd = &cobra.Command{
SilenceUsage: true,
SilenceErrors: true,
RunE: func(cmd *cobra.Command, args []string) error {
utils.PrintfMarkdown(supportMarkdown)
utils.PrintfMarkdown("%s", supportMarkdown)
return nil
},
}
Expand Down
35 changes: 35 additions & 0 deletions cmd/support_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package cmd

import (
"bytes"
"io"
"os"
"testing"

"github.com/stretchr/testify/assert"
)

func TestSupportCmd(t *testing.T) {
// Capture stdout since utils.PrintfMarkdown writes directly to os.Stdout
oldStdout := os.Stdout
r, w, _ := os.Pipe()
os.Stdout = w

// Execute the command
err := supportCmd.RunE(supportCmd, []string{})
assert.NoError(t, err, "'atmos support' command should execute without error")

// Close the writer and restore stdout
err = w.Close()
assert.NoError(t, err, "'atmos support' command should execute without error")

os.Stdout = oldStdout

// Read captured output
var output bytes.Buffer
_, err = io.Copy(&output, r)
assert.NoError(t, err, "'atmos support' command should execute without error")

// Check if output contains expected markdown content
assert.Contains(t, output.String(), supportMarkdown, "'atmos support' output should contain information about Cloud Posse Atmos support")
}
51 changes: 51 additions & 0 deletions cmd/workflow_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package cmd

import (
"bytes"
"io"
"os"
"testing"

"github.com/stretchr/testify/assert"
)

func TestWorkflowCmd(t *testing.T) {
stacksPath := "../tests/fixtures/scenarios/atmos-overrides-section"

err := os.Setenv("ATMOS_CLI_CONFIG_PATH", stacksPath)
assert.NoError(t, err, "Setting 'ATMOS_CLI_CONFIG_PATH' environment variable should execute without error")

err = os.Setenv("ATMOS_BASE_PATH", stacksPath)
assert.NoError(t, err, "Setting 'ATMOS_BASE_PATH' environment variable should execute without error")

// Capture stdout
oldStdout := os.Stdout
r, w, _ := os.Pipe()
os.Stdout = w

expectedOutput := `atmos describe component c1 -s prod
atmos describe component c1 -s staging
atmos describe component c1 -s dev
atmos describe component c1 -s sandbox
atmos describe component c1 -s test
`

// Execute the command
RootCmd.SetArgs([]string{"workflow", "--file", "workflows", "show-all-describe-component-commands"})
err = RootCmd.Execute()
assert.NoError(t, err, "'atmos workflow' command should execute without error")

// Close the writer and restore stdout
err = w.Close()
assert.NoError(t, err, "'atmos workflow' command should execute without error")

os.Stdout = oldStdout

// Read captured output
var output bytes.Buffer
_, err = io.Copy(&output, r)
assert.NoError(t, err, "'atmos workflow' command should execute without error")

// Check if output contains expected markdown content
assert.Contains(t, output.String(), expectedOutput, "'atmos workflow' output should contain information about workflows")
}
2 changes: 1 addition & 1 deletion examples/quick-start-advanced/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG GEODESIC_OS=debian
# https://atmos.tools/
# https://github.com/cloudposse/atmos
# https://github.com/cloudposse/atmos/releases
ARG ATMOS_VERSION=1.164.0
ARG ATMOS_VERSION=1.165.3

# Terraform: https://github.com/hashicorp/terraform/releases
ARG TF_VERSION=1.5.7
Expand Down
69 changes: 34 additions & 35 deletions go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading