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) #

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.yaml contains registries:, 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
  • after aqua init:
    • exit code is 0
    • stderr contains configuration file already exists
    • the step changed exactly created nothing, modified nothing, deleted nothing

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.yaml contains registries:

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.yaml is 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 fileserver is started: python3 -m http.server 18595 --bind 127.0.0.1 --directory dist.
  • Fixture file dist/mytool is created.
  • Fixture file registry.yaml is created.
  • Fixture file aqua.yaml is created.
  • Fixture file aqua-policy.yaml is 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/mytool is checked
  • after aqua --config aqua.yaml which mytool:
    • exit code is 0
    • stdout contains .aqua/pkgs/http/127.0.0.1:18595/mytool/mytool
  • after aqua --config aqua.yaml exec -- mytool:
    • exit code is 0
    • stdout contains installed-tool-ran-ok