aqua
The atago project wrote these specs on its own initiative and runs them in its own CI, to exercise atago against a real program. They are not aqua’s official test suite, and the aqua project is not affiliated with atago.
Summary #
2 suites · 9 scenarios
Contents #
- aqua (declarative CLI version manager) — 8 scenarios
- version prints without error
- init writes an aqua.yaml with the standard registry
- init is idempotent on an existing config
- policy init writes an aqua-policy.yaml
- root-dir prints the aqua root path
- completion generates a bash script
- which reports an unknown command as not found
- an unknown subcommand is a usage error
- aqua + install (declarative install of a real tool) — 1 scenario
aqua (declarative CLI version manager) #
Source: test/e2e/thirdparty/aqua/aqua.atago.yaml
Scenario: version prints without error #
only when aqua version succeeds
When #
aqua version
Then #
- exit code is
0 - stdout matches
/\S/
Scenario: init writes an aqua.yaml with the standard registry #
only when aqua version succeeds
Given #
- The command runs with an isolated home under
${workdir}/.atago-home(HOME/XDG or APPDATA redirected).
When #
aqua init
Then #
- exit code is
0 - the step changed exactly created
aqua.yaml, modified nothing, deleted nothing - file
aqua.yamlcontainsregistries:,type: standard,packages:
Scenario: init is idempotent on an existing config #
only when aqua version succeeds
Given #
- The command runs with an isolated home under
${workdir}/.atago-home(HOME/XDG or APPDATA redirected).
When #
aqua init
aqua init
Then #
- after
aqua init:- exit code is
0
- exit code is
- after
aqua init:- exit code is
0 - stderr contains
configuration file already exists - the step changed exactly created nothing, modified nothing, deleted nothing
- exit code is
Scenario: policy init writes an aqua-policy.yaml #
only when aqua version succeeds
Given #
- The command runs with an isolated home under
${workdir}/.atago-home(HOME/XDG or APPDATA redirected).
When #
aqua policy init
Then #
- exit code is
0 - the step changed exactly created
aqua-policy.yaml, modified nothing, deleted nothing - file
aqua-policy.yamlcontainsregistries:
Scenario: root-dir prints the aqua root path #
only when aqua version succeeds
When #
aqua root-dir
Then #
- exit code is
0 - stdout contains
aquaproj-aqua
Scenario: completion generates a bash script #
only when aqua version succeeds
When #
aqua completion bash
Then #
- exit code is
0 - stdout contains
completion script
Scenario: which reports an unknown command as not found #
only when aqua version succeeds
Given #
- Fixture file
aqua.yamlis created.
Inputs #
Fixture aqua.yaml:
registries:
- type: standard
ref: v4.531.0
packages:
When #
aqua which definitely-not-a-real-tool-xyz
Then #
- exit code is
1 - stderr contains
command is not found
Scenario: an unknown subcommand is a usage error #
only when aqua version succeeds
When #
aqua bogus-subcommand-xyz
Then #
- exit code is
3 - stderr contains
No help topic
aqua + install (declarative install of a real tool) #
Source: test/e2e/thirdparty/aqua/install.atago.yaml
Scenario: install downloads the tool and makes it runnable #
only when aqua version succeeds
Given #
- Background service
fileserveris started:python3 -m http.server 18595 --bind 127.0.0.1 --directory dist. - Fixture file
dist/mytoolis created. - Fixture file
registry.yamlis created. - Fixture file
aqua.yamlis created. - Fixture file
aqua-policy.yamlis created.
Inputs #
Fixture dist/mytool:
#!/bin/sh
echo installed-tool-ran-ok
Fixture registry.yaml:
packages:
- type: http
name: mytool
url: "http://127.0.0.1:18595/mytool"
files:
- name: mytool
Fixture aqua.yaml:
checksum:
enabled: false
registries:
- type: local
name: local
path: registry.yaml
packages:
- name: mytool@0.1.0
registry: local
Fixture aqua-policy.yaml:
---
registries:
- name: local
type: local
path: registry.yaml
packages:
- registry: local
When #
aqua --config aqua.yaml install
aqua --config aqua.yaml which mytool
aqua --config aqua.yaml exec -- mytool
Then #
- after
aqua --config aqua.yaml install:- exit code is
0 - file
.aqua/pkgs/http/127.0.0.1:18595/mytool/mytoolis checked
- exit code is
- after
aqua --config aqua.yaml which mytool:- exit code is
0 - stdout contains
.aqua/pkgs/http/127.0.0.1:18595/mytool/mytool
- exit code is
- after
aqua --config aqua.yaml exec -- mytool:- exit code is
0 - stdout contains
installed-tool-ran-ok
- exit code is