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

chore: Separate Test Cases #924

Merged
merged 6 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
199 changes: 0 additions & 199 deletions tests/test-cases/complete.yaml
Original file line number Diff line number Diff line change
@@ -1,203 +1,4 @@
tests:
- name: "which atmos"
enabled: true
description: "Ensure atmos CLI is installed and we're using the one that was built."
workdir: "../"
command: "which"
args:
- "atmos"
expect:
stdout:
- '(build[/\\]atmos|atmos[/\\]atmos)'
stderr:
- "^$"
exit_code: 0

- name: "atmos"
enabled: true
description: "Verify atmos CLI reports missing stacks directory."
workdir: "../"
command: "atmos"
expect:
stdout:
- "atmos.yaml CLI config file specifies the directory for Atmos stacks as stacks,"
- "but the directory does not exist."
stderr:
- "^$"
exit_code: 0

- name: atmos --help
enabled: true
description: "Ensure atmos CLI help command lists available commands."
workdir: "../examples/demo-stacks"
command: "atmos"
args:
- "--help"
expect:
stdout:
- "Available Commands:"
- "\\batlantis\\b"
- "\\baws\\b"
- "\\bcompletion\\b"
- "\\bdescribe\\b"
- "\\bdocs\\b"
- "\\bhelmfile\\b"
- "\\bhelp\\b"
- "\\blist\\b"
- "\\bpro\\b"
- "\\bterraform\\b"
- "\\bvalidate\\b"
- "\\bvendor\\b"
- "\\bversion\\b"
- "\\bworkflow\\b"
- "Flags:"
- "for more information about a command"
stderr:
- "^$"
exit_code: 0

- name: atmos version
enabled: true
description: "Check that atmos version command outputs version details."
workdir: "../examples/demo-stacks"
command: "atmos"
args:
- "version"
expect:
stdout:
- '👽 Atmos (\d+\.\d+\.\d+|test) on [a-z]+/[a-z0-9]+'
stderr:
- "^$"
exit_code: 0

- name: atmos version --check
enabled: true
description: "Verify atmos version --check command functions correctly."
workdir: "../examples/demo-stacks"
command: "atmos"
args:
- "version"
- "--check"
expect:
stdout:
- '👽 Atmos (\d+\.\d+\.\d+|test) on [a-z]+/[a-z0-9]+'
stderr:
- "^$"
exit_code: 0

- name: atmos docs
enabled: false
description: "Ensure atmos docs command executes without errors."
workdir: "../"
command: "atmos"
args:
- "docs"
expect:
exit_code: 0
stderr:
- "^$"

- name: atmos docs myapp
enabled: true
description: "Validate atmos docs command outputs documentation for a specific component."
workdir: "../examples/demo-stacks/"
command: "atmos"
args:
- "docs"
- "myapp"
expect:
stdout:
- "Example Terraform Weather Component"
stderr:
- "^$"
exit_code: 0

- name: atmos non-existent
enabled: true
description: "Ensure atmos CLI returns an error for a non-existent command."
workdir: "../"
command: "atmos"
args:
- "non-existent"
expect:
stderr:
- 'unknown command "non-existent" for "atmos"'
exit_code: 1

- name: atmos terraform non-existent
enabled: false
description: "Ensure atmos CLI returns an error for a non-existent command."
workdir: "../"
command: "atmos"
args:
- "terraform"
- "non-existent"
expect:
stderr:
- 'unknown command "non-existent" for "atmos"'
exit_code: 1

- name: atmos describe config -f yaml
enabled: true
description: "Ensure atmos CLI outputs the Atmos configuration in YAML."
workdir: "../examples/demo-stacks/"
command: "atmos"
args:
- "describe"
- "config"
- "-f"
- "yaml"
expect:
stdout:
- 'append_user_agent: Atmos/(\d+\.\d+\.\d+|test) \(Cloud Posse; \+https:\/\/atmos\.tools\)'
stderr:
- "^$"
exit_code: 0

- name: atmos describe config
enabled: true
description: "Ensure atmos CLI outputs the Atmos configuration in JSON."
workdir: "../examples/demo-stacks/"
command: "atmos"
args:
- "describe"
- "config"
expect:
stdout:
- '"append_user_agent": "Atmos/(\d+\.\d+\.\d+|test) \(Cloud Posse; \+https:\/\/atmos\.tools\)"'
stderr:
- "^$"
exit_code: 0

- name: atmos greet with args
enabled: true
description: "Validate atmos custom command greet runs with argument provided."
workdir: "../examples/demo-custom-command/"
command: "atmos"
args:
- "greet"
- "Andrey"
expect:
stdout:
- "Hello, Andrey\n"
stderr:
- "^$"
exit_code: 0

- name: atmos greet without args
enabled: true
description: "Validate atmos custom command greet runs without argument provided."
workdir: "../examples/demo-custom-command/"
command: "atmos"
args:
- "greet"
expect:
stdout:
- "Hello, John Doe\n"
stderr:
- "^$"
exit_code: 0

- name: atmos circuit-breaker
enabled: true
description: "Ensure atmos breaks the infinite loop when shell depth exceeds maximum (10)."
Expand Down
64 changes: 64 additions & 0 deletions tests/test-cases/core.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
tests:
- name: "which atmos"
enabled: true
description: "Ensure atmos CLI is installed and we're using the one that was built."
workdir: "../"
command: "which"
args:
- "atmos"
expect:
stdout:
- '(build[/\\]atmos|atmos[/\\]atmos)'
stderr:
- "^$"
exit_code: 0

- name: "atmos"
enabled: true
description: "Verify atmos CLI reports missing stacks directory."
workdir: "../"
command: "atmos"
expect:
stdout:
- "atmos.yaml CLI config file specifies the directory for Atmos stacks as stacks,"
- "but the directory does not exist."
stderr:
- "^$"
exit_code: 0

- name: atmos docs
enabled: false
milldr marked this conversation as resolved.
Show resolved Hide resolved
milldr marked this conversation as resolved.
Show resolved Hide resolved
description: "Ensure atmos docs command executes without errors."
workdir: "../"
command: "atmos"
args:
- "docs"
expect:
exit_code: 0
stderr:
- "^$"

- name: atmos non-existent
enabled: true
description: "Ensure atmos CLI returns an error for a non-existent command."
workdir: "../"
command: "atmos"
args:
- "non-existent"
expect:
stderr:
- 'unknown command "non-existent" for "atmos"'
exit_code: 1

- name: atmos terraform non-existent
enabled: false
milldr marked this conversation as resolved.
Show resolved Hide resolved
milldr marked this conversation as resolved.
Show resolved Hide resolved
description: "Ensure atmos CLI returns an error for a non-existent command."
workdir: "../"
command: "atmos"
args:
- "terraform"
- "non-existent"
expect:
stderr:
- 'unknown command "non-existent" for "atmos"'
exit_code: 1
Loading
Loading