Skip to content

Commit

Permalink
add import config test
Browse files Browse the repository at this point in the history
  • Loading branch information
haitham911 committed Feb 21, 2025
1 parent 5e134f5 commit 413f955
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@ func sanitizeOutput(output string) (string, error) {
fixedRemainder := collapseExtraSlashes(groups[2])
return groups[1] + fixedRemainder
})
// 6. Remove the random number added to file name like `atmos-import-454656846`
filePathRegex := regexp.MustCompile(`file_path=[^ ]+/atmos-import-\d+/atmos-import-\d+\.yaml`)
result = filePathRegex.ReplaceAllString(result, "file_path=/atmos-import/atmos-import.yaml")

return result, nil
}
Expand Down
28 changes: 28 additions & 0 deletions tests/test-cases/atmos-cli-imports.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# yaml-language-server: $schema=schema.json
tests:
- name: atmos_describe_config_imports
snapshot: true
enabled: true
description: "Ensure atmos execute import configuration"
workdir: "fixtures/scenarios/atmos-cli-imports"
command: "atmos"
args:
- "describe"
- "config"
- "-f"
- "yaml"
expect:
exit_code: 0
- name: atmos_describe_configuration
snapshot: true
enabled: true
description: "Ensure atmos configuration"
workdir: "fixtures/scenarios/atmos-configuration"
command: "atmos"
args:
- "describe"
- "config"
- "-f"
- "yaml"
expect:
exit_code: 0

0 comments on commit 413f955

Please sign in to comment.