add shellspec golden harness for the legacy make engine
- spec/golden/cases.txt: 69 black-box cases (CLI wrapper mode and make include mode) run in a hermetic sandbox with a mocked docker - spec/golden/expected/*.txt recorded from this engine (baseline) - make test / test-golden / golden-record / lint dev targets
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
# Intentional differences between the legacy make engine and the bash CLI
|
||||
|
||||
Golden expectations in `expected/` are recorded from the legacy engine
|
||||
(`git tag legacy-1.0-beta`). When the CLI intentionally behaves differently,
|
||||
the case gets an override in `expected.cli/<case>.txt` and a line here.
|
||||
|
||||
| case | delta | why |
|
||||
|---|---|---|
|
||||
@@ -0,0 +1,70 @@
|
||||
# name | fixture | args
|
||||
host-print-project | host-project | print-COMPOSE_PROJECT_NAME STACK=host/consul
|
||||
host-print-compose-file | host-project | print-COMPOSE_FILE STACK=host/consul
|
||||
host-print-stack-dir | host-project | print-STACK_DIR STACK=host/consul
|
||||
host-print-env-vars | host-project | print-ENV_VARS STACK=host/consul
|
||||
host-print-suffix | host-project | print-COMPOSE_FILE_SUFFIX STACK=host/consul
|
||||
host-print-network-default | host-project | print-DOCKER_NETWORK_DEFAULT STACK=host/consul
|
||||
host-print-network-private | host-project | print-DOCKER_NETWORK_PRIVATE STACK=host/consul
|
||||
host-print-network-public | host-project | print-DOCKER_NETWORK_PUBLIC STACK=host/consul
|
||||
host-print-host-stack | host-project | print-HOST_STACK STACK=host/consul
|
||||
host-print-app | host-project | print-APP STACK=host/consul
|
||||
host-up-consul | host-project | up STACK=host/consul
|
||||
host-up-two | host-project | up STACK="host/consul host/fabio"
|
||||
host-up-group | host-project | up STACK=host
|
||||
host-target | host-project | host
|
||||
host-down-group | host-project | down STACK=host
|
||||
host-config | host-project | config STACK=host/fabio
|
||||
host-ps | host-project | ps STACK=host/consul
|
||||
host-logs | host-project | logs STACK=host/consul
|
||||
host-stack-host-config | host-project | stack-host-config
|
||||
host-exec | host-project | exec STACK=host/consul SERVICE=consul ARGS='consul members'
|
||||
host-env-master | host-project | print-COMPOSE_FILE STACK=host/consul ENV=master
|
||||
host-print-project-env-master | host-project | print-COMPOSE_PROJECT_NAME STACK=host/consul ENV=master
|
||||
app-print-project | app-git | print-COMPOSE_PROJECT_NAME
|
||||
app-print-compose-file | app-git | print-COMPOSE_FILE
|
||||
app-print-app | app-git | print-APP
|
||||
app-print-stack | app-git | print-STACK
|
||||
app-up | app-git | up
|
||||
app-up-env-master | app-git | up ENV=master
|
||||
app-config | app-git | config
|
||||
app-down | app-git | down
|
||||
app-run | app-git | run SERVICE=app ARGS='id'
|
||||
app-scale | app-git | scale SERVICE=app NUM=2
|
||||
app-print-service-name | app-git | print-COMPOSE_SERVICE_NAME
|
||||
app-print-repository | app-git | print-DOCKER_REPOSITORY
|
||||
nogit-print-project | app-nogit | print-COMPOSE_PROJECT_NAME
|
||||
nogit-print-app | app-nogit | print-APP
|
||||
nogit-up | app-nogit | up
|
||||
cat-postgres-compose-file | app-nogit | print-COMPOSE_FILE STACK=postgres
|
||||
cat-postgres-project | app-nogit | print-COMPOSE_PROJECT_NAME STACK=postgres
|
||||
cat-postgres-up | app-nogit | up STACK=postgres
|
||||
cat-postgres-version | app-nogit | print-COMPOSE_FILE STACK=postgres:9.6
|
||||
cat-postgres-env-master | app-nogit | print-COMPOSE_FILE STACK=postgres ENV=master
|
||||
cat-user-project | app-nogit | print-COMPOSE_PROJECT_NAME STACK=User/User
|
||||
cat-user-compose-file | app-nogit | print-COMPOSE_FILE STACK=User/User
|
||||
cat-user-network | app-nogit | print-DOCKER_NETWORK STACK=User/User
|
||||
cat-group-testing | app-nogit | print-COMPOSE_FILE STACK=testing
|
||||
cat-group-testing-up | app-nogit | up STACK=testing
|
||||
cat-group-default-up | app-nogit | up STACK=default
|
||||
cat-drone-version | app-nogit | print-COMPOSE_FILE STACK=drone/drone:1.6
|
||||
cat-drone-env-vars | app-nogit | print-ENV_VARS STACK=drone/drone
|
||||
cat-nginx-www | app-nogit | print-COMPOSE_FILE STACK=host/nginx COMPOSE_FILE_WWW=true
|
||||
cat-nginx-www-dns | app-nogit | print-COMPOSE_FILE STACK=host/nginx COMPOSE_FILE_WWW=true COMPOSE_FILE_DNS=true
|
||||
cat-nginx-project | app-nogit | print-COMPOSE_PROJECT_NAME STACK=host/nginx
|
||||
cat-unknown-stack | app-nogit | print-COMPOSE_FILE STACK=doesnotexist
|
||||
cat-unknown-target | app-nogit | doesnotexist
|
||||
misc-help | app-nogit | help
|
||||
inc-app-print-project | app-git | @make print-COMPOSE_PROJECT_NAME
|
||||
inc-app-print-compose-file | app-git | @make print-COMPOSE_FILE
|
||||
inc-app-print-app | app-git | @make print-APP
|
||||
inc-app-up | app-git | @make up
|
||||
inc-app-up-env-master | app-git | @make up ENV=master
|
||||
inc-app-config | app-git | @make config
|
||||
inc-app-down | app-git | @make down
|
||||
inc-app-ps | app-git | @make ps
|
||||
inc-app-print-service-name | app-git | @make print-COMPOSE_SERVICE_NAME
|
||||
inc-app-print-env-vars | app-git | @make print-ENV_VARS
|
||||
inc-app-print-network-default | app-git | @make print-DOCKER_NETWORK_DEFAULT
|
||||
inc-app-stack-postgres-up | app-git | @make up STACK=postgres
|
||||
inc-app-unknown-target | app-git | @make doesnotexist
|
||||
@@ -0,0 +1,3 @@
|
||||
make -o docker-stack-config MAKE_OLDFILE=docker-stack-config ENV=local DOCKER_COMPOSE=docker --log-level=error compose docker-compose-config STACK=myos APP_NAME=myos
|
||||
docker --log-level=error compose --ansi=auto -f @MYOS@/stack/myos/networks.yml -p tester-myos-local config
|
||||
[exit 0]
|
||||
@@ -0,0 +1,3 @@
|
||||
make -o docker-stack-down MAKE_OLDFILE=docker-stack-down ENV=local DOCKER_COMPOSE=docker --log-level=error compose docker-compose-down STACK=myos APP_NAME=myos
|
||||
docker --log-level=error compose --ansi=auto -f @MYOS@/stack/myos/networks.yml -p tester-myos-local down
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
APP myos
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_FILE @MYOS@/stack/myos/networks.yml
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_PROJECT_NAME tester-myos-local
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
DOCKER_REPOSITORY tester/myos/local
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_SERVICE_NAME tester-myos-local
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
STACK myos
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
docker --log-level=error compose --ansi=auto -f @MYOS@/stack/myos/networks.yml -p tester-myos-local run --rm app id
|
||||
[exit 0]
|
||||
@@ -0,0 +1,3 @@
|
||||
make -o docker-stack-scale MAKE_OLDFILE=docker-stack-scale ENV=local DOCKER_COMPOSE=docker --log-level=error compose docker-compose-scale STACK=myos APP_NAME=myos
|
||||
docker --log-level=error compose --ansi=auto -f @MYOS@/stack/myos/networks.yml -p tester-myos-local up -d --scale app=2
|
||||
[exit 0]
|
||||
@@ -0,0 +1,5 @@
|
||||
make -o docker-stack-up MAKE_OLDFILE=docker-stack-up ENV=master DOCKER_COMPOSE=docker --log-level=error compose docker-compose-up STACK=myos APP_NAME=myos
|
||||
sh -c docker network create tester-master >/dev/null 2>&1
|
||||
sh -c docker network create testhost >/dev/null 2>&1
|
||||
docker --log-level=error compose --ansi=auto -f @MYOS@/stack/myos/networks.yml -p tester-myos-master up -d
|
||||
[exit 0]
|
||||
@@ -0,0 +1,5 @@
|
||||
make -o docker-stack-up MAKE_OLDFILE=docker-stack-up ENV=local DOCKER_COMPOSE=docker --log-level=error compose docker-compose-up STACK=myos APP_NAME=myos
|
||||
sh -c docker network create tester-local >/dev/null 2>&1
|
||||
sh -c docker network create testhost >/dev/null 2>&1
|
||||
docker --log-level=error compose --ansi=auto -f @MYOS@/stack/myos/networks.yml -p tester-myos-local up -d
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
ENV_VARS DOCKER_NETWORK_DEFAULT DOCKER_NETWORK_PRIVATE DOCKER_NETWORK_PUBLIC DRONE_SERVER_HOST DRONE_VERSION
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
make/apps/common.mk:54: *** multiple target patterns. Stop.
|
||||
[exit 2]
|
||||
@@ -0,0 +1,5 @@
|
||||
make -o docker-stack-up MAKE_OLDFILE=docker-stack-up ENV=local DOCKER_COMPOSE=docker --log-level=error compose docker-compose-up STACK=default APP_NAME=default
|
||||
sh -c docker network create tester-local >/dev/null 2>&1
|
||||
sh -c docker network create testhost >/dev/null 2>&1
|
||||
docker --log-level=error compose --ansi=auto -f @HOME@/.local/share/myos/stack/postgres/postgres.yml -f @HOME@/.local/share/myos/stack/postgres/postgres.local.yml -f @HOME@/.local/share/myos/stack/redis/redis.yml -f @MYOS@/stack/myos/networks.yml -p tester-default-local up -d
|
||||
[exit 0]
|
||||
@@ -0,0 +1,5 @@
|
||||
make -o docker-stack-up MAKE_OLDFILE=docker-stack-up ENV=local DOCKER_COMPOSE=docker --log-level=error compose docker-compose-up STACK=testing APP_NAME=testing
|
||||
sh -c docker network create tester-local >/dev/null 2>&1
|
||||
sh -c docker network create testhost >/dev/null 2>&1
|
||||
docker --log-level=error compose --ansi=auto -f @HOME@/.local/share/myos/stack/drone/drone.yml -f @HOME@/.local/share/myos/stack/redis/redis.yml -f @MYOS@/stack/myos/networks.yml -p tester-testing-local up -d
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_FILE @HOME@/.local/share/myos/stack/drone/drone.yml @HOME@/.local/share/myos/stack/redis/redis.yml @MYOS@/stack/myos/networks.yml
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_PROJECT_NAME testhost
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_FILE @HOME@/.local/share/myos/stack/host/nginx.yml @HOME@/.local/share/myos/stack/host/nginx.www.yml @HOME@/.local/share/myos/stack/host/nginx.dns.yml @MYOS@/stack/myos/networks.yml @MYOS@/stack/myos/volumes.www.local.yml @MYOS@/stack/myos/volumes.dns.local.yml
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_FILE @HOME@/.local/share/myos/stack/host/nginx.yml @HOME@/.local/share/myos/stack/host/nginx.www.yml @MYOS@/stack/myos/networks.yml @MYOS@/stack/myos/volumes.www.local.yml
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_FILE @HOME@/.local/share/myos/stack/postgres/postgres.yml @HOME@/.local/share/myos/stack/postgres/postgres.local.yml @MYOS@/stack/myos/networks.yml
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_FILE @HOME@/.local/share/myos/stack/postgres/postgres.yml @MYOS@/stack/myos/networks.yml
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_PROJECT_NAME tester-myos-local
|
||||
[exit 0]
|
||||
@@ -0,0 +1,5 @@
|
||||
make -o docker-stack-up MAKE_OLDFILE=docker-stack-up ENV=local DOCKER_COMPOSE=docker --log-level=error compose docker-compose-up STACK=postgres APP_NAME=postgres
|
||||
sh -c docker network create tester-local >/dev/null 2>&1
|
||||
sh -c docker network create testhost >/dev/null 2>&1
|
||||
docker --log-level=error compose --ansi=auto -f @HOME@/.local/share/myos/stack/postgres/postgres.yml -f @HOME@/.local/share/myos/stack/postgres/postgres.local.yml -f @MYOS@/stack/myos/networks.yml -p tester-postgres-local up -d
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
make/apps/common.mk:54: *** multiple target patterns. Stop.
|
||||
[exit 2]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_FILE @MYOS@/stack/myos/networks.yml
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
WARNING: myos[0] doesnotexist-rule-exists: target doesnotexist unavailable in app myos
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_FILE @HOME@/.local/share/myos/stack/User/User.yml @MYOS@/stack/myos/networks.yml
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
DOCKER_NETWORK tester
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_PROJECT_NAME tester-example-test
|
||||
[exit 0]
|
||||
@@ -0,0 +1,3 @@
|
||||
make -o docker-stack-config MAKE_OLDFILE=docker-stack-config ENV=local DOCKER_COMPOSE=docker --log-level=error compose docker-compose-config STACK=host/fabio APP_NAME=host
|
||||
docker --log-level=error compose --ansi=auto -f @WD@/stack/host/fabio.yml -f @MYOS@/stack/myos/networks.yml -p testhost config
|
||||
[exit 0]
|
||||
@@ -0,0 +1,3 @@
|
||||
make -o docker-stack-down MAKE_OLDFILE=docker-stack-down ENV=local DOCKER_COMPOSE=docker --log-level=error compose docker-compose-down STACK=host APP_NAME=host
|
||||
docker --log-level=error compose --ansi=auto -f @WD@/stack/host/consul.yml -f @WD@/stack/host/fabio.yml -f @WD@/stack/host/registrator.yml -f @MYOS@/stack/myos/networks.yml -p testhost down
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_FILE @WD@/stack/host/consul.yml @MYOS@/stack/myos/networks.yml
|
||||
[exit 0]
|
||||
@@ -0,0 +1,5 @@
|
||||
docker --log-level=error compose --ansi=auto -f @WD@/stack/host/consul.yml -f @MYOS@/stack/myos/networks.yml -p testhost exec -T consul sh -c consul members
|
||||
/bin/bash: -c: line 0: syntax error near unexpected token `||'
|
||||
/bin/bash: -c: line 0: `|| true'
|
||||
make: *** [exec] Error 2
|
||||
[exit 2]
|
||||
@@ -0,0 +1,3 @@
|
||||
make -o docker-stack-logs MAKE_OLDFILE=docker-stack-logs ENV=local DOCKER_COMPOSE=docker --log-level=error compose docker-compose-logs STACK=host/consul APP_NAME=host
|
||||
docker --log-level=error compose --ansi=auto -f @WD@/stack/host/consul.yml -f @MYOS@/stack/myos/networks.yml -p testhost logs --follow --tail=100
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
APP myos
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_FILE @WD@/stack/host/consul.yml @MYOS@/stack/myos/networks.yml
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
ENV_VARS DOCKER_NETWORK_DEFAULT DOCKER_NETWORK_PRIVATE DOCKER_NETWORK_PUBLIC DRONE_SERVER_HOST HOST_COMPOSE_PROJECT_NAME HOST_CONSUL_HTTP_TOKEN
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
HOST_STACK host
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
DOCKER_NETWORK_DEFAULT _testhost
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
DOCKER_NETWORK_PRIVATE tester-local
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
DOCKER_NETWORK_PUBLIC testhost
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_PROJECT_NAME testhost
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_PROJECT_NAME testhost
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
STACK_DIR @MYOS@/stack @HOME@/.local/share/myos/stack @WD@/stack
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_FILE_SUFFIX app labels networks ssh volumes
|
||||
[exit 0]
|
||||
@@ -0,0 +1,3 @@
|
||||
make -o docker-stack-ps MAKE_OLDFILE=docker-stack-ps ENV=local DOCKER_COMPOSE=docker --log-level=error compose docker-compose-ps STACK=host/consul APP_NAME=host
|
||||
docker --log-level=error compose --ansi=auto -f @WD@/stack/host/consul.yml -f @MYOS@/stack/myos/networks.yml -p testhost ps
|
||||
[exit 0]
|
||||
@@ -0,0 +1,4 @@
|
||||
make -o stack-host-config MAKE_OLDFILE=stack-host-config ENV=local DOCKER_COMPOSE=docker --log-level=error compose COMPOSE_IGNORE_ORPHANS=true host=host/consul host/fabio host/registrator config STACK=host
|
||||
make -o stack-host-config MAKE_OLDFILE=stack-host-config ENV=local DOCKER_COMPOSE=docker --log-level=error compose docker-compose-config STACK=host APP_NAME=host
|
||||
docker --log-level=error compose --ansi=auto -f @WD@/stack/host/consul.yml -f @WD@/stack/host/fabio.yml -f @WD@/stack/host/registrator.yml -f @MYOS@/stack/myos/networks.yml -p testhost config
|
||||
[exit 0]
|
||||
@@ -0,0 +1,14 @@
|
||||
make -o host MAKE_OLDFILE=host ENV=local DOCKER_COMPOSE=docker --log-level=error compose up STACK=host/consul host/fabio host/registrator
|
||||
make -o host MAKE_OLDFILE=host ENV=local DOCKER_COMPOSE=docker --log-level=error compose docker-compose-up STACK=host/consul APP_NAME=host
|
||||
sh -c docker network create tester-local >/dev/null 2>&1
|
||||
sh -c docker network create testhost >/dev/null 2>&1
|
||||
docker --log-level=error compose --ansi=auto -f @WD@/stack/host/consul.yml -f @MYOS@/stack/myos/networks.yml -p testhost up -d
|
||||
make -o host MAKE_OLDFILE=host ENV=local DOCKER_COMPOSE=docker --log-level=error compose docker-compose-up STACK=host/fabio APP_NAME=host
|
||||
sh -c docker network create tester-local >/dev/null 2>&1
|
||||
sh -c docker network create testhost >/dev/null 2>&1
|
||||
docker --log-level=error compose --ansi=auto -f @WD@/stack/host/fabio.yml -f @MYOS@/stack/myos/networks.yml -p testhost up -d
|
||||
make -o host MAKE_OLDFILE=host ENV=local DOCKER_COMPOSE=docker --log-level=error compose docker-compose-up STACK=host/registrator APP_NAME=host
|
||||
sh -c docker network create tester-local >/dev/null 2>&1
|
||||
sh -c docker network create testhost >/dev/null 2>&1
|
||||
docker --log-level=error compose --ansi=auto -f @WD@/stack/host/registrator.yml -f @MYOS@/stack/myos/networks.yml -p testhost up -d
|
||||
[exit 0]
|
||||
@@ -0,0 +1,5 @@
|
||||
make -o docker-stack-up MAKE_OLDFILE=docker-stack-up ENV=local DOCKER_COMPOSE=docker --log-level=error compose docker-compose-up STACK=host/consul APP_NAME=host
|
||||
sh -c docker network create tester-local >/dev/null 2>&1
|
||||
sh -c docker network create testhost >/dev/null 2>&1
|
||||
docker --log-level=error compose --ansi=auto -f @WD@/stack/host/consul.yml -f @MYOS@/stack/myos/networks.yml -p testhost up -d
|
||||
[exit 0]
|
||||
@@ -0,0 +1,5 @@
|
||||
make -o docker-stack-up MAKE_OLDFILE=docker-stack-up ENV=local DOCKER_COMPOSE=docker --log-level=error compose docker-compose-up STACK=host APP_NAME=host
|
||||
sh -c docker network create tester-local >/dev/null 2>&1
|
||||
sh -c docker network create testhost >/dev/null 2>&1
|
||||
docker --log-level=error compose --ansi=auto -f @WD@/stack/host/consul.yml -f @WD@/stack/host/fabio.yml -f @WD@/stack/host/registrator.yml -f @MYOS@/stack/myos/networks.yml -p testhost up -d
|
||||
[exit 0]
|
||||
@@ -0,0 +1,9 @@
|
||||
make -o docker-stack-up MAKE_OLDFILE=docker-stack-up ENV=local DOCKER_COMPOSE=docker --log-level=error compose docker-compose-up STACK=host/consul APP_NAME=host
|
||||
sh -c docker network create tester-local >/dev/null 2>&1
|
||||
sh -c docker network create testhost >/dev/null 2>&1
|
||||
docker --log-level=error compose --ansi=auto -f @WD@/stack/host/consul.yml -f @WD@/stack/host/fabio.yml -f @MYOS@/stack/myos/networks.yml -p testhost up -d
|
||||
make -o docker-stack-up MAKE_OLDFILE=docker-stack-up ENV=local DOCKER_COMPOSE=docker --log-level=error compose docker-compose-up STACK=host/fabio APP_NAME=host
|
||||
sh -c docker network create tester-local >/dev/null 2>&1
|
||||
sh -c docker network create testhost >/dev/null 2>&1
|
||||
docker --log-level=error compose --ansi=auto -f @WD@/stack/host/consul.yml -f @WD@/stack/host/fabio.yml -f @MYOS@/stack/myos/networks.yml -p testhost up -d
|
||||
[exit 0]
|
||||
@@ -0,0 +1,3 @@
|
||||
make -o docker-stack-config MAKE_OLDFILE=docker-stack-config ENV=local DOCKER_COMPOSE=docker --log-level=error compose app-wd-config
|
||||
docker --log-level=error compose --ansi=auto -f ././docker-compose.yml -f ././docker-compose.local.yml -f ./docker/docker-compose.yml -p tester-wd-local config
|
||||
[exit 0]
|
||||
@@ -0,0 +1,3 @@
|
||||
make -o docker-stack-down MAKE_OLDFILE=docker-stack-down ENV=local DOCKER_COMPOSE=docker --log-level=error compose app-wd-down
|
||||
docker --log-level=error compose --ansi=auto -f ././docker-compose.yml -f ././docker-compose.local.yml -f ./docker/docker-compose.yml -p tester-wd-local down
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
APP wd
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_FILE ./docker-compose.yml ./docker-compose.local.yml docker/docker-compose.yml
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
ENV_VARS DOCKER_NETWORK_DEFAULT DOCKER_NETWORK_PRIVATE DOCKER_NETWORK_PUBLIC DRONE_SERVER_HOST
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
DOCKER_NETWORK_DEFAULT _tester-wd-local
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_PROJECT_NAME tester-wd-local
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_SERVICE_NAME tester-wd-local
|
||||
[exit 0]
|
||||
@@ -0,0 +1,3 @@
|
||||
make -o docker-stack-ps MAKE_OLDFILE=docker-stack-ps ENV=local DOCKER_COMPOSE=docker --log-level=error compose app-wd-ps
|
||||
docker --log-level=error compose --ansi=auto -f ././docker-compose.yml -f ././docker-compose.local.yml -f ./docker/docker-compose.yml -p tester-wd-local ps
|
||||
[exit 0]
|
||||
@@ -0,0 +1,5 @@
|
||||
make -o docker-stack-up MAKE_OLDFILE=docker-stack-up ENV=local DOCKER_COMPOSE=docker --log-level=error compose docker-compose-up STACK=postgres APP_NAME=postgres
|
||||
sh -c docker network create tester-local >/dev/null 2>&1
|
||||
sh -c docker network create testhost >/dev/null 2>&1
|
||||
docker --log-level=error compose --ansi=auto -f ./docker-compose.yml -f ./docker-compose.local.yml -f docker/docker-compose.yml -p tester-postgres-local up -d
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
WARNING: wd[0] doesnotexist-rule-exists: target doesnotexist unavailable in app wd
|
||||
[exit 0]
|
||||
@@ -0,0 +1,3 @@
|
||||
make -o docker-stack-up MAKE_OLDFILE=docker-stack-up ENV=master DOCKER_COMPOSE=docker --log-level=error compose app-wd-up
|
||||
docker --log-level=error compose --ansi=auto -f ././docker-compose.yml -f ./docker/docker-compose.yml -p tester-wd-master up -d
|
||||
[exit 0]
|
||||
@@ -0,0 +1,3 @@
|
||||
make -o docker-stack-up MAKE_OLDFILE=docker-stack-up ENV=local DOCKER_COMPOSE=docker --log-level=error compose app-wd-up
|
||||
docker --log-level=error compose --ansi=auto -f ././docker-compose.yml -f ././docker-compose.local.yml -f ./docker/docker-compose.yml -p tester-wd-local up -d
|
||||
[exit 0]
|
||||
@@ -0,0 +1,52 @@
|
||||
Usage:
|
||||
make [target]
|
||||
|
||||
Targets:
|
||||
test Run unit + golden tests
|
||||
test-unit Run unit tests only
|
||||
test-golden Run golden tests only (MYOS_ENGINE=legacy|cli)
|
||||
test-integration Run tests needing a real docker daemon
|
||||
golden-record Re-record golden expectations from the legacy engine
|
||||
lint shellcheck all shell sources
|
||||
help This help
|
||||
attach Attach to docker SERVICE
|
||||
bootstrap Configure system
|
||||
build Build application docker images
|
||||
clean Clean application and docker stuffs
|
||||
config View application docker compose file
|
||||
connect Connect to docker SERVICE
|
||||
deploy Deploy application dockers
|
||||
down Remove application dockers
|
||||
exec Exec command in docker SERVICE
|
||||
install Install application
|
||||
logs Display application dockers logs
|
||||
rebuild Rebuild application dockers images
|
||||
reinstall Reinstall application
|
||||
release Create release VERSION
|
||||
restart Restart application
|
||||
run Run a command in a new docker
|
||||
scale Scale SERVICE application to NUM dockers
|
||||
shutdown Shutdown all dockers
|
||||
start Start application dockers
|
||||
stop Stop application dockers
|
||||
tests Test application
|
||||
up Create application dockers
|
||||
update Update application files
|
||||
upgrade Upgrade application
|
||||
ssh Connect to first remote host
|
||||
|
||||
Context:
|
||||
ENV local
|
||||
ENV_PATH @WD@
|
||||
DOCKER_MACHINE x86_64
|
||||
DOCKER_SOCKET_LOCATION /var/run/docker.sock
|
||||
DOCKER_SYSTEM Linux
|
||||
DOMAIN example.test
|
||||
APP myos
|
||||
APPS c411 dsh myos wbr wbr.old
|
||||
BRANCH lightning
|
||||
VERSION legacy-1.0-beta
|
||||
RELEASE
|
||||
COMPOSE_FILE @MYOS@/stack/myos/networks.yml
|
||||
DOCKER_REPOSITORY tester/myos/local
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
APP myos
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_PROJECT_NAME tester-myos-local
|
||||
[exit 0]
|
||||
@@ -0,0 +1,5 @@
|
||||
make -o docker-stack-up MAKE_OLDFILE=docker-stack-up ENV=local DOCKER_COMPOSE=docker --log-level=error compose docker-compose-up STACK=myos APP_NAME=myos
|
||||
sh -c docker network create tester-local >/dev/null 2>&1
|
||||
sh -c docker network create testhost >/dev/null 2>&1
|
||||
docker --log-level=error compose --ansi=auto -f @MYOS@/stack/myos/networks.yml -p tester-myos-local up -d
|
||||
[exit 0]
|
||||
@@ -0,0 +1,32 @@
|
||||
#shellcheck shell=sh
|
||||
# Golden tests: every case of cases.txt must produce the recorded output.
|
||||
# MYOS_ENGINE=legacy (default) runs the make engine, MYOS_ENGINE=cli runs bin/myos.
|
||||
# For the cli engine, spec/golden/expected.cli/<case>.txt overrides the legacy
|
||||
# expectation when a delta is intentional (documented in DELTAS.md).
|
||||
Describe 'golden'
|
||||
engine=${MYOS_ENGINE:-legacy}
|
||||
expected_file() {
|
||||
if [ "$engine" = cli ] && [ -f "$SHELLSPEC_PROJECT_ROOT/spec/golden/expected.cli/$1.txt" ]; then
|
||||
printf '%s\n' "$SHELLSPEC_PROJECT_ROOT/spec/golden/expected.cli/$1.txt"
|
||||
else
|
||||
printf '%s\n' "$SHELLSPEC_PROJECT_ROOT/spec/golden/expected/$1.txt"
|
||||
fi
|
||||
}
|
||||
run_case() {
|
||||
sb=$(myos_sandbox "$2")
|
||||
eval "set -- $3"
|
||||
myos_run_engine "$engine" "$sb" "$@"
|
||||
rm -rf "$sb"
|
||||
}
|
||||
Parameters:dynamic
|
||||
while IFS='|' read -r name fixture args; do
|
||||
name=$(echo "$name" | tr -d ' '); fixture=$(echo "$fixture" | tr -d ' ')
|
||||
[ -z "$name" ] || [ "${name#\#}" != "$name" ] && continue
|
||||
%data "$name" "$fixture" "$args"
|
||||
done < "$SHELLSPEC_PROJECT_ROOT/spec/golden/cases.txt"
|
||||
End
|
||||
It "matches recorded output: $1 ($engine)"
|
||||
When call run_case "$1" "$2" "$3"
|
||||
The output should equal "$(cat "$(expected_file "$1")")"
|
||||
End
|
||||
End
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
# Record golden outputs of the LEGACY make engine into spec/golden/expected/.
|
||||
# Usage: spec/golden/record.sh [case-name ...]
|
||||
set -u
|
||||
here=$(cd "$(dirname "$0")" && pwd)
|
||||
. "$here/../support/run.sh"
|
||||
MYOS_ROOT=${MYOS_ROOT:-$(cd "$here/../.." && pwd)}
|
||||
only="$*"
|
||||
grep -v '^#' "$here/cases.txt" | while IFS='|' read -r name fixture args; do
|
||||
name=$(echo "$name" | tr -d ' '); fixture=$(echo "$fixture" | tr -d ' ')
|
||||
[ -z "$name" ] && continue
|
||||
if [ -n "$only" ]; then case " $only " in *" $name "*) ;; *) continue ;; esac; fi
|
||||
sb=$(myos_sandbox "$fixture")
|
||||
eval "set -- $args"
|
||||
myos_run_engine legacy "$sb" "$@" > "$here/expected/$name.txt"
|
||||
rm -rf "$sb"
|
||||
printf 'recorded %s (%s lines)\n' "$name" "$(wc -l < "$here/expected/$name.txt" | tr -d ' ')"
|
||||
done
|
||||
Reference in New Issue
Block a user