Skip to content

Commit

Permalink
V4 new (#814)
Browse files Browse the repository at this point in the history
* Migrate from go-ps to gopsutil for better process detection (#597)

* Migrate from go-ps to gopsutil for better process detection

* Remove debugging code

* Mount (#601)

* Add stale.yml config

* Change stale.yml label

* Add VfsOpts to mount

* Use mountinfo filter

* Fix build failures

* Normalize seliux mount options for integration testing

* Attempt to normalize tests across docker installs and fix osx test setup

* Try different osx image

* Rename binaries to strip '-alpha' (#671)

* Rename binaries to strip '-alpha'

As discussed in #663 (comment); 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.

* set expectations for future-us re: macOS+Windows vs linux

* fix doc

* F openrc runlevels (#668)

* service: Add support for OpenRC runlevels

* Omit empty runlevel

* Update documentation

* Update integration tests

* Use consistent pattern for configu default values

- Remove struct tag `default` value reflection

* Make runLevels a testable attribute

* empty commit to try to trigger travis

* Update trusty to reflect precise changes

Co-authored-by: Berney <berne.campbell@gmail.com>

* POC/DRAFT: Add transforms (#576)

* Add transforms

* wip add transforms work

* Add some examples to make sense of this

* Handle floats/ints better

* Convert validatecontails to gomega

* wip

* Add gjson and contain-substring

* wip

* Subclass all matchers adding String()

* I don't evne know what this is.. should have checked it in back when I wrote it

* Migrate GomegaMatcher -> GossMatcher

* lots of changes + drop json-iterator

* Move output related logic to outputs

* Add include_raw flag

* Add bench output format

* Update have_patterns to check input. Add stubs to make Not matcher act as omegaMatcher

* SetEscapeHTML(false) for semver constraint

* Ensure have-Key_with_value works

* remove have-key-with-value

* Fix error compact output. Add oMegaMatcher stubs. Ensure matcher vs m consistent

* Cleanup matchers

* Cleanup TestResult struct and remove need for dyno

* Update all deps

* Update tranformer tests and add summary line to bench output format

* Update readme

* Conditionally print missing and empty values. Sanitize found and expected values for consistency

* Check value is valid before checking IsNil()

* Initial docs change

* WIP fix for pretty print

* Swap order on video vs blog for dgoss docs

* Updated all tests except for semver

* Fix all unit tests

* Fix detection of when matcher is set

* Update documentation

* Update docs/manual.md

Co-authored-by: Peter Mounce <pete@neverrunwithscissors.com>

* Update docs/manual.md

Co-authored-by: Peter Mounce <pete@neverrunwithscissors.com>

* gjson: Validate json before doing gets

* Make errors more clear

* Remove unused field

* Bump go version

* Update doc

* Fix regression with gomega errors

* Fix #262 no need to add file size by default

* Fix output formats

* Use proper quoting for windows test

* Add error checking for gjson path not found

Co-authored-by: Peter Mounce <pete@neverrunwithscissors.com>

* Fix mountinfo splitting when there's a quoted comma

* Improve have_patterns error message

* Add syntax checks for type casting

* Rename file.contains to file.contents

* ToString converter add suppert for []interface{}

* Convert headers to lowercase. fixes #760

* Fix contains -> contents, lowercase headers and contain-element float64

* Enhance all resources to support key override

closes #518, closes #742

* Sort output in documentation format

closes #416

* Fix typo in contain_element message

* Track start and end times per-test

This also changes the way total time is calculated
in the output summary.

total time = endTime of last test - start time of first test

* Cache test results in serve instead of output

closes #612

* Use exit code 78 if test file is unparseable

closes #317

* Full EVR for rpm and fix failing tests

* more tests

* Increase test coverage

* Fixed numeric eq bug

* Make output more consistent

* Update dependencies

* Fix some merge conflicts

* Revert "Migrate from go-ps to gopsutil for better process detection (#597)"

This reverts commit 85ce2c8.

* Revert 1fe5571 change http.headers back to io.Reader

* FIX: use filepath.Join() in order to be OS agnostic

* FIX: only run matcher_tests on linux

* FIX: replace failing www.microsoft.com test

* FIX: trusty dockerfile merge regression

* Run all tests (except failing prometheus) as part of CI. Seems they were not running

* Remove bench output, add some comments

* Changed: include_raw by default, provide exclude_raw as a format flag

* Changed: go-funk -> lo

* Changed: temp fix to deal with httpbin.org slowness.

Need to move to offline testing to avoid flakiness

* Locking down version in install.sh, to avoid RC being installed

---------

Co-authored-by: Peter Mounce <petermounce@improbable.io>
Co-authored-by: Berney <berne.campbell@gmail.com>
Co-authored-by: Peter Mounce <pete@neverrunwithscissors.com>
  • Loading branch information
4 people committed Jul 19, 2023
1 parent bbb8ecb commit 2e5720b
Show file tree
Hide file tree
Showing 135 changed files with 4,783 additions and 1,219 deletions.
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
- 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"

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."),
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

0 comments on commit 2e5720b

Please sign in to comment.