Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce Output in Atmos Tests #923

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
744855f
added verbose option tests
Cerebrovinny Jan 11, 2025
f0b3c24
output fixes wip
Cerebrovinny Jan 11, 2025
908e3ae
test workflow improvements
Cerebrovinny Jan 11, 2025
260c55c
test workflow improvements
Cerebrovinny Jan 11, 2025
c6c3f94
test verbosity
Cerebrovinny Jan 13, 2025
2690f6a
test verbosity
Cerebrovinny Jan 13, 2025
7d14d35
Add test verbosity control and validate logs-level flag
Cerebrovinny Jan 14, 2025
d063f45
Remove test command from acceptance tests workflow
Cerebrovinny Jan 14, 2025
7a7ad5a
Replace go-test-action with make testacc for acceptance tests
Cerebrovinny Jan 14, 2025
b755565
Add verbose test option and set quiet mode for CI tests
Cerebrovinny Jan 14, 2025
2a4b207
Add go-test-action and simplify test workflow
Cerebrovinny Jan 14, 2025
b7a2f09
refactor: update acceptance test workflow to use test-command parameter
Cerebrovinny Jan 14, 2025
7af82ce
test verbosity
Cerebrovinny Jan 14, 2025
f3348c6
add test action for testing
Cerebrovinny Jan 14, 2025
1593cd6
add test action for testing
Cerebrovinny Jan 14, 2025
bd8839a
add back testacc
Cerebrovinny Jan 14, 2025
fd4602e
revert log changes in cli test
Cerebrovinny Jan 14, 2025
22f5523
Rename TEST_VERBOSITY to ATMOS_TEST_VERBOSITY for consistency
Cerebrovinny Jan 16, 2025
9419720
Move test verbosity documentation from README.md to README.yaml and u…
Cerebrovinny Jan 16, 2025
c687249
Merge branch 'main' into DEV-2909
aknysh Jan 17, 2025
6750c43
fix: suppress config error when help is requested
Cerebrovinny Jan 17, 2025
6be3195
resolve conflicts
Cerebrovinny Jan 20, 2025
4a3dd88
Merge branch 'main' into DEV-2909
aknysh Jan 21, 2025
2e65cee
Merge branch 'main' into DEV-2909
Cerebrovinny Jan 24, 2025
debc554
refactor: improve test output handling and buffering
Cerebrovinny Jan 24, 2025
243160f
Merge branch 'main' into DEV-2909
Cerebrovinny Jan 26, 2025
7f19125
refactor: simplify test output handling and add config-aware test runner
Cerebrovinny Jan 26, 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
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ jobs:
timeout-minutes: 10
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make testacc
run: make testacc ATMOS_TEST_VERBOSITY=quiet

docker:
name: "Docker Lint"
Expand Down Expand Up @@ -503,4 +503,4 @@ jobs:
with:
publish: false
format: binary
secrets: inherit
secrets: inherit
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,4 @@ Copyright © 2017-2024 [Cloud Posse, LLC](https://cpco.io/copyright)

<a href="https://cloudposse.com/readme/footer/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/atmos&utm_content=readme_footer_link"><img alt="README footer" src="https://cloudposse.com/readme/footer/img"/></a>

<img alt="Beacon" width="0" src="https://ga-beacon.cloudposse.com/UA-76589703-4/cloudposse/atmos?pixel&cs=github&cm=readme&an=atmos"/>
<img alt="Beacon" width="0" src="https://ga-beacon.cloudposse.com/UA-76589703-4/cloudposse/atmos?pixel&cs=github&cm=readme&an=atmos"/>
24 changes: 24 additions & 0 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,27 @@ introduction: |-
Find all documentation at: [atmos.tools](https://atmos.tools)

contributors: []

testing:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is testing a supported section in the README.md.tmpl?

content: |-
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a misunderstanding how the README.yaml works. We run this though gomplate and apply this template: https://github.com/cloudposse/.github/blob/main/README.md.gotmpl

There's no section we look for called content or testing.

Also, after updating the README.yaml, run make readme to rebuild it.

Note, we're going to do this with atmos soon, see:

And the confusion here, shows we should have a JSON schema.

## Testing

### Test Verbosity Control

The test suite supports three verbosity levels to control output:

- `quiet`: Minimal output, only shows failures
- `normal`: Standard test output (default)
- `verbose`: Detailed test output with additional debugging information

You can control the verbosity level using the `ATMOS_TEST_VERBOSITY` environment variable:

```bash
# Run tests with minimal output
make test ATMOS_TEST_VERBOSITY=quiet

# Run acceptance tests with verbose output
make testacc ATMOS_TEST_VERBOSITY=verbose
```

This is particularly useful when running tests in CI environments or when debugging specific test failures.
9 changes: 9 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/cloudposse/atmos/internal/tui/templates"
tuiUtils "github.com/cloudposse/atmos/internal/tui/utils"
cfg "github.com/cloudposse/atmos/pkg/config"
"github.com/cloudposse/atmos/pkg/logger"
"github.com/cloudposse/atmos/pkg/schema"
u "github.com/cloudposse/atmos/pkg/utils"
)
Expand Down Expand Up @@ -44,6 +45,14 @@ var RootCmd = &cobra.Command{
cmd.SilenceErrors = true
}

// Validate logs-level flag if provided
if cmd.Flags().Changed("logs-level") {
logsLevel, _ := cmd.Flags().GetString("logs-level")
if _, err := logger.ParseLogLevel(logsLevel); err != nil {
u.LogErrorAndExit(schema.AtmosConfiguration{}, err)
}
}

logsLevel, _ := cmd.Flags().GetString("logs-level")
logsFile, _ := cmd.Flags().GetString("logs-file")

Expand Down
Loading
Loading