Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename binaries to strip '-alpha' #671

Merged
merged 3 commits into from
Dec 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 5 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,13 @@ bench:
$(info INFO: Starting build $@)
go test -bench=.

alpha-test-%: release/goss-%
test-int-validate-%: release/goss-%
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could equally have called this test-int-all-commands-% and similarly run-command-tests.sh but I thought that might have been confusing with the command assertion specifically; what do you think, @aelsabbahy?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no opinion on this currently.

I have some plans to re-write all of the integration tests.. but want to wait until after v4

$(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 $*
Expand All @@ -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 $@)
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cmd/goss/goss.go
Original file line number Diff line number Diff line change
Expand Up @@ -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."),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though this message should never display on other platforms, I figured this more clearly set expectations.

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.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured that the integration tests running in CI merited this rewording.

You should not expect everything to work. Treat linux as the canonical behaviour to expect.
Expand Down
11 changes: 6 additions & 5 deletions docs/platform-feature-parity.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down Expand Up @@ -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-int-validate-darwin-amd64
make test-int-validate-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.
Expand All @@ -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-int-serve-darwin-amd64"
```

#### Windows `serve`

```bash
make "test-serve-alpha-windows-amd64"
make "test-int-serve-windows-amd64"
```
2 changes: 1 addition & 1 deletion integration-tests/goss/darwin/commands/add.goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/goss/darwin/commands/autoadd.goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/goss/darwin/commands/help.goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/goss/darwin/commands/validate.goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/goss/windows/commands/add.goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/goss/windows/commands/autoadd.goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/goss/windows/commands/help.goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/goss/windows/commands/validate.goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 0 additions & 4 deletions integration-tests/run-serve-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ IFS='- ' read -r -a segments <<< "${platform_spec}"

os="${segments[0]}"
arch="${segments[1]}"
if [[ "${segments[0]}" == "alpha" ]]; then
os="${segments[1]}"
arch="${segments[2]}"

if [[ "${os}" == "linux" ]]; then
echo "OS is ${os}. This script is not for running tests on the different flavours of linux."
echo "Linux is exercised via the integration-tests/test.sh currently, because linux can be"
echo "verified via docker containers; macOS and Windows cannot."
echo "This script is for macOS and Windows, and runs tests that are expected to pass on"
echo "Travis-CI provided images, running nakedly (no containerisation) on the hosts there."
exit 1
fi

repo_root="$(git rev-parse --show-toplevel)"
Expand Down
4 changes: 0 additions & 4 deletions release-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down