goss-org / goss

Quick and Easy server testing/validation
https://goss.rocks
Apache License 2.0
5.58k stars 470 forks source link

Update run-serve-tests.sh to run "make test-int-serve-darwin-amd64" on macOS #831

Closed matsuo closed 1 year ago

matsuo commented 1 year ago
Checklist

Description of change

This pull request fixes run-validate-tests.sh to run "make test-int-serve-darwin-amd64" on macOS.

On macOS, "make test-int-serve-darwin-amd64" failed because there is no ss command and shuf command in the default environment.

% make release/goss-darwin-amd64
./release-build.sh darwin-amd64
% make "test-int-serve-darwin-amd64"                  
INFO: Starting build test-int-serve-darwin-amd64
./integration-tests/run-serve-tests.sh darwin-amd64
Using: '/Users/USERNAME/go/src/github.com/goss-org/goss/release/goss-darwin-amd64', cwd: '/Users/USERNAME/go/src/github.com/goss-org/goss'
./integration-tests/run-serve-tests.sh: line 24: ss: command not found
./integration-tests/run-serve-tests.sh: line 27: shuf: command not found
panic: uncaught error
Traceback (most recent call first):
  at ./integration-tests/run-serve-tests.sh:24 in find_open_port()
  at ./integration-tests/run-serve-tests.sh:54 in main()
sort -u exited 127
panic: uncaught error
./integration-tests/run-serve-tests.sh: line 28: shuf: command not found
Traceback (most recent call first):
  at ./integration-tests/run-serve-tests.sh:24 in find_open_port()
panic: uncaught error
  at ./integration-tests/run-serve-tests.sh:54 in main()
sort exited 141
Traceback (most recent call first):
  at ./integration-tests/run-serve-tests.sh:13 in find_open_port()
  at ./integration-tests/run-serve-tests.sh:54 in main()
shuf -i "${startAt}-${endAt}" -n "${how_many}" exited 127
panic: uncaught error
Traceback (most recent call first):
  at ./integration-tests/run-serve-tests.sh:54 in main()
((curr < end)) exited 127
panic: uncaught error
Traceback (most recent call first):
  at ./integration-tests/run-serve-tests.sh:54 in main()
open_port="$(find_open_port 1025 65335)" exited 127
Killing goss serve process to clean up, exit code for tests was 0...
No matching processes belonging to you were found
panic: uncaught error
Traceback (most recent call first):
  at ./integration-tests/run-serve-tests.sh:32 in cleanup()
  at ./integration-tests/run-serve-tests.sh:54 in main()
[[ "${os}" == "darwin" ]] exited 1
make: *** [test-int-serve-darwin-amd64] Error 1
matsuo commented 1 year ago

Thanks for your reviewing!