test: backfill raw/global/computed report triplet coverage across plugins
The bats coverage for plugin :report keys has been uneven since the raw/global/computed split landed in PR #8640. This commit adds a single combined triplet test per settable property across app-json, builder, builder-dockerfile, builder-herokuish, builder-lambda, builder-nixpacks, builder-pack, builder-railpack, buildpacks, cron (maintenance), git (keep-git-dir, rev-env-var, source-image), logs (vector-sink, vector-global-image, vector-global-networks), network (attach-post-create, attach-post-deploy, initial-network), proxy (per-app type), ps (stop-timeout-seconds), registry (image-repo, push-on-release, push-extra-tags), storage (build/deploy/run mounts), and adds a new tests/unit/scheduler.bats and tests/unit/nginx-vhosts_properties.bats. Brings ps `procfile-path` and `stop-timeout-seconds` global getters in line with the #8640 convention (raw global, default resolved in computed). Documents the read-only and internal properties that surface in `:report` (or are written by Dokku) but cannot be managed by `:set` in a new `## Internal properties` section appended to each affected plugin's docs page.
This commit is contained in:
@@ -169,3 +169,11 @@ Available flags:
|
||||
- `--builds-computed-retention`: the resolved retention applied to this app
|
||||
|
||||
`--build-status` returns the **display** status, so an abandoned in-flight build shows `abandoned` rather than `running`. The raw on-disk status is only visible by reading the JSON record directly.
|
||||
|
||||
## Internal properties
|
||||
|
||||
The following properties surface in `builds:report` but are not managed by `builds:set` - they are derived metadata recorded during the build:
|
||||
|
||||
| Property | Kind | Description | Source |
|
||||
|---|---|---|---|
|
||||
| `--build-id`, `--build-kind`, `--build-status`, `--build-source`, `--build-pid`, `--build-started-at`, `--build-finished-at`, `--build-exit-code` | read-only | Per-build metadata for the most recent deploy | `plugins/builds/functions.go` writes during deploys |
|
||||
|
||||
@@ -230,3 +230,11 @@ The `docker-options:list` command prints the options stored for a single process
|
||||
dokku docker-options:list node-js-app --process web --phase deploy
|
||||
dokku docker-options:list node-js-app --phase deploy
|
||||
```
|
||||
|
||||
## Internal properties
|
||||
|
||||
The following property is recorded internally by the docker-options plugin and is not exposed via `docker-options:report`:
|
||||
|
||||
| Property | Kind | Description | Source |
|
||||
|---|---|---|---|
|
||||
| `migrated-from-files` | internal | Global migration sentinel that records that the legacy `DOCKER_OPTIONS_<PHASE>` flat-file store has been drained into plugin properties | `plugins/docker-options/functions.go` writes `"true"` once the install-time migration runs |
|
||||
|
||||
@@ -129,3 +129,11 @@ The following config variables have special meanings and can be set in a variety
|
||||
| `DOKKU_TRACE` | none | `dokku trace:on` <br /> `dokku trace:off` <br /> `--trace` flag | Turn on very verbose debugging. |
|
||||
| `DOKKU_SYSTEM_GROUP` | `dokku` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | System group to chown files as. |
|
||||
| `DOKKU_SYSTEM_USER` | `dokku` | `/etc/environment` <br /> `~dokku/.dokkurc` <br /> `~dokku/.dokkurc/*` | System user to chown files as. |
|
||||
|
||||
## Internal properties
|
||||
|
||||
The following property is recorded internally by the config plugin and is not exposed via `config:report`:
|
||||
|
||||
| Property | Kind | Description | Source |
|
||||
|---|---|---|---|
|
||||
| `env-migrated` | internal | Migration sentinel that records the per-app or global `DOKKU_*` env-var → property migration completed for 0.38.0 | `plugins/config/triggers.go` writes `"true"` after the upgrade-time pass |
|
||||
|
||||
@@ -150,3 +150,11 @@ If an `https:443:*` port mapping already exists when a certificate is installed
|
||||
### Running behind a proxy (`X-Forwarded-Ssl`, etc.)
|
||||
|
||||
See the [running behind another proxy documentation](/docs/networking/proxies/nginx.md#running-behind-another-proxy--configuring-x-forwarded--headers) for more information on how to configure your Nginx config when your server is running behind a proxy (e.g. load balancer, etc.).
|
||||
|
||||
## Internal properties
|
||||
|
||||
The following properties surface in `certs:report` but are not managed by `certs:set` - they are derived from the on-disk certificate:
|
||||
|
||||
| Property | Kind | Description | Source |
|
||||
|---|---|---|---|
|
||||
| `--ssl-enabled`, `--ssl-dir`, `--ssl-hostnames`, `--ssl-issuer`, `--ssl-subject`, `--ssl-verified`, `--ssl-expires-at`, `--ssl-starts-at` | read-only | Metadata extracted from the on-disk certificate, if present | `plugins/certs/functions` openssl introspection |
|
||||
|
||||
@@ -312,3 +312,15 @@ You can pass flags which will output only the value of the specific information
|
||||
```shell
|
||||
dokku apps:report node-js-app --app-dir
|
||||
```
|
||||
|
||||
## Internal properties
|
||||
|
||||
The following properties surface in `apps:report` but are not managed by `apps:set` - they are derived metadata recorded by the plugin:
|
||||
|
||||
| Property | Kind | Description | Source |
|
||||
|---|---|---|---|
|
||||
| `--app-created-at` | read-only | UNIX timestamp of app creation | written when the app directory is created in `plugins/apps/functions.go` |
|
||||
| `--app-deploy-source` | read-only | Source kind of the last deploy (`git`, `archive`, `docker-image`, `git-sync`) | set via the `deploy-source-set` plugin trigger |
|
||||
| `--app-deploy-source-metadata` | read-only | Free-form metadata for the deploy source (commit sha, image ref, URL) | set via the `deploy-source-set` plugin trigger |
|
||||
| `--app-dir` | read-only | Absolute path of the app root on disk | derived from `DOKKU_ROOT` and the app name |
|
||||
| `--app-locked` | read-only | `true` while a deploy or rebuild holds the app lock | `plugins/apps/functions.go` lock helpers |
|
||||
|
||||
@@ -172,3 +172,11 @@ Custom plugins names _must_ have the prefix `builder-` or builder overriding via
|
||||
Builders can use any tools available on the system to build the docker image, and may even be used to schedule building off-server. The only current requirement is that the image must exist on the server at the end of the `builder-build` command, though this requirement may be relaxed in a future release.
|
||||
|
||||
For a simple example of how to implement this trigger, see `builder-pack`, which utilizes a cli tool - `pack-cli` - to generate an OCI image that is compatible with Docker and can be scheduled by the official scheduling plugins.
|
||||
|
||||
## Internal properties
|
||||
|
||||
The following properties surface in `builder:report` but are not managed by `builder:set`:
|
||||
|
||||
| Property | Kind | Description | Source |
|
||||
|---|---|---|---|
|
||||
| `--builder-detected` | read-only | Builder auto-selected for the app when `selected` is unset | `builder-detect` plugin trigger run on demand |
|
||||
|
||||
@@ -318,3 +318,12 @@ dokku git:report node-js-app --format json
|
||||
```
|
||||
|
||||
The `--format` flag cannot be combined with an info flag.
|
||||
|
||||
## Internal properties
|
||||
|
||||
The following properties surface in `git:report` but are not managed by `git:set` - they are derived from repository state:
|
||||
|
||||
| Property | Kind | Description | Source |
|
||||
|---|---|---|---|
|
||||
| `--git-sha` | read-only | HEAD commit SHA of the app's git repo | `git rev-parse HEAD` against `$APP_ROOT` |
|
||||
| `--git-last-updated-at` | read-only | UNIX timestamp of the last write to the deploy branch ref | `stat -c %Y` on `refs/heads/<deploy-branch>` |
|
||||
|
||||
@@ -511,3 +511,12 @@ You can pass flags which will output only the value of the specific information
|
||||
```shell
|
||||
dokku network:report node-js-app --network-bind-all-interfaces
|
||||
```
|
||||
|
||||
## Internal properties
|
||||
|
||||
The following properties surface in `network:report` but are not managed by `network:set` - they are derived from the running app state:
|
||||
|
||||
| Property | Kind | Description | Source |
|
||||
|---|---|---|---|
|
||||
| `--network-web-listeners` | read-only | Current `web` process listeners (host:port) for the deployed app | derived from running container inspection |
|
||||
| `--network-static-web-listener` | read-only | Static listener override used when no container is running | derived from app config |
|
||||
|
||||
@@ -220,3 +220,11 @@ You can pass flags which will output only the value of the specific information
|
||||
```shell
|
||||
dokku ports:report node-js-app --ports-map
|
||||
```
|
||||
|
||||
## Internal properties
|
||||
|
||||
The following properties surface in `ports:report` but are not managed by `ports:set` - they are derived from the deploy:
|
||||
|
||||
| Property | Kind | Description | Source |
|
||||
|---|---|---|---|
|
||||
| `--ports-map-detected` | read-only | Port mapping inferred from `EXPOSE` directives or the running container | `builder-dockerfile` detection on deploy |
|
||||
|
||||
@@ -265,3 +265,11 @@ You can pass flags which will output only the value of the specific information
|
||||
```shell
|
||||
dokku caddy:report node-js-app --caddy-computed-image
|
||||
```
|
||||
|
||||
## Internal properties
|
||||
|
||||
The following properties are not managed by `caddy:set` but are recorded internally by the plugin:
|
||||
|
||||
| Property | Kind | Description | Source |
|
||||
|---|---|---|---|
|
||||
| `proxy-status` | internal | `started`/`stopped` state of the caddy compose project | `cmd-caddy-start`/`cmd-caddy-stop` in `plugins/caddy-vhosts/command-functions` |
|
||||
|
||||
@@ -244,3 +244,11 @@ You can pass flags which will output only the value of the specific information
|
||||
```shell
|
||||
dokku haproxy:report node-js-app --haproxy-computed-image
|
||||
```
|
||||
|
||||
## Internal properties
|
||||
|
||||
The following properties are not managed by `haproxy:set` but are recorded internally by the plugin:
|
||||
|
||||
| Property | Kind | Description | Source |
|
||||
|---|---|---|---|
|
||||
| `proxy-status` | internal | `started`/`stopped` state of the haproxy compose project | `cmd-haproxy-start`/`cmd-haproxy-stop` in `plugins/haproxy-vhosts/command-functions` |
|
||||
|
||||
@@ -620,3 +620,13 @@ See the [ports documentation](/docs/networking/port-management.md) for more info
|
||||
### Regenerating nginx config
|
||||
|
||||
See the [proxy documentation](/docs/networking/proxy-management.md#regenerating-proxy-config) for more information on how to rebuild the nginx proxy configuration for your app.
|
||||
|
||||
## Internal properties
|
||||
|
||||
The following properties surface in `nginx:report` but are not managed by `nginx:set`, or are recorded internally by the plugin:
|
||||
|
||||
| Property | Kind | Description | Source |
|
||||
|---|---|---|---|
|
||||
| `--nginx-last-visited-at` | read-only | UNIX timestamp of the last request served by nginx for the app | log-tailer writes the property on every request batch |
|
||||
| `proxy-status` | internal | `started`/`stopped` state of the nginx system service | `cmd-nginx-start`/`cmd-nginx-stop` |
|
||||
| `nginx-conf-sigil-migrated` | internal | Migration sentinel set the first time a v1 template is rewritten to the current schema | `plugins/nginx-vhosts/install` writes `"true"` once the install-time migration runs |
|
||||
|
||||
@@ -390,3 +390,11 @@ You can pass flags which will output only the value of the specific information
|
||||
```shell
|
||||
dokku traefik:report node-js-app --traefik-computed-api-enabled
|
||||
```
|
||||
|
||||
## Internal properties
|
||||
|
||||
The following properties are not managed by `traefik:set` but are recorded internally by the plugin:
|
||||
|
||||
| Property | Kind | Description | Source |
|
||||
|---|---|---|---|
|
||||
| `proxy-status` | internal | `started`/`stopped` state of the traefik compose project | `cmd-traefik-start`/`cmd-traefik-stop` in `plugins/traefik-vhosts/command-functions` |
|
||||
|
||||
@@ -236,3 +236,11 @@ Proxy implementations may decide to omit some functionality here, or use plugin
|
||||
Individual proxy implementations _may_ trigger app rebuilds, depending on how proxy metadata is exposed for the proxy implementation.
|
||||
|
||||
Finally, proxy implementations _may_ install extra software needed for the proxy itself in whatever manner deemed fit. Proxy software can run on the host itself or within a running Docker container with either exposed ports or host networking.
|
||||
|
||||
## Internal properties
|
||||
|
||||
The following properties surface in `proxy:report` but are not managed by `proxy:set`:
|
||||
|
||||
| Property | Kind | Description | Source |
|
||||
|---|---|---|---|
|
||||
| `--proxy-enabled` | read-only | `true` when the app's `disabled` property is not `true` | `plugins/proxy/proxy.go::IsAppProxyEnabled` |
|
||||
|
||||
@@ -463,3 +463,12 @@ The default value (`true`) may be restored by passing an empty value:
|
||||
```shell
|
||||
dokku ps:set node-js-app restore
|
||||
```
|
||||
|
||||
## Internal properties
|
||||
|
||||
The following properties surface in `ps:report` but are not managed by `ps:set` - they are derived from the running process state:
|
||||
|
||||
| Property | Kind | Description | Source |
|
||||
|---|---|---|---|
|
||||
| `--ps-can-scale` | read-only | `false` when the app's procfile or builder forbids horizontal scaling | derived from procfile parse |
|
||||
| `--deployed`, `--running`, `--processes`, `--status-<proctype>` | read-only | Live process state | `plugins/ps/report.go` inspects running containers |
|
||||
|
||||
@@ -102,12 +102,15 @@ func reportComputedProcfilePath(appName string) string {
|
||||
if value == "" {
|
||||
value = reportGlobalProcfilePath(appName)
|
||||
}
|
||||
if value == "" {
|
||||
value = "Procfile"
|
||||
}
|
||||
|
||||
return value
|
||||
}
|
||||
|
||||
func reportGlobalProcfilePath(appName string) string {
|
||||
return common.PropertyGetDefault("ps", "--global", "procfile-path", "Procfile")
|
||||
return common.PropertyGet("ps", "--global", "procfile-path")
|
||||
}
|
||||
|
||||
func reportProcfilePath(appName string) string {
|
||||
@@ -154,14 +157,17 @@ func reportComputedStopTimeoutSeconds(appName string) string {
|
||||
if value == "" {
|
||||
value = reportGlobalStopTimeoutSeconds(appName)
|
||||
}
|
||||
if value == "" {
|
||||
value = "30"
|
||||
}
|
||||
|
||||
return value
|
||||
}
|
||||
|
||||
func reportGlobalStopTimeoutSeconds(appName string) string {
|
||||
return common.PropertyGetDefault("ps", "--global", "stop-timeout-seconds", "30")
|
||||
return common.PropertyGet("ps", "--global", "stop-timeout-seconds")
|
||||
}
|
||||
|
||||
func reportStopTimeoutSeconds(appName string) string {
|
||||
return common.PropertyGetDefault("ps", appName, "stop-timeout-seconds", "30")
|
||||
return common.PropertyGet("ps", appName, "stop-timeout-seconds")
|
||||
}
|
||||
|
||||
@@ -313,6 +313,55 @@ teardown() {
|
||||
assert_output "app.json"
|
||||
}
|
||||
|
||||
@test "(app-json:report) appjson-path raw vs computed vs global" {
|
||||
run /bin/bash -c "dokku app-json:set --global appjson-path"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku app-json:report $TEST_APP --app-json-appjson-path"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku app-json:report $TEST_APP --app-json-global-appjson-path"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku app-json:report $TEST_APP --app-json-computed-appjson-path"
|
||||
assert_success
|
||||
assert_output "app.json"
|
||||
|
||||
run /bin/bash -c "dokku app-json:set --global appjson-path app.global.json"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku app-json:report $TEST_APP --app-json-global-appjson-path"
|
||||
assert_success
|
||||
assert_output "app.global.json"
|
||||
|
||||
run /bin/bash -c "dokku app-json:report $TEST_APP --app-json-computed-appjson-path"
|
||||
assert_success
|
||||
assert_output "app.global.json"
|
||||
|
||||
run /bin/bash -c "dokku app-json:set $TEST_APP appjson-path app.app.json"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku app-json:report $TEST_APP --app-json-appjson-path"
|
||||
assert_success
|
||||
assert_output "app.app.json"
|
||||
|
||||
run /bin/bash -c "dokku app-json:report $TEST_APP --app-json-global-appjson-path"
|
||||
assert_success
|
||||
assert_output "app.global.json"
|
||||
|
||||
run /bin/bash -c "dokku app-json:report $TEST_APP --app-json-computed-appjson-path"
|
||||
assert_success
|
||||
assert_output "app.app.json"
|
||||
|
||||
run /bin/bash -c "dokku app-json:set $TEST_APP appjson-path"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku app-json:set --global appjson-path"
|
||||
assert_success
|
||||
}
|
||||
|
||||
copy_app_json_to_sub_app() {
|
||||
local APP="$1"
|
||||
local APP_REPO_DIR="$2"
|
||||
|
||||
@@ -83,6 +83,59 @@ teardown() {
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(builder-dockerfile:report) dockerfile-path raw vs computed vs global" {
|
||||
run /bin/bash -c "dokku builder-dockerfile:set --global dockerfile-path"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-dockerfile:report $TEST_APP --builder-dockerfile-dockerfile-path"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku builder-dockerfile:report $TEST_APP --builder-dockerfile-global-dockerfile-path"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku builder-dockerfile:report $TEST_APP --builder-dockerfile-computed-dockerfile-path"
|
||||
assert_success
|
||||
assert_output "Dockerfile"
|
||||
|
||||
run /bin/bash -c "dokku builder-dockerfile:set --global dockerfile-path Dockerfile.global"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-dockerfile:report $TEST_APP --builder-dockerfile-global-dockerfile-path"
|
||||
assert_success
|
||||
assert_output "Dockerfile.global"
|
||||
|
||||
run /bin/bash -c "dokku builder-dockerfile:report $TEST_APP --builder-dockerfile-computed-dockerfile-path"
|
||||
assert_success
|
||||
assert_output "Dockerfile.global"
|
||||
|
||||
run /bin/bash -c "dokku builder-dockerfile:set $TEST_APP dockerfile-path Dockerfile.app"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-dockerfile:report $TEST_APP --builder-dockerfile-dockerfile-path"
|
||||
assert_success
|
||||
assert_output "Dockerfile.app"
|
||||
|
||||
run /bin/bash -c "dokku builder-dockerfile:report $TEST_APP --builder-dockerfile-global-dockerfile-path"
|
||||
assert_success
|
||||
assert_output "Dockerfile.global"
|
||||
|
||||
run /bin/bash -c "dokku builder-dockerfile:report $TEST_APP --builder-dockerfile-computed-dockerfile-path"
|
||||
assert_success
|
||||
assert_output "Dockerfile.app"
|
||||
|
||||
run /bin/bash -c "dokku builder-dockerfile:set $TEST_APP dockerfile-path"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-dockerfile:set --global dockerfile-path"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-dockerfile:report $TEST_APP --builder-dockerfile-computed-dockerfile-path"
|
||||
assert_success
|
||||
assert_output "Dockerfile"
|
||||
}
|
||||
|
||||
@test "(builder-dockerfile:set)" {
|
||||
run deploy_app dockerfile
|
||||
echo "output: $output"
|
||||
|
||||
@@ -52,6 +52,58 @@ teardown() {
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(builder-herokuish:report) allowed raw vs computed vs global" {
|
||||
local default_allowed="true"
|
||||
[[ "$(dpkg --print-architecture 2>/dev/null || true)" != "amd64" ]] && default_allowed="false"
|
||||
|
||||
run /bin/bash -c "dokku builder-herokuish:set --global allowed"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-herokuish:report $TEST_APP --builder-herokuish-allowed"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku builder-herokuish:report $TEST_APP --builder-herokuish-global-allowed"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku builder-herokuish:report $TEST_APP --builder-herokuish-computed-allowed"
|
||||
assert_success
|
||||
assert_output "$default_allowed"
|
||||
|
||||
run /bin/bash -c "dokku builder-herokuish:set --global allowed false"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-herokuish:report $TEST_APP --builder-herokuish-global-allowed"
|
||||
assert_success
|
||||
assert_output "false"
|
||||
|
||||
run /bin/bash -c "dokku builder-herokuish:report $TEST_APP --builder-herokuish-computed-allowed"
|
||||
assert_success
|
||||
assert_output "false"
|
||||
|
||||
run /bin/bash -c "dokku builder-herokuish:set $TEST_APP allowed true"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-herokuish:report $TEST_APP --builder-herokuish-allowed"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
|
||||
run /bin/bash -c "dokku builder-herokuish:report $TEST_APP --builder-herokuish-global-allowed"
|
||||
assert_success
|
||||
assert_output "false"
|
||||
|
||||
run /bin/bash -c "dokku builder-herokuish:report $TEST_APP --builder-herokuish-computed-allowed"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
|
||||
run /bin/bash -c "dokku builder-herokuish:set $TEST_APP allowed"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-herokuish:set --global allowed"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(builder-herouish:build .env)" {
|
||||
run deploy_app python dokku@$DOKKU_DOMAIN:$TEST_APP
|
||||
echo "output: $output"
|
||||
|
||||
@@ -52,6 +52,55 @@ teardown() {
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(builder-lambda:report) lambdayml-path raw vs computed vs global" {
|
||||
run /bin/bash -c "dokku builder-lambda:set --global lambdayml-path"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-lambda:report $TEST_APP --builder-lambda-lambdayml-path"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku builder-lambda:report $TEST_APP --builder-lambda-global-lambdayml-path"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku builder-lambda:report $TEST_APP --builder-lambda-computed-lambdayml-path"
|
||||
assert_success
|
||||
assert_output "lambda.yml"
|
||||
|
||||
run /bin/bash -c "dokku builder-lambda:set --global lambdayml-path lambda.global.yml"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-lambda:report $TEST_APP --builder-lambda-global-lambdayml-path"
|
||||
assert_success
|
||||
assert_output "lambda.global.yml"
|
||||
|
||||
run /bin/bash -c "dokku builder-lambda:report $TEST_APP --builder-lambda-computed-lambdayml-path"
|
||||
assert_success
|
||||
assert_output "lambda.global.yml"
|
||||
|
||||
run /bin/bash -c "dokku builder-lambda:set $TEST_APP lambdayml-path lambda.app.yml"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-lambda:report $TEST_APP --builder-lambda-lambdayml-path"
|
||||
assert_success
|
||||
assert_output "lambda.app.yml"
|
||||
|
||||
run /bin/bash -c "dokku builder-lambda:report $TEST_APP --builder-lambda-global-lambdayml-path"
|
||||
assert_success
|
||||
assert_output "lambda.global.yml"
|
||||
|
||||
run /bin/bash -c "dokku builder-lambda:report $TEST_APP --builder-lambda-computed-lambdayml-path"
|
||||
assert_success
|
||||
assert_output "lambda.app.yml"
|
||||
|
||||
run /bin/bash -c "dokku builder-lambda:set $TEST_APP lambdayml-path"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-lambda:set --global lambdayml-path"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(builder-lambda:set)" {
|
||||
run /bin/bash -c "dokku config:set $TEST_APP SECRET_KEY=fjdkslafjdk"
|
||||
echo "output: $output"
|
||||
|
||||
@@ -56,6 +56,55 @@ teardown() {
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(builder-nixpacks:report) nixpackstoml-path raw vs computed vs global" {
|
||||
run /bin/bash -c "dokku builder-nixpacks:set --global nixpackstoml-path"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-nixpacks:report $TEST_APP --builder-nixpacks-nixpackstoml-path"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku builder-nixpacks:report $TEST_APP --builder-nixpacks-global-nixpackstoml-path"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku builder-nixpacks:report $TEST_APP --builder-nixpacks-computed-nixpackstoml-path"
|
||||
assert_success
|
||||
assert_output "nixpacks.toml"
|
||||
|
||||
run /bin/bash -c "dokku builder-nixpacks:set --global nixpackstoml-path nixpacks.global.toml"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-nixpacks:report $TEST_APP --builder-nixpacks-global-nixpackstoml-path"
|
||||
assert_success
|
||||
assert_output "nixpacks.global.toml"
|
||||
|
||||
run /bin/bash -c "dokku builder-nixpacks:report $TEST_APP --builder-nixpacks-computed-nixpackstoml-path"
|
||||
assert_success
|
||||
assert_output "nixpacks.global.toml"
|
||||
|
||||
run /bin/bash -c "dokku builder-nixpacks:set $TEST_APP nixpackstoml-path nixpacks.app.toml"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-nixpacks:report $TEST_APP --builder-nixpacks-nixpackstoml-path"
|
||||
assert_success
|
||||
assert_output "nixpacks.app.toml"
|
||||
|
||||
run /bin/bash -c "dokku builder-nixpacks:report $TEST_APP --builder-nixpacks-global-nixpackstoml-path"
|
||||
assert_success
|
||||
assert_output "nixpacks.global.toml"
|
||||
|
||||
run /bin/bash -c "dokku builder-nixpacks:report $TEST_APP --builder-nixpacks-computed-nixpackstoml-path"
|
||||
assert_success
|
||||
assert_output "nixpacks.app.toml"
|
||||
|
||||
run /bin/bash -c "dokku builder-nixpacks:set $TEST_APP nixpackstoml-path"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-nixpacks:set --global nixpackstoml-path"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(builder-nixpacks:set)" {
|
||||
run /bin/bash -c "dokku config:set $TEST_APP SECRET_KEY=fjdkslafjdk"
|
||||
echo "output: $output"
|
||||
|
||||
@@ -58,6 +58,55 @@ teardown() {
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(builder-pack:report) projecttoml-path raw vs computed vs global" {
|
||||
run /bin/bash -c "dokku builder-pack:set --global projecttoml-path"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-pack:report $TEST_APP --builder-pack-projecttoml-path"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku builder-pack:report $TEST_APP --builder-pack-global-projecttoml-path"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku builder-pack:report $TEST_APP --builder-pack-computed-projecttoml-path"
|
||||
assert_success
|
||||
assert_output "project.toml"
|
||||
|
||||
run /bin/bash -c "dokku builder-pack:set --global projecttoml-path project.global.toml"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-pack:report $TEST_APP --builder-pack-global-projecttoml-path"
|
||||
assert_success
|
||||
assert_output "project.global.toml"
|
||||
|
||||
run /bin/bash -c "dokku builder-pack:report $TEST_APP --builder-pack-computed-projecttoml-path"
|
||||
assert_success
|
||||
assert_output "project.global.toml"
|
||||
|
||||
run /bin/bash -c "dokku builder-pack:set $TEST_APP projecttoml-path project.app.toml"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-pack:report $TEST_APP --builder-pack-projecttoml-path"
|
||||
assert_success
|
||||
assert_output "project.app.toml"
|
||||
|
||||
run /bin/bash -c "dokku builder-pack:report $TEST_APP --builder-pack-global-projecttoml-path"
|
||||
assert_success
|
||||
assert_output "project.global.toml"
|
||||
|
||||
run /bin/bash -c "dokku builder-pack:report $TEST_APP --builder-pack-computed-projecttoml-path"
|
||||
assert_success
|
||||
assert_output "project.app.toml"
|
||||
|
||||
run /bin/bash -c "dokku builder-pack:set $TEST_APP projecttoml-path"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-pack:set --global projecttoml-path"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(builder-pack:set)" {
|
||||
run /bin/bash -c "dokku config:set $TEST_APP SECRET_KEY=fjdkslafjdk"
|
||||
echo "output: $output"
|
||||
|
||||
@@ -67,6 +67,55 @@ teardown() {
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(builder-railpack:report) railpackjson-path raw vs computed vs global" {
|
||||
run /bin/bash -c "dokku builder-railpack:set --global railpackjson-path"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-railpack:report $TEST_APP --builder-railpack-railpackjson-path"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku builder-railpack:report $TEST_APP --builder-railpack-global-railpackjson-path"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku builder-railpack:report $TEST_APP --builder-railpack-computed-railpackjson-path"
|
||||
assert_success
|
||||
assert_output "railpack.json"
|
||||
|
||||
run /bin/bash -c "dokku builder-railpack:set --global railpackjson-path railpack.global.json"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-railpack:report $TEST_APP --builder-railpack-global-railpackjson-path"
|
||||
assert_success
|
||||
assert_output "railpack.global.json"
|
||||
|
||||
run /bin/bash -c "dokku builder-railpack:report $TEST_APP --builder-railpack-computed-railpackjson-path"
|
||||
assert_success
|
||||
assert_output "railpack.global.json"
|
||||
|
||||
run /bin/bash -c "dokku builder-railpack:set $TEST_APP railpackjson-path railpack.app.json"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-railpack:report $TEST_APP --builder-railpack-railpackjson-path"
|
||||
assert_success
|
||||
assert_output "railpack.app.json"
|
||||
|
||||
run /bin/bash -c "dokku builder-railpack:report $TEST_APP --builder-railpack-global-railpackjson-path"
|
||||
assert_success
|
||||
assert_output "railpack.global.json"
|
||||
|
||||
run /bin/bash -c "dokku builder-railpack:report $TEST_APP --builder-railpack-computed-railpackjson-path"
|
||||
assert_success
|
||||
assert_output "railpack.app.json"
|
||||
|
||||
run /bin/bash -c "dokku builder-railpack:set $TEST_APP railpackjson-path"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder-railpack:set --global railpackjson-path"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(builder-railpack:set)" {
|
||||
run /bin/bash -c "dokku config:set $TEST_APP SECRET_KEY=fjdkslafjdk"
|
||||
echo "output: $output"
|
||||
|
||||
@@ -209,6 +209,104 @@ teardown() {
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(builder:report) selected raw vs computed vs global" {
|
||||
run /bin/bash -c "dokku builder:set --global selected"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder:report $TEST_APP --builder-selected"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku builder:report $TEST_APP --builder-global-selected"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku builder:report $TEST_APP --builder-computed-selected"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku builder:set --global selected dockerfile"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder:report $TEST_APP --builder-global-selected"
|
||||
assert_success
|
||||
assert_output "dockerfile"
|
||||
|
||||
run /bin/bash -c "dokku builder:report $TEST_APP --builder-computed-selected"
|
||||
assert_success
|
||||
assert_output "dockerfile"
|
||||
|
||||
run /bin/bash -c "dokku builder:set $TEST_APP selected herokuish"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder:report $TEST_APP --builder-selected"
|
||||
assert_success
|
||||
assert_output "herokuish"
|
||||
|
||||
run /bin/bash -c "dokku builder:report $TEST_APP --builder-global-selected"
|
||||
assert_success
|
||||
assert_output "dockerfile"
|
||||
|
||||
run /bin/bash -c "dokku builder:report $TEST_APP --builder-computed-selected"
|
||||
assert_success
|
||||
assert_output "herokuish"
|
||||
|
||||
run /bin/bash -c "dokku builder:set $TEST_APP selected"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder:set --global selected"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(builder:report) build-dir raw vs computed vs global" {
|
||||
run /bin/bash -c "dokku builder:set --global build-dir"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder:report $TEST_APP --builder-build-dir"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku builder:report $TEST_APP --builder-global-build-dir"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku builder:report $TEST_APP --builder-computed-build-dir"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku builder:set --global build-dir global/subdir"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder:report $TEST_APP --builder-global-build-dir"
|
||||
assert_success
|
||||
assert_output "global/subdir"
|
||||
|
||||
run /bin/bash -c "dokku builder:report $TEST_APP --builder-computed-build-dir"
|
||||
assert_success
|
||||
assert_output "global/subdir"
|
||||
|
||||
run /bin/bash -c "dokku builder:set $TEST_APP build-dir app/subdir"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder:report $TEST_APP --builder-build-dir"
|
||||
assert_success
|
||||
assert_output "app/subdir"
|
||||
|
||||
run /bin/bash -c "dokku builder:report $TEST_APP --builder-global-build-dir"
|
||||
assert_success
|
||||
assert_output "global/subdir"
|
||||
|
||||
run /bin/bash -c "dokku builder:report $TEST_APP --builder-computed-build-dir"
|
||||
assert_success
|
||||
assert_output "app/subdir"
|
||||
|
||||
run /bin/bash -c "dokku builder:set $TEST_APP build-dir"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku builder:set --global build-dir"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(builder:set)" {
|
||||
run deploy_app python
|
||||
echo "output: $output"
|
||||
|
||||
@@ -191,6 +191,51 @@ teardown() {
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(buildpacks:report) stack raw vs computed vs global" {
|
||||
run /bin/bash -c "dokku buildpacks:set-property --global stack"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet buildpacks:report $TEST_APP --format json | jq -r '.\"buildpacks-stack\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet buildpacks:report $TEST_APP --format json | jq -r '.\"buildpacks-global-stack\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku buildpacks:set-property --global stack gliderlabs/herokuish:global"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet buildpacks:report $TEST_APP --format json | jq -r '.\"buildpacks-global-stack\"'"
|
||||
assert_success
|
||||
assert_output "gliderlabs/herokuish:global"
|
||||
|
||||
run /bin/bash -c "dokku --quiet buildpacks:report $TEST_APP --format json | jq -r '.\"buildpacks-computed-stack\"'"
|
||||
assert_success
|
||||
assert_output "gliderlabs/herokuish:global"
|
||||
|
||||
run /bin/bash -c "dokku buildpacks:set-property $TEST_APP stack gliderlabs/herokuish:app"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet buildpacks:report $TEST_APP --format json | jq -r '.\"buildpacks-stack\"'"
|
||||
assert_success
|
||||
assert_output "gliderlabs/herokuish:app"
|
||||
|
||||
run /bin/bash -c "dokku --quiet buildpacks:report $TEST_APP --format json | jq -r '.\"buildpacks-global-stack\"'"
|
||||
assert_success
|
||||
assert_output "gliderlabs/herokuish:global"
|
||||
|
||||
run /bin/bash -c "dokku --quiet buildpacks:report $TEST_APP --format json | jq -r '.\"buildpacks-computed-stack\"'"
|
||||
assert_success
|
||||
assert_output "gliderlabs/herokuish:app"
|
||||
|
||||
run /bin/bash -c "dokku buildpacks:set-property $TEST_APP stack"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku buildpacks:set-property --global stack"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(buildpacks) buildpacks:remove" {
|
||||
run /bin/bash -c "dokku buildpacks:set $TEST_APP heroku/nodejs"
|
||||
echo "output: $output"
|
||||
|
||||
@@ -186,6 +186,55 @@ teardown() {
|
||||
assert_output_not_contains "unknown flag"
|
||||
}
|
||||
|
||||
@test "(cron:report) maintenance raw vs computed vs global" {
|
||||
run /bin/bash -c "dokku cron:set --global maintenance"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet cron:report $TEST_APP --format json | jq -r '.\"cron-maintenance\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet cron:report $TEST_APP --format json | jq -r '.\"cron-global-maintenance\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet cron:report $TEST_APP --format json | jq -r '.\"cron-computed-maintenance\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku cron:set --global maintenance true"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet cron:report $TEST_APP --format json | jq -r '.\"cron-global-maintenance\"'"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
|
||||
run /bin/bash -c "dokku --quiet cron:report $TEST_APP --format json | jq -r '.\"cron-computed-maintenance\"'"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
|
||||
run /bin/bash -c "dokku cron:set $TEST_APP maintenance false"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet cron:report $TEST_APP --format json | jq -r '.\"cron-maintenance\"'"
|
||||
assert_success
|
||||
assert_output "false"
|
||||
|
||||
run /bin/bash -c "dokku --quiet cron:report $TEST_APP --format json | jq -r '.\"cron-global-maintenance\"'"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
|
||||
run /bin/bash -c "dokku --quiet cron:report $TEST_APP --format json | jq -r '.\"cron-computed-maintenance\"'"
|
||||
assert_success
|
||||
assert_output "false"
|
||||
|
||||
run /bin/bash -c "dokku cron:set $TEST_APP maintenance"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku cron:set --global maintenance"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(cron:set) --global rejects task maintenance properties" {
|
||||
run /bin/bash -c "dokku cron:set --global maintenance.fakeid true"
|
||||
echo "output: $output"
|
||||
|
||||
@@ -71,52 +71,93 @@ teardown() {
|
||||
assert_output_contains "Invalid flag passed"
|
||||
}
|
||||
|
||||
@test "(git:report) keep-git-dir raw vs computed" {
|
||||
run /bin/bash -c "dokku git:report $TEST_APP --git-keep-git-dir"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
@test "(git:report) keep-git-dir raw vs computed vs global" {
|
||||
run /bin/bash -c "dokku git:set --global keep-git-dir"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku git:report $TEST_APP --git-keep-git-dir"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku git:report $TEST_APP --git-global-keep-git-dir"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku git:report $TEST_APP --git-computed-keep-git-dir"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output "false"
|
||||
|
||||
run /bin/bash -c "dokku git:set $TEST_APP keep-git-dir true"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
run /bin/bash -c "dokku git:set --global keep-git-dir true"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku git:report $TEST_APP --git-keep-git-dir"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
run /bin/bash -c "dokku git:report $TEST_APP --git-global-keep-git-dir"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
|
||||
run /bin/bash -c "dokku git:report $TEST_APP --git-computed-keep-git-dir"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
|
||||
run /bin/bash -c "dokku git:set $TEST_APP keep-git-dir false"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku git:report $TEST_APP --git-keep-git-dir"
|
||||
assert_success
|
||||
assert_output "false"
|
||||
|
||||
run /bin/bash -c "dokku git:report $TEST_APP --git-global-keep-git-dir"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
|
||||
run /bin/bash -c "dokku git:report $TEST_APP --git-computed-keep-git-dir"
|
||||
assert_success
|
||||
assert_output "false"
|
||||
|
||||
run /bin/bash -c "dokku git:set $TEST_APP keep-git-dir"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku git:report $TEST_APP --git-keep-git-dir"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
run /bin/bash -c "dokku git:set --global keep-git-dir"
|
||||
assert_success
|
||||
assert_output ""
|
||||
}
|
||||
|
||||
run /bin/bash -c "dokku git:report $TEST_APP --git-computed-keep-git-dir"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
@test "(git:report) rev-env-var raw" {
|
||||
run /bin/bash -c "dokku git:report $TEST_APP --git-rev-env-var"
|
||||
assert_success
|
||||
assert_output "false"
|
||||
assert_output "GIT_REV"
|
||||
|
||||
run /bin/bash -c "dokku git:set $TEST_APP rev-env-var COMMIT_SHA"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku git:report $TEST_APP --git-rev-env-var"
|
||||
assert_success
|
||||
assert_output "COMMIT_SHA"
|
||||
|
||||
run /bin/bash -c "dokku git:set $TEST_APP rev-env-var"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku git:report $TEST_APP --git-rev-env-var"
|
||||
assert_success
|
||||
assert_output "GIT_REV"
|
||||
}
|
||||
|
||||
@test "(git:report) source-image raw" {
|
||||
run /bin/bash -c "dokku git:report $TEST_APP --git-source-image"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku git:set $TEST_APP source-image alpine:3.20"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku git:report $TEST_APP --git-source-image"
|
||||
assert_success
|
||||
assert_output "alpine:3.20"
|
||||
|
||||
run /bin/bash -c "dokku git:set $TEST_APP source-image"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku git:report $TEST_APP --git-source-image"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
}
|
||||
|
||||
@test "(git:report) raw and computed keys in --format json" {
|
||||
|
||||
@@ -485,6 +485,62 @@ teardown() {
|
||||
assert_output "10m"
|
||||
}
|
||||
|
||||
@test "(logs:report) vector-sink raw vs global" {
|
||||
run /bin/bash -c "dokku logs:set --global vector-sink"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet logs:report $TEST_APP --format json | jq -r '.\"logs-vector-sink\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet logs:report $TEST_APP --format json | jq -r '.\"logs-global-vector-sink\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku logs:set --global vector-sink console://?encoding[codec]=json"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet logs:report $TEST_APP --format json | jq -r '.\"logs-global-vector-sink\"'"
|
||||
assert_success
|
||||
assert_output "console://?encoding[codec]=json"
|
||||
|
||||
run /bin/bash -c "dokku logs:set $TEST_APP vector-sink datadog_logs://?api_key=abc"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet logs:report $TEST_APP --format json | jq -r '.\"logs-vector-sink\"'"
|
||||
assert_success
|
||||
assert_output "datadog_logs://?api_key=abc"
|
||||
|
||||
run /bin/bash -c "dokku logs:set $TEST_APP vector-sink"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku logs:set --global vector-sink"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(logs:report) vector-global-image and vector-global-networks raw" {
|
||||
run /bin/bash -c "dokku logs:set --global vector-image"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet logs:report --global --format json | jq -r '.\"logs-vector-global-image\"'"
|
||||
assert_success
|
||||
assert_output_exists
|
||||
|
||||
run /bin/bash -c "dokku logs:set --global vector-image timberio/vector:custom"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet logs:report --global --format json | jq -r '.\"logs-vector-global-image\"'"
|
||||
assert_success
|
||||
assert_output "timberio/vector:custom"
|
||||
|
||||
run /bin/bash -c "dokku logs:set --global vector-image"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet logs:report --global --format json | jq -r '.\"logs-vector-global-networks\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
}
|
||||
|
||||
@test "(logs) logs:set --global vector-networks" {
|
||||
docker network create test-vector-net-a >/dev/null
|
||||
docker network create test-vector-net-b >/dev/null
|
||||
|
||||
@@ -107,6 +107,100 @@ teardown() {
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(network:report) attach-post-create raw vs computed vs global" {
|
||||
docker network create create-network-x >/dev/null
|
||||
run /bin/bash -c "dokku network:set --global attach-post-create"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-attach-post-create\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-global-attach-post-create\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-computed-attach-post-create\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku network:set --global attach-post-create create-network-x"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-global-attach-post-create\"'"
|
||||
assert_success
|
||||
assert_output "create-network-x"
|
||||
|
||||
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-computed-attach-post-create\"'"
|
||||
assert_success
|
||||
assert_output "create-network-x"
|
||||
|
||||
run /bin/bash -c "dokku network:set --global attach-post-create"
|
||||
assert_success
|
||||
|
||||
docker network rm create-network-x >/dev/null
|
||||
}
|
||||
|
||||
@test "(network:report) attach-post-deploy raw vs computed vs global" {
|
||||
docker network create deploy-network-x >/dev/null
|
||||
run /bin/bash -c "dokku network:set --global attach-post-deploy"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-attach-post-deploy\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-global-attach-post-deploy\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku network:set --global attach-post-deploy deploy-network-x"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-global-attach-post-deploy\"'"
|
||||
assert_success
|
||||
assert_output "deploy-network-x"
|
||||
|
||||
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-computed-attach-post-deploy\"'"
|
||||
assert_success
|
||||
assert_output "deploy-network-x"
|
||||
|
||||
run /bin/bash -c "dokku network:set --global attach-post-deploy"
|
||||
assert_success
|
||||
|
||||
docker network rm deploy-network-x >/dev/null
|
||||
}
|
||||
|
||||
@test "(network:report) initial-network raw vs computed vs global" {
|
||||
docker network create initial-network-x >/dev/null
|
||||
run /bin/bash -c "dokku network:set --global initial-network"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-initial-network\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-global-initial-network\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku network:set --global initial-network initial-network-x"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-global-initial-network\"'"
|
||||
assert_success
|
||||
assert_output "initial-network-x"
|
||||
|
||||
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-computed-initial-network\"'"
|
||||
assert_success
|
||||
assert_output "initial-network-x"
|
||||
|
||||
run /bin/bash -c "dokku network:set --global initial-network"
|
||||
assert_success
|
||||
|
||||
docker network rm initial-network-x >/dev/null
|
||||
}
|
||||
|
||||
@test "(network) network:set bind-all-interfaces" {
|
||||
run deploy_app
|
||||
echo "output: $output"
|
||||
|
||||
103
tests/unit/nginx-vhosts_properties.bats
Normal file
103
tests/unit/nginx-vhosts_properties.bats
Normal file
@@ -0,0 +1,103 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load test_helper
|
||||
|
||||
setup() {
|
||||
global_setup
|
||||
create_app
|
||||
}
|
||||
|
||||
teardown() {
|
||||
destroy_app
|
||||
global_teardown
|
||||
}
|
||||
|
||||
# assert_nginx_property_set_get verifies that for a given nginx property,
|
||||
# (a) the raw per-app and global keys cycle through set/unset states,
|
||||
# (b) the computed key always returns a non-empty value when defaults exist,
|
||||
# and (c) the computed key falls back through per-app -> global.
|
||||
#
|
||||
# This intentionally does not pin the exact default value for properties whose
|
||||
# default is computed at runtime (e.g. proxy-buffer-size depends on the host's
|
||||
# page size) - those would be brittle to assert verbatim. The set/unset cycle
|
||||
# is the canonical test for the report convention.
|
||||
assert_nginx_property_set_get() {
|
||||
declare prop="$1" app_value="$2" global_value="$3"
|
||||
|
||||
run /bin/bash -c "dokku nginx:set --global $prop"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:set --global $prop $global_value"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet nginx:report $TEST_APP --format json | jq -r '.\"nginx-global-$prop\"'"
|
||||
assert_success
|
||||
assert_output "$global_value"
|
||||
|
||||
run /bin/bash -c "dokku --quiet nginx:report $TEST_APP --format json | jq -r '.\"nginx-computed-$prop\"'"
|
||||
assert_success
|
||||
assert_output "$global_value"
|
||||
|
||||
run /bin/bash -c "dokku nginx:set $TEST_APP $prop $app_value"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet nginx:report $TEST_APP --format json | jq -r '.\"nginx-$prop\"'"
|
||||
assert_success
|
||||
assert_output "$app_value"
|
||||
|
||||
run /bin/bash -c "dokku --quiet nginx:report $TEST_APP --format json | jq -r '.\"nginx-global-$prop\"'"
|
||||
assert_success
|
||||
assert_output "$global_value"
|
||||
|
||||
run /bin/bash -c "dokku --quiet nginx:report $TEST_APP --format json | jq -r '.\"nginx-computed-$prop\"'"
|
||||
assert_success
|
||||
assert_output "$app_value"
|
||||
|
||||
run /bin/bash -c "dokku nginx:set $TEST_APP $prop"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku nginx:set --global $prop"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(nginx:report) timeout properties raw/global/computed" {
|
||||
for prop in client-body-timeout client-header-timeout keepalive-timeout lingering-timeout send-timeout proxy-connect-timeout proxy-read-timeout proxy-send-timeout; do
|
||||
assert_nginx_property_set_get "$prop" "30s" "45s"
|
||||
done
|
||||
}
|
||||
|
||||
@test "(nginx:report) buffer properties raw/global/computed" {
|
||||
assert_nginx_property_set_get "proxy-buffer-size" "8k" "16k"
|
||||
assert_nginx_property_set_get "proxy-buffering" "off" "on"
|
||||
assert_nginx_property_set_get "proxy-buffers" "16 16k" "32 16k"
|
||||
assert_nginx_property_set_get "proxy-busy-buffers-size" "16k" "32k"
|
||||
assert_nginx_property_set_get "client-max-body-size" "10m" "20m"
|
||||
}
|
||||
|
||||
@test "(nginx:report) hsts properties raw/global/computed" {
|
||||
assert_nginx_property_set_get "hsts" "false" "true"
|
||||
assert_nginx_property_set_get "hsts-include-subdomains" "false" "true"
|
||||
assert_nginx_property_set_get "hsts-max-age" "3600" "7200"
|
||||
assert_nginx_property_set_get "hsts-preload" "true" "false"
|
||||
}
|
||||
|
||||
@test "(nginx:report) x-forwarded properties raw/global/computed" {
|
||||
assert_nginx_property_set_get "x-forwarded-for-value" "\$remote_addr" "\$proxy_add_x_forwarded_for"
|
||||
assert_nginx_property_set_get "x-forwarded-port-value" "8080" "8443"
|
||||
assert_nginx_property_set_get "x-forwarded-proto-value" "https" "http"
|
||||
assert_nginx_property_set_get "x-forwarded-ssl" "on" "off"
|
||||
}
|
||||
|
||||
@test "(nginx:report) log/address properties raw/global/computed" {
|
||||
assert_nginx_property_set_get "bind-address-ipv4" "127.0.0.1" "0.0.0.0"
|
||||
assert_nginx_property_set_get "bind-address-ipv6" "::1" "::"
|
||||
assert_nginx_property_set_get "access-log-format" "main" "combined"
|
||||
assert_nginx_property_set_get "access-log-path" "/var/log/nginx/app-access.log" "/dev/stdout"
|
||||
assert_nginx_property_set_get "error-log-path" "/var/log/nginx/app-error.log" "/dev/stderr"
|
||||
}
|
||||
|
||||
@test "(nginx:report) misc properties raw/global/computed" {
|
||||
assert_nginx_property_set_get "disable-custom-config" "false" "true"
|
||||
assert_nginx_property_set_get "underscore-in-headers" "on" "off"
|
||||
assert_nginx_property_set_get "proxy-keepalive" "on" "off"
|
||||
}
|
||||
@@ -76,6 +76,55 @@ teardown() {
|
||||
assert_output "nginx"
|
||||
}
|
||||
|
||||
@test "(proxy:report) type raw vs computed vs global" {
|
||||
run /bin/bash -c "dokku proxy:set --global type"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet proxy:report $TEST_APP --format json | jq -r '.\"proxy-type\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet proxy:report $TEST_APP --format json | jq -r '.\"proxy-global-type\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet proxy:report $TEST_APP --format json | jq -r '.\"proxy-computed-type\"'"
|
||||
assert_success
|
||||
assert_output "nginx"
|
||||
|
||||
run /bin/bash -c "dokku proxy:set --global type caddy"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet proxy:report $TEST_APP --format json | jq -r '.\"proxy-global-type\"'"
|
||||
assert_success
|
||||
assert_output "caddy"
|
||||
|
||||
run /bin/bash -c "dokku --quiet proxy:report $TEST_APP --format json | jq -r '.\"proxy-computed-type\"'"
|
||||
assert_success
|
||||
assert_output "caddy"
|
||||
|
||||
run /bin/bash -c "dokku proxy:set $TEST_APP type traefik"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet proxy:report $TEST_APP --format json | jq -r '.\"proxy-type\"'"
|
||||
assert_success
|
||||
assert_output "traefik"
|
||||
|
||||
run /bin/bash -c "dokku --quiet proxy:report $TEST_APP --format json | jq -r '.\"proxy-global-type\"'"
|
||||
assert_success
|
||||
assert_output "caddy"
|
||||
|
||||
run /bin/bash -c "dokku --quiet proxy:report $TEST_APP --format json | jq -r '.\"proxy-computed-type\"'"
|
||||
assert_success
|
||||
assert_output "traefik"
|
||||
|
||||
run /bin/bash -c "dokku proxy:set $TEST_APP type"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku proxy:set --global type"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(proxy:set) invalid port mapping set" {
|
||||
run /bin/bash -c "dokku proxy:set $TEST_APP http:80:80"
|
||||
echo "output: $output"
|
||||
|
||||
@@ -168,6 +168,55 @@ web
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(ps:report) stop-timeout-seconds raw vs computed vs global" {
|
||||
run /bin/bash -c "dokku ps:set --global stop-timeout-seconds"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet ps:report $TEST_APP --format json | jq -r '.\"stop-timeout-seconds\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet ps:report $TEST_APP --format json | jq -r '.\"global-stop-timeout-seconds\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet ps:report $TEST_APP --format json | jq -r '.\"computed-stop-timeout-seconds\"'"
|
||||
assert_success
|
||||
assert_output "30"
|
||||
|
||||
run /bin/bash -c "dokku ps:set --global stop-timeout-seconds 90"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet ps:report $TEST_APP --format json | jq -r '.\"global-stop-timeout-seconds\"'"
|
||||
assert_success
|
||||
assert_output "90"
|
||||
|
||||
run /bin/bash -c "dokku --quiet ps:report $TEST_APP --format json | jq -r '.\"computed-stop-timeout-seconds\"'"
|
||||
assert_success
|
||||
assert_output "90"
|
||||
|
||||
run /bin/bash -c "dokku ps:set $TEST_APP stop-timeout-seconds 45"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet ps:report $TEST_APP --format json | jq -r '.\"stop-timeout-seconds\"'"
|
||||
assert_success
|
||||
assert_output "45"
|
||||
|
||||
run /bin/bash -c "dokku --quiet ps:report $TEST_APP --format json | jq -r '.\"global-stop-timeout-seconds\"'"
|
||||
assert_success
|
||||
assert_output "90"
|
||||
|
||||
run /bin/bash -c "dokku --quiet ps:report $TEST_APP --format json | jq -r '.\"computed-stop-timeout-seconds\"'"
|
||||
assert_success
|
||||
assert_output "45"
|
||||
|
||||
run /bin/bash -c "dokku ps:set $TEST_APP stop-timeout-seconds"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku ps:set --global stop-timeout-seconds"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(ps:restart-policy) default policy" {
|
||||
run /bin/bash -c "dokku --quiet ps:report $TEST_APP --ps-restart-policy"
|
||||
echo "output: $output"
|
||||
|
||||
@@ -133,6 +133,112 @@ teardown() {
|
||||
create_app
|
||||
}
|
||||
|
||||
@test "(registry:report) image-repo raw vs computed vs global" {
|
||||
run /bin/bash -c "dokku registry:set --global image-repo-template"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-image-repo\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-global-image-repo-template\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-computed-image-repo\"'"
|
||||
assert_success
|
||||
assert_output_not_exists
|
||||
|
||||
run /bin/bash -c "dokku registry:set --global image-repo-template 'dokku/{{ APP }}'"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-global-image-repo-template\"'"
|
||||
assert_success
|
||||
assert_output 'dokku/{{ APP }}'
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-computed-image-repo\"'"
|
||||
assert_success
|
||||
assert_output "dokku/$TEST_APP"
|
||||
|
||||
run /bin/bash -c "dokku registry:set $TEST_APP image-repo my/$TEST_APP"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-image-repo\"'"
|
||||
assert_success
|
||||
assert_output "my/$TEST_APP"
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-computed-image-repo\"'"
|
||||
assert_success
|
||||
assert_output "my/$TEST_APP"
|
||||
|
||||
run /bin/bash -c "dokku registry:set $TEST_APP image-repo"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku registry:set --global image-repo-template"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(registry:report) push-on-release raw vs computed vs global" {
|
||||
run /bin/bash -c "dokku registry:set --global push-on-release"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-push-on-release\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-global-push-on-release\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-computed-push-on-release\"'"
|
||||
assert_success
|
||||
assert_output "false"
|
||||
|
||||
run /bin/bash -c "dokku registry:set --global push-on-release true"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-global-push-on-release\"'"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-computed-push-on-release\"'"
|
||||
assert_success
|
||||
assert_output "true"
|
||||
|
||||
run /bin/bash -c "dokku registry:set $TEST_APP push-on-release false"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-push-on-release\"'"
|
||||
assert_success
|
||||
assert_output "false"
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-computed-push-on-release\"'"
|
||||
assert_success
|
||||
assert_output "false"
|
||||
|
||||
run /bin/bash -c "dokku registry:set $TEST_APP push-on-release"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku registry:set --global push-on-release"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(registry:report) push-extra-tags raw" {
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-push-extra-tags\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku registry:set $TEST_APP push-extra-tags release,stable"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet registry:report $TEST_APP --format json | jq -r '.\"registry-push-extra-tags\"'"
|
||||
assert_success
|
||||
assert_output "release,stable"
|
||||
|
||||
run /bin/bash -c "dokku registry:set $TEST_APP push-extra-tags"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(registry) registry:set server" {
|
||||
run /bin/bash -c "dokku registry:set --global server ghcr.io"
|
||||
echo "output: $output"
|
||||
|
||||
97
tests/unit/scheduler.bats
Normal file
97
tests/unit/scheduler.bats
Normal file
@@ -0,0 +1,97 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load test_helper
|
||||
|
||||
setup() {
|
||||
global_setup
|
||||
create_app
|
||||
}
|
||||
|
||||
teardown() {
|
||||
dokku scheduler:set --global selected >/dev/null 2>&1 || true
|
||||
destroy_app
|
||||
global_teardown
|
||||
}
|
||||
|
||||
@test "(scheduler) scheduler:help" {
|
||||
run /bin/bash -c "dokku scheduler"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output_contains "Manage schedulers"
|
||||
help_output="$output"
|
||||
|
||||
run /bin/bash -c "dokku scheduler:help"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output_contains "Manage schedulers"
|
||||
assert_output "$help_output"
|
||||
}
|
||||
|
||||
@test "(scheduler:report) selected raw vs computed vs global" {
|
||||
run /bin/bash -c "dokku scheduler:set --global selected"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report $TEST_APP --format json | jq -r '.\"scheduler-selected\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report $TEST_APP --format json | jq -r '.\"scheduler-global-selected\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report $TEST_APP --format json | jq -r '.\"scheduler-computed-selected\"'"
|
||||
assert_success
|
||||
assert_output "docker-local"
|
||||
|
||||
run /bin/bash -c "dokku scheduler:set --global selected null"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report $TEST_APP --format json | jq -r '.\"scheduler-global-selected\"'"
|
||||
assert_success
|
||||
assert_output "null"
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report $TEST_APP --format json | jq -r '.\"scheduler-computed-selected\"'"
|
||||
assert_success
|
||||
assert_output "null"
|
||||
|
||||
run /bin/bash -c "dokku scheduler:set $TEST_APP selected docker-local"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report $TEST_APP --format json | jq -r '.\"scheduler-selected\"'"
|
||||
assert_success
|
||||
assert_output "docker-local"
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report $TEST_APP --format json | jq -r '.\"scheduler-global-selected\"'"
|
||||
assert_success
|
||||
assert_output "null"
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report $TEST_APP --format json | jq -r '.\"scheduler-computed-selected\"'"
|
||||
assert_success
|
||||
assert_output "docker-local"
|
||||
|
||||
run /bin/bash -c "dokku scheduler:set $TEST_APP selected"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku scheduler:set --global selected"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(scheduler:report) --global --format json" {
|
||||
run /bin/bash -c "dokku scheduler:set --global selected"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report --global --format json | jq -e ."
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report --global --format json | jq -r '.\"scheduler-global-selected\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report --global --format json | jq -r '.\"scheduler-computed-selected\"'"
|
||||
assert_success
|
||||
assert_output "docker-local"
|
||||
|
||||
run /bin/bash -c "dokku --quiet scheduler:report --global --format json | jq -r 'has(\"scheduler-selected\")'"
|
||||
assert_success
|
||||
assert_output "false"
|
||||
}
|
||||
@@ -184,6 +184,38 @@ teardown() {
|
||||
assert_output "mount_volume:/mount"
|
||||
}
|
||||
|
||||
@test "(storage:report) build/deploy/run mounts raw" {
|
||||
run /bin/bash -c "dokku --quiet storage:report $TEST_APP --format json | jq -r '.\"storage-build-mounts\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet storage:report $TEST_APP --format json | jq -r '.\"storage-deploy-mounts\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku --quiet storage:report $TEST_APP --format json | jq -r '.\"storage-run-mounts\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku storage:mount $TEST_APP /tmp/storage-mount:/mount"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku --quiet storage:report $TEST_APP --format json | jq -r '.\"storage-deploy-mounts\"'"
|
||||
assert_success
|
||||
assert_output "/tmp/storage-mount:/mount"
|
||||
|
||||
run /bin/bash -c "dokku --quiet storage:report $TEST_APP --format json | jq -r '.\"storage-run-mounts\"'"
|
||||
assert_success
|
||||
assert_output "/tmp/storage-mount:/mount"
|
||||
|
||||
run /bin/bash -c "dokku --quiet storage:report $TEST_APP --format json | jq -r '.\"storage-build-mounts\"'"
|
||||
assert_success
|
||||
assert_output ""
|
||||
|
||||
run /bin/bash -c "dokku storage:unmount $TEST_APP /tmp/storage-mount:/mount"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "(storage) storage:create / storage:list-entries / storage:destroy" {
|
||||
run /bin/bash -c "dokku storage:create rdmtest-entry"
|
||||
echo "output: $output"
|
||||
|
||||
Reference in New Issue
Block a user