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

V4 new #814

Merged
merged 43 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
85ce2c8
Migrate from go-ps to gopsutil for better process detection (#597)
aelsabbahy Sep 7, 2020
6c123f8
Mount (#601)
aelsabbahy Nov 13, 2020
bb9c5a6
Merge master into v4
aelsabbahy Dec 24, 2020
3f8f586
Fix build failures
aelsabbahy Dec 24, 2020
142c562
Normalize seliux mount options for integration testing
aelsabbahy Dec 24, 2020
e787e01
Attempt to normalize tests across docker installs and fix osx test setup
aelsabbahy Dec 24, 2020
28634ee
Try different osx image
aelsabbahy Dec 24, 2020
1929d66
Rename binaries to strip '-alpha' (#671)
Dec 27, 2020
bb7cb47
F openrc runlevels (#668)
aelsabbahy Dec 27, 2020
427348a
POC/DRAFT: Add transforms (#576)
aelsabbahy Dec 30, 2020
a6d2f2a
Fix mountinfo splitting when there's a quoted comma
aelsabbahy Jan 7, 2021
6bf1c78
Improve have_patterns error message
aelsabbahy May 19, 2022
4be04f9
Add syntax checks for type casting
aelsabbahy Sep 5, 2022
dfb1186
Rename file.contains to file.contents
aelsabbahy Sep 5, 2022
12cef65
ToString converter add suppert for []interface{}
aelsabbahy Sep 5, 2022
1fe5571
Convert headers to lowercase. fixes #760
aelsabbahy Sep 15, 2022
2ebb1f8
Fix contains -> contents, lowercase headers and contain-element float64
aelsabbahy Sep 15, 2022
bf22f82
Enhance all resources to support key override
aelsabbahy Sep 24, 2022
61922e6
Sort output in documentation format
aelsabbahy Oct 7, 2022
14c3d45
Fix typo in contain_element message
aelsabbahy Nov 17, 2022
db012e4
Track start and end times per-test
aelsabbahy Feb 18, 2023
04eea68
Cache test results in serve instead of output
aelsabbahy Feb 18, 2023
2a8c9e5
Use exit code 78 if test file is unparseable
aelsabbahy Feb 18, 2023
ef62d85
Full EVR for rpm and fix failing tests
aelsabbahy Feb 19, 2023
aa990cf
more tests
aelsabbahy Apr 18, 2023
5baad14
Increase test coverage
aelsabbahy Jun 3, 2023
a83de2b
Fixed numeric eq bug
aelsabbahy Jun 4, 2023
07f40df
Make output more consistent
aelsabbahy Jun 5, 2023
46f455a
Update dependencies
aelsabbahy Jun 15, 2023
e2e0037
Merge remote-tracking branch 'origin/master' into v4
aelsabbahy Jun 16, 2023
4639175
Fix some merge conflicts
aelsabbahy Jun 24, 2023
5815f53
Revert "Migrate from go-ps to gopsutil for better process detection (…
aelsabbahy Jun 25, 2023
28c1e53
Revert 1fe5571b6a47735e15ed313f38618c32bd3dc919 change http.headers b…
aelsabbahy Jun 25, 2023
b50a296
FIX: use filepath.Join() in order to be OS agnostic
aelsabbahy Jun 25, 2023
9e7b3db
FIX: only run matcher_tests on linux
aelsabbahy Jun 25, 2023
ef7c933
FIX: replace failing www.microsoft.com test
aelsabbahy Jun 25, 2023
d8c9c93
FIX: trusty dockerfile merge regression
aelsabbahy Jun 25, 2023
2a48c91
Run all tests (except failing prometheus) as part of CI. Seems they w…
aelsabbahy Jun 25, 2023
e7e7841
Remove bench output, add some comments
aelsabbahy Jul 15, 2023
a77d2bb
Changed: include_raw by default, provide exclude_raw as a format flag
aelsabbahy Jul 17, 2023
a41dac2
Changed: go-funk -> lo
aelsabbahy Jul 17, 2023
d178d97
Changed: temp fix to deal with httpbin.org slowness.
aelsabbahy Jul 17, 2023
783a2b4
Locking down version in install.sh, to avoid RC being installed
aelsabbahy Jul 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ deploy:
api_key:
secure: ijNltjw/mIHIOx8vLZ6asUun3SbY7D+XZbs5NX8vcIv0jvOiwaaT1hqny7SQBHfGZzqHsYUSS/GYAYJdBqKFFfGmTZsl90hFT6D0RGdz9C71UVxNFX4wQ5KQ/WVvdMT2SrLymGvu9TvoU0VG8OWqWVdxSlUPf6qOTGAagrzg+Tbsbb6czeiG67mlBBL23XSlfMG1p45UxzvI41SZj2R3ElUb0hym1CrFaoC36PBGrb0x41TXzvd8J7cu6xDzgczYhnYQQZpS6f2YcqNV1z0f+P67EQqQiDWIIcK2jE/YG+RgM8cbpLMiMec8CDiwNCsejBA5EbVMlGJlODvBXT5NmMBeugueqfSHEfkl5qZTQG4AOAT7UsqbnM7r0NqzmaE5Lj90igvJK6rNsH1ZRe79WfSsTtuzlkkouHGvyoz0M8gnMSzpbbwoyIy+UT0hhPMoZvIpXfr43en5WkbkPKfop0p4Vjc8NGg0iD45q1JAvIVTtz/WvWTknM1P8e3u+TiDTaZkcJJmFaBqgaeLoWktOGfi54p9nhgQnSyBYt4PyvhWDQs7QFmX0BdKlqJCESvUOJTe1t6zJJsV7Gn/3sGCN7JUEwbnXTsCoMjjFFUvQdm0Ur7t7/2xU3kO+dyfqcdM/5SYFeppQcjHI0ckhI51mIoBTsJsGvaVwKKL1I4cyBU=
file:
- release/goss-alpha-darwin-amd64
- release/goss-alpha-darwin-amd64.sha256
- release/goss-darwin-amd64
- release/goss-darwin-amd64.sha256
Comment on lines +44 to +45
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same for windows...?

- release/goss-linux-amd64
- release/goss-linux-amd64.sha256
- release/goss-linux-386
Expand Down
29 changes: 22 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,20 @@ install: release/goss-linux-amd64

test:
$(info INFO: Starting build $@)
./ci/go-test.sh $(pkgs)
./ci/go-test.sh

cov:
go test -coverpkg=./... -coverprofile=c.out ./...
# go tool cover -func ./c.out

funcov:
go test -coverpkg=./... -coverprofile=c.out ./...
go tool cover -func ./c.out

htmlcov:
go test -v -coverpkg=./... -coverprofile=c.out ./...
go tool cover -html ./c.out


lint:
$(info INFO: Starting build $@)
Expand All @@ -36,15 +49,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 $*
Expand All @@ -71,15 +82,19 @@ push-images:
$(info INFO: Starting build $@)
development/push_images.sh

# Update the matcher test golden files
update-matcher-tests:
go test -v -run '^TestMatchers' . -update

test-darwin-all: test-short-all test-int-darwin-all
# linux _does_ have the docker-style testing, but does _not_ currently have the same style integration tests darwin+windows do, _because_ of the docker-style testing.
test-linux-all: test-short-all test-int-64 test-int-32
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
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

<a href="https://asciinema.org/a/4suhr8p42qcn6r7crfzt6cc3e?autoplay=1" target="_blank"><img src="https://cloud.githubusercontent.com/assets/6783261/17330426/ce7ad066-5894-11e6-84ea-29fd4207af58.gif" alt="asciicast"></a>

**Note:** For an even faster way of doing this, see: [autoadd](https://github.com/goss-org/goss/blob/master/docs/manual.md#autoadd-aa---auto-add-all-matching-resources-to-test-suite)

**Note:** For testing docker containers see the [dgoss](https://github.com/goss-org/goss/tree/master/extras/dgoss) wrapper. Also, user submitted wrapper scripts for Kubernetes [kgoss](https://github.com/goss-org/goss/tree/master/extras/kgoss) and Docker Compose [dcgoss](https://github.com/goss-org/goss/tree/master/extras/dcgoss).

**Note:** For some Docker/Kubernetes healthcheck, health endpoint, and
Expand Down
2 changes: 1 addition & 1 deletion ci/go-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -euo pipefail

command -v go

go test -coverprofile="c.out" "${1}"
go test -coverpkg=./... ./... -skip '^TestPrometheus' -coverprofile="c.out"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Mind commenting the reason for the skip?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ooh, this one is easy.. it fails 😄

To be fair, I did run it on the main branch and it fails there too. Basically, the way that shell script was written it wasn't actually running those tests.. so they may have never worked.. not sure.. didn't try to check out the original commit to see.

I can take a look as a follow-up PR, or since you're familiar with the code, maybe give it a second look? Maybe I broke something a while back and not noticed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hahaha, ok. Reasonably sure it ran and passed when introduced, but I also haven't gone back and checked.

Once this is merged, I propose to spend some time enhancing our build & test pipeline.


sed 's|github.com/goss-org/goss/||' <"c.out" >"c.out.tmp"

Expand Down
7 changes: 3 additions & 4 deletions cmd/goss/goss.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ func timeoutFlag(value time.Duration) cli.DurationFlag {
}

func main() {
startTime := time.Now()
app := cli.NewApp()
app.EnableBashCompletion = true
app.Version = version
Expand Down Expand Up @@ -149,7 +148,7 @@ func main() {
},
Action: func(c *cli.Context) error {
fatalAlphaIfNeeded(c)
code, err := goss.Validate(newRuntimeConfigFromCLI(c), startTime)
code, err := goss.Validate(newRuntimeConfigFromCLI(c))
if err != nil {
color.Red(fmt.Sprintf("Error: %v\n", err))
}
Expand Down Expand Up @@ -416,14 +415,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

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess at this point I can remove the alpha flag altogether and just document that it's not as featureful/stable as Linux..

Copy link
Member Author

Choose a reason for hiding this comment

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

Looking back at the history of this, I'll put it back on your plate.. What are your thoughts on alpha vs non-alpha.

Your PR renamed the files.. seems they're fairly stable from your comment 2-3 years back.

#671

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd be fine with renaming each binary to remove the alpha segment. We still have the flag/env-var & message, and we have integration tests that run and pass for a lot of the functionality; missing or broken things can be iterated incrementally at need.

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.

Expand Down