From 726f04750240a9b1611d574b8373e14f9e541070 Mon Sep 17 00:00:00 2001 From: Peter Mounce Date: Sat, 26 Dec 2020 16:55:26 +0000 Subject: [PATCH] Rename binaries to strip '-alpha' As discussed in https://github.com/aelsabbahy/goss/pull/663#issuecomment-743127235; strip the -alpha naming, keep the messaging, keep the --use-alpha flag and env-var. This allows people to remove edge-cases from their installation, yet retains the clearly-set expectations of support being community-driven. Fixes #651. --- .travis.yml | 8 ++++---- Makefile | 12 +++++------- cmd/goss/goss.go | 4 ++-- docs/platform-feature-parity.md | 11 ++++++----- integration-tests/goss/darwin/commands/add.goss.yaml | 2 +- .../goss/darwin/commands/autoadd.goss.yaml | 2 +- .../goss/darwin/commands/help.goss.yaml | 2 +- .../goss/darwin/commands/validate.goss.yaml | 2 +- .../goss/windows/commands/add.goss.yaml | 2 +- .../goss/windows/commands/autoadd.goss.yaml | 2 +- .../goss/windows/commands/help.goss.yaml | 2 +- .../goss/windows/commands/validate.goss.yaml | 2 +- integration-tests/run-serve-tests.sh | 4 ---- .../{run-tests-alpha.sh => run-validate-tests.sh} | 4 ---- release-build.sh | 4 ---- 15 files changed, 25 insertions(+), 38 deletions(-) rename integration-tests/{run-tests-alpha.sh => run-validate-tests.sh} (90%) diff --git a/.travis.yml b/.travis.yml index 155f0f708..6cb0abaf5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,16 +41,16 @@ deploy: token: secure: hEHCC4EN7iHz7pIWKRn2qw22NTqUxnuBp59wfAlLBtV26j5rHMzSu8mlxkJInusDUGLJiNLrZPRWN0mzOdIXalbUeLhlX7EflJgEj6Q0MchUR69LzCAp0KMIFL1Sfq0v81VgujRLUUy5utxDL8Er4tZknn2PpXAMzpO+ozjNRDhhSEM4iMXfY3bcOIMnx6XRgCjFCb036wlBgOfdgv5fwm2PP638DTKar4W6ZZbqCQByhJ5RyL3BMDPTT0moA/tYbG+FA6p6Rme1OcBkMnpsiJZoB3u8gxsNiEJ43/C2RcULW/18qqp2UVD5FipSDYP7GQ5ugKCbgpWXb0Ctl8o4hv1UsNl0XoyJhAt0PRp6vqnyy6LWB2FzX30Xj/vGIhO/IfiJvspHxpatTk7Esjr46K4u9ao/x63LX6F6yI1ZTfbzt2MhRYRjwh4ORNfqhysuzXChftX1S9hj6s6gO0/zqoOsRK/PK8DProbUn4bxrGOBzi16P0GEk4agWWUm74Pis9qCThXNW8MXEV936KvE1wb1RxTACYvFBtO2IM5eQ26t2Y7mGJd7FJup9LR4oUtUTSbYo5P2Sal6xntBKH5P4nwEtM+TtHoeSCKQ3X5i1VSdvAH7soEAly6rP5d5wwPhqqx9mgUPYO/3ulvxLJOYHamrbj6nlHDXnCEoj1ZMxX4= file: - - release/goss-alpha-darwin-amd64 - - release/goss-alpha-darwin-amd64.sha256 + - release/goss-darwin-amd64 + - release/goss-darwin-amd64.sha256 - release/goss-linux-amd64 - release/goss-linux-amd64.sha256 - release/goss-linux-386 - release/goss-linux-386.sha256 - release/goss-linux-arm - release/goss-linux-arm.sha256 - - release/goss-alpha-windows-amd64.exe - - release/goss-alpha-windows-amd64.exe.sha256 + - release/goss-windows-amd64.exe + - release/goss-windows-amd64.exe.sha256 - extras/dgoss/dgoss - extras/dgoss/dgoss.sha256 skip_cleanup: true diff --git a/Makefile b/Makefile index 3fb5a3dcb..a5e1aa8c1 100644 --- a/Makefile +++ b/Makefile @@ -36,15 +36,13 @@ bench: $(info INFO: Starting build $@) go test -bench=. -alpha-test-%: release/goss-% +test-int-validate-%: release/goss-% $(info INFO: Starting build $@) - ./integration-tests/run-tests-alpha.sh $* + ./integration-tests/run-validate-tests.sh $* test-int-serve-%: release/goss-% $(info INFO: Starting build $@) ./integration-tests/run-serve-tests.sh $* -# shim to account for linux being not in alpha -test-int-serve-linux-amd64: test-int-serve-alpha-linux-amd64 release/goss-%: $(GO_FILES) ./release-build.sh $* @@ -53,7 +51,7 @@ release: $(MAKE) clean $(MAKE) build -build: release/goss-alpha-darwin-amd64 release/goss-linux-386 release/goss-linux-amd64 release/goss-linux-arm release/goss-alpha-windows-amd64 +build: release/goss-darwin-amd64 release/goss-linux-386 release/goss-linux-amd64 release/goss-linux-arm release/goss-windows-amd64 gen: $(info INFO: Starting build $@) @@ -78,8 +76,8 @@ test-windows-all: test-short-all test-int-windows-all test-int-64: centos7 wheezy trusty alpine3 arch test-int-serve-linux-amd64 test-int-32: centos7-32 wheezy-32 trusty-32 alpine3-32 arch-32 -test-int-darwin-all: alpha-test-alpha-darwin-amd64 test-int-serve-alpha-darwin-amd64 -test-int-windows-all: alpha-test-alpha-windows-amd64 test-int-serve-alpha-windows-amd64 +test-int-darwin-all: test-int-validate-darwin-amd64 test-int-serve-darwin-amd64 +test-int-windows-all: test-int-validate-windows-amd64 test-int-serve-windows-amd64 test-int-all: test-int-32 test-int-64 centos7-32: build diff --git a/cmd/goss/goss.go b/cmd/goss/goss.go index 633b5471c..02b326077 100644 --- a/cmd/goss/goss.go +++ b/cmd/goss/goss.go @@ -408,14 +408,14 @@ func addAlphaFlagIfNeeded(app *cli.App) { if runtime.GOOS == "darwin" || runtime.GOOS == "windows" { app.Flags = append(app.Flags, cli.StringFlag{ Name: "use-alpha", - Usage: fmt.Sprintf("goss is alpha-quality. Set to 1 to use anyway."), + Usage: fmt.Sprintf("goss on macOS/Windows is alpha-quality. Set to 1 to use anyway."), EnvVar: "GOSS_USE_ALPHA", Value: "0", }) } } -const msgFormat string = `WARNING: goss for this platform (%q) is alpha-quality, work-in-progress, and not yet exercised within continuous integration. +const msgFormat string = `WARNING: goss for this platform (%q) is alpha-quality, work-in-progress and community-supported. You should not expect everything to work. Treat linux as the canonical behaviour to expect. diff --git a/docs/platform-feature-parity.md b/docs/platform-feature-parity.md index 95ac5ee56..ba2fabd2f 100644 --- a/docs/platform-feature-parity.md +++ b/docs/platform-feature-parity.md @@ -4,7 +4,8 @@ macOS and Windows binaries are new and considered alpha-quality. Some functional To clearly signal that, goss emits a log message on every invocation saying so, linking here, then exits with a clear error. -To try out the alpha functionality, you must do one of +To try out the alpha functionality, you must do one of: + * pass `--use-alpha=1` to the root command - e.g. `goss --use-alpha=1 validate`. * set an environment variable `GOSS_USE_ALPHA=1`. @@ -140,8 +141,8 @@ You can find goss-files that are used to populate this matrix within `integratio Run all of the `darwin`/`windows` integration tests: ```bash -make alpha-test-alpha-darwin-amd64 -make alpha-test-alpha-windows-amd64 +make test-darwin-amd64 +make test-windows-amd64 ``` The script finds all goss spec files within `integration-tests` then filters to just ones matching the passed OS-name, then runs `validate` against them. @@ -153,11 +154,11 @@ This is a special-case test since it requires a persistent process, then to make #### macOS `serve` ```bash -make "test-serve-alpha-darwin-amd64" +make "test-serve-darwin-amd64" ``` #### Windows `serve` ```bash -make "test-serve-alpha-windows-amd64" +make "test-serve-windows-amd64" ``` diff --git a/integration-tests/goss/darwin/commands/add.goss.yaml b/integration-tests/goss/darwin/commands/add.goss.yaml index c07a27f90..cd75e38cc 100644 --- a/integration-tests/goss/darwin/commands/add.goss.yaml +++ b/integration-tests/goss/darwin/commands/add.goss.yaml @@ -3,7 +3,7 @@ command: "add addr 127.0.0.1": exit-status: 0 - exec: release/goss-alpha-darwin-amd64 --use-alpha=1 add addr 127.0.0.1 + exec: release/goss-darwin-amd64 --use-alpha=1 add addr 127.0.0.1 stdout: - "timeout: 500" stderr: [] diff --git a/integration-tests/goss/darwin/commands/autoadd.goss.yaml b/integration-tests/goss/darwin/commands/autoadd.goss.yaml index f2243cf92..830244ba4 100644 --- a/integration-tests/goss/darwin/commands/autoadd.goss.yaml +++ b/integration-tests/goss/darwin/commands/autoadd.goss.yaml @@ -2,7 +2,7 @@ command: "autoadd /Users/travis": exit-status: 0 - exec: "release/goss-alpha-darwin-amd64 --use-alpha=1 autoadd /Users/travis" + exec: "release/goss-darwin-amd64 --use-alpha=1 autoadd /Users/travis" stdout: - 'file:' - ' exists: true' diff --git a/integration-tests/goss/darwin/commands/help.goss.yaml b/integration-tests/goss/darwin/commands/help.goss.yaml index 7af8f2740..d57d2bb64 100644 --- a/integration-tests/goss/darwin/commands/help.goss.yaml +++ b/integration-tests/goss/darwin/commands/help.goss.yaml @@ -2,7 +2,7 @@ command: help: exit-status: 0 - exec: "release/goss-alpha-darwin-amd64 help" + exec: "release/goss-darwin-amd64 help" stdout: - alpha stderr: [] diff --git a/integration-tests/goss/darwin/commands/validate.goss.yaml b/integration-tests/goss/darwin/commands/validate.goss.yaml index edf22cad6..6d79a6d68 100644 --- a/integration-tests/goss/darwin/commands/validate.goss.yaml +++ b/integration-tests/goss/darwin/commands/validate.goss.yaml @@ -3,7 +3,7 @@ command: "validate": exit-status: 0 - exec: "release/goss-alpha-darwin-amd64 --use-alpha=1 -g integration-tests/goss/darwin/commands/validate-input.yaml validate" + exec: "release/goss-darwin-amd64 --use-alpha=1 -g integration-tests/goss/darwin/commands/validate-input.yaml validate" stdout: - 'Count: 1' - 'Failed: 0' diff --git a/integration-tests/goss/windows/commands/add.goss.yaml b/integration-tests/goss/windows/commands/add.goss.yaml index 8b4784895..d65d1899f 100644 --- a/integration-tests/goss/windows/commands/add.goss.yaml +++ b/integration-tests/goss/windows/commands/add.goss.yaml @@ -3,7 +3,7 @@ command: "add addr 127.0.0.1": exit-status: 0 - exec: release\goss-alpha-windows-amd64 --use-alpha=1 add addr 127.0.0.1 + exec: release\goss-windows-amd64 --use-alpha=1 add addr 127.0.0.1 stdout: - "timeout: 500" stderr: [] diff --git a/integration-tests/goss/windows/commands/autoadd.goss.yaml b/integration-tests/goss/windows/commands/autoadd.goss.yaml index cd88a70dc..5ed311a2b 100644 --- a/integration-tests/goss/windows/commands/autoadd.goss.yaml +++ b/integration-tests/goss/windows/commands/autoadd.goss.yaml @@ -2,7 +2,7 @@ command: "autoadd Administrator": exit-status: 0 - exec: release\goss-alpha-windows-amd64 --use-alpha=1 autoadd Administrator + exec: release\goss-windows-amd64 --use-alpha=1 autoadd Administrator stdout: - 'user:' - ' name: Administrator' diff --git a/integration-tests/goss/windows/commands/help.goss.yaml b/integration-tests/goss/windows/commands/help.goss.yaml index d1c5463bc..2f8bce527 100644 --- a/integration-tests/goss/windows/commands/help.goss.yaml +++ b/integration-tests/goss/windows/commands/help.goss.yaml @@ -2,7 +2,7 @@ command: help: exit-status: 0 - exec: release\goss-alpha-windows-amd64 help + exec: release\goss-windows-amd64 help stdout: - alpha stderr: [] diff --git a/integration-tests/goss/windows/commands/validate.goss.yaml b/integration-tests/goss/windows/commands/validate.goss.yaml index c504b5ec7..fe2456acd 100644 --- a/integration-tests/goss/windows/commands/validate.goss.yaml +++ b/integration-tests/goss/windows/commands/validate.goss.yaml @@ -3,7 +3,7 @@ command: "validate": exit-status: 0 - exec: "release\\goss-alpha-windows-amd64 --use-alpha=1 -g integration-tests/goss/windows/commands/validate-input.yaml validate" + exec: "release\\goss-windows-amd64 --use-alpha=1 -g integration-tests/goss/windows/commands/validate-input.yaml validate" stdout: - 'Count: 1' - 'Failed: 0' diff --git a/integration-tests/run-serve-tests.sh b/integration-tests/run-serve-tests.sh index 7e0390790..cd0301a0f 100755 --- a/integration-tests/run-serve-tests.sh +++ b/integration-tests/run-serve-tests.sh @@ -9,10 +9,6 @@ IFS='- ' read -r -a segments <<< "${platform_spec}" os="${segments[0]}" arch="${segments[1]}" -if [[ "${segments[0]}" == "alpha" ]]; then - os="${segments[1]}" - arch="${segments[2]}" -fi find_open_port() { local startAt="${1:?"Supply start of port range"}" diff --git a/integration-tests/run-tests-alpha.sh b/integration-tests/run-validate-tests.sh similarity index 90% rename from integration-tests/run-tests-alpha.sh rename to integration-tests/run-validate-tests.sh index 05676f050..6d8e73bea 100755 --- a/integration-tests/run-tests-alpha.sh +++ b/integration-tests/run-validate-tests.sh @@ -8,10 +8,6 @@ IFS='- ' read -r -a segments <<< "${platform_spec}" os="${segments[0]}" arch="${segments[1]}" -if [[ "${segments[0]}" == "alpha" ]]; then - os="${segments[1]}" - arch="${segments[2]}" -fi repo_root="$(git rev-parse --show-toplevel)" export GOSS_BINARY="${repo_root}/release/goss-${platform_spec}" diff --git a/release-build.sh b/release-build.sh index b9d7b9d5e..c40d8bf6a 100755 --- a/release-build.sh +++ b/release-build.sh @@ -9,10 +9,6 @@ IFS='- ' read -r -a segments <<< "${platform_spec}" os="${segments[0]}" arch="${segments[1]}" -if [[ "${segments[0]}" == "alpha" ]]; then - os="${segments[1]}" - arch="${segments[2]}" -fi output_dir="release/" output_fname="goss-${platform_spec}"