Skip to content

Releases: goss-org/goss

v0.4.9

26 Sep 15:22
5704120
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.4.8...v0.4.9

v0.4.8

19 Jul 15:32
aed5633
Compare
Choose a tag to compare

What's Changed

Internal Development related changes

Many many thanks to @dklimpel for all the massive effort improving CI!

New Contributors

Full Changelog: v0.4.7...v0.4.8

v0.4.7

16 May 17:54
334f214
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.4.5...v0.4.7

v0.4.6

24 Mar 23:19
Compare
Choose a tag to compare

What's Changed

  • "socket" as one more valid filetype for "file" testing by @fruit in #858
  • fix outcome label in goss_tests_run_outcomes_total by @sebhoss in #860
  • Bump golang.org/x/crypto from 0.14.0 to 0.17.0 by @dependabot in #861
  • add more labels to prometheus output by @sebhoss in #864
  • kgoss: fixes issue #868 bei using a simpler chmod command by @erkules in #869
  • feat: s390x build option added to build package for IBM Z series by @harpaldhillon in #863
  • IDE json schema: skip is not mandatory for process tests by @rasschaert in #874
  • Added: MkDocs documentation by @noirbizarre in #856 (note: not yet live)
  • Added timeout for mount command in goss by @melvilgit in #877
  • Update dependencies and move to go 1.21 by @ripienaar in #879
  • docs: remove Molecule from contributions section by @retr0h in #881
  • Update prometheus package to fix dependabot finding by @aelsabbahy in #887
  • Add uid/gid check in file module by @smutel in #883

New Contributors

Full Changelog: v0.4.4...v0.4.6

v0.4.4

10 Nov 02:06
a807f94
Compare
Choose a tag to compare

What's Changed

  • Fixed: Return the error when a command fails to start by @aelsabbahy in #855

Full Changelog: v0.4.3...v0.4.4

v0.4.3

06 Nov 14:45
10b895d
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.4.2...v0.4.3

v0.4.2

14 Sep 23:24
b30f3fa
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.4.1...v0.4.2

v0.4.1

02 Sep 19:29
c673853
Compare
Choose a tag to compare

Features

What's Changed

Full Changelog: v0.4.0...v0.4.1

v0.4.0

23 Aug 14:21
7e70e27
Compare
Choose a tag to compare

Features

Thanks to all the contributors who have helped with this.

Summary:

  • Goss v0.4.X introduces some major enhancements to the matching logic allowing far more flexibility for asserts.
    • For example, can assert that the output of echo "3" is less than 5.
  • Introduces some minor breaking changes (see below)
  • v4 migration guide - Please submit issues/PRs if anything ewas missed in the migration guide

Matcher change

v4 introduced the ability to compare different types and more advanced string matching. See matchers section in the manual for more information.

For example:

command:
  echo_test:
    # command that outputs JSON, but this could be anything, http response, command output, etc
    exec: |
      echo '{"string_value": "15"}'
    exit-status: 0
    stdout:
      # advanced string parsing
      gjson:
        # extract "string_value"
        string_value:
          and:
            # The value is numerically <= 20 (auto type conversion)
            - le: 20
            # The value is numerically 15
            - 15
            # Equal does a strict check, the types have to match, hence string_value is "15" but not 15
            - equal: "15"
            - not: {equal: 15}

This conversion also allows treating an io.Reader (memory efficient line-by-line parsing) as a whole string (when compared with a string). This has the benefit of showing the full command output, which was a long-requested feature. For example:

$ cat goss.yaml
command:
  echo_test:
    exec: |
      echo 'hello world'
    exit-status: 0
    stdout: |
      goodbye world

$ goss v
.F

Failures/Skipped:

Command: echo_test: stdout:
Expected
    "hello world\n"
to equal
    "goodbye world\n"

Total Duration: 0.001s
Count: 2, Failed: 1, Skipped: 0

Breaking changes

  • Changed: file.Contains -> file.Contents
  • Changed: RPM Version is now full EVR (-qf "%|EPOCH?{%{EPOCH}:}:{}|%{VERSION}-%{RELEASE}), this opens the door for proper rpm version comparison in the future
  • For array matches (ex. user.Groups) duplicate entries will raise an error if they don't exist in the system.

In goss 3.X this would succeed:

user:
  xxx:
    exists: true
    groups:
        - foo
        - wheel
        - wheel

Now it will throw an error unless groups actually contain 2 copies of "wheel" in its response array from the system.

You can mimic the old behavior by modifying the test as follows:

user:
  xxx:
    exists: true
    groups:
      and:
        - contain-element: foo
        - contain-element: wheel
        - contain-element: wheel
  • Goss is more aware of types with goss v4, so ensure when doing string matching that integers and floats are surrounded by double quotes.

For example, this no longer works:

command:
  echo "123":
    exit-status: 0
    stdout:
    - 123

New way:

command:
  echo "123":
    exit-status: 0
    stdout:
    - "123"

Changes

  • Added: transforms support (closes #538)
    • Allows comparison of string to int, ex: ensuring a systctl output below/above a specific number (closes #220)
    • Allows JSON parsing/validation support (closes #578)
    • Allows comparing command output to a string, this will display the failed output on failure (closes #483)
    • -o include_raw will show the non-transformed value
  • Added: Some new matchers
    • equal matcher added to do strict type comparison (e.x. string to string)
    • contain-substring
    • have-patterns - This mimics the existing default behavior of file contents and command output
    • contain-elements - checks that an array value matches a set of matchers
  • Added: runlevels support for service
  • Added: option to sort output (closes #416)
  • Added: All resources now support key override (closes #518, closes #742)
  • Added: Use exit code 78 if test file is unparseable (closes #317)
  • Changed: removed alpha from non-linux binary names
  • Changed: StartTime is no longer calculated from goss start. Calculated from first test start, this allows accurate reporting when showing a cached result
  • Changed: Completely re-worked matchers and shared output logic
  • Changed: Cache test results in serve instead of output (closes #612)
  • Added: Significantly improved test coverage of matcher, output code
  • Changed: Doc to reference cat -E /proc/<PID>/comm to avoid whitespace issues (closes #762)
  • Changed: Removed file.Size from autoadd (closes #262)
  • Added: matcher.as-reader this allows the matcher string to behave as an io.Reader output. Can be useful for testing
  • Removed: json_online output format, use: goss v -f json -o oneline
  • Added: windows and darwin alpha binaries back in the release (#829)
  • Added: string diff support (#827)
  • Added: mount vfs-opts support (#826)

v0.4.0-rc.3

07 Aug 20:40
32aae76
Compare
Choose a tag to compare
v0.4.0-rc.3 Pre-release
Pre-release

Features

Special thanks to @matsuo for fixing the darwin/windows alpha release process

Summary:

  • Goss v0.4.X introduces some major enhancements to the matching logic allowing far more flexibility for asserts.
    • For example, can assert that the output of echo "3" is less than 5.
  • Introduces some minor breaking changes (see below)

Since v0.4.0-rc.1

  • Added: windows and darwin alpha binaries back in the release (#829)
  • Added: string diff support (#827)
  • Changed: split ops and vfs-opts (#826)
    • Note: this effectively removes the mount.opts breaking change when upgrading from v0.3.X

Matcher change

v4 introduced the ability to compare different types and more advanced string matching. See matchers section in the manual for more information.

For example:

command:
  echo_test:
    # command that outputs JSON, but this could be anything, http response, command output, etc
    exec: |
      echo '{"string_value": "15"}'
    exit-status: 0
    stdout:
      # advanced string parsing
      gjson:
        # extract "string_value"
        string_value:
          and:
            # The value is numerically <= 20 (auto type conversion)
            - le: 20
            # The value is numerically 15
            - 15
            # Equal does a strict check, the types have to match, hence string_value is "15" but not 15
            - equal: "15"
            - not: {equal: 15}

This conversion also allows treating an io.Reader (memory efficient line-by-line parsing) as a whole string (when compared with a string). This has the benefit of showing the full command output, which was a long-requested feature. For example:

$ cat goss.yaml
command:
  echo_test:
    exec: |
      echo 'hello world'
    exit-status: 0
    stdout: |
      goodbye world

$ goss v
.F

Failures/Skipped:

Command: echo_test: stdout:
Expected
    "hello world\n"
to equal
    "goodbye world\n"

Total Duration: 0.001s
Count: 2, Failed: 1, Skipped: 0

Breaking changes

  • Changed: file.Contains -> file.Contents
  • Changed: RPM Version is now full EVR (-qf "%|EPOCH?{%{EPOCH}:}:{}|%{VERSION}-%{RELEASE}), this opens the door for proper rpm version comparison in the future
  • For array matches (ex. user.Groups) duplicate entries will raise an error if they don't exist in the system.

In goss 3.X this would succeed:

user:
  xxx:
    exists: true
    groups:
        - foo
        - wheel
        - wheel

Now it will throw an error unless groups actually contain 2 copies of "wheel" in its response array from the system.

You can mimic the old behavior by modifying the test as follows:

user:
  xxx:
    exists: true
    groups:
      and:
        - contain-element: foo
        - contain-element: wheel
        - contain-element: wheel
  • Goss is more aware of types with goss v4, so ensure when doing string matching that integers and floats are surrounded by double quotes.

For example, this no longer works:

command:
  echo "123":
    exit-status: 0
    stdout:
    - 123

New way:

command:
  echo "123":
    exit-status: 0
    stdout:
    - "123"

Changes

  • Added: transforms support (closes #538)
    • Allows comparison of string to int, ex: ensuring a systctl output below/above a specific number (closes #220)
    • Allows JSON parsing/validation support (closes #578)
    • Allows comparing command output to a string, this will display the failed output on failure (closes #483)
    • -o include_raw will show the non-transformed value
  • Added: Some new matchers
    • equal matcher added to do strict type comparison (e.x. string to string)
    • contain-substring
    • have-patterns - This mimics the existing default behavior of file contents and command output
    • contain-elements - checks that an array value matches a set of matchers
  • Added: runlevels support for service
  • Added: option to sort output (closes #416)
  • Added: All resources now support key override (closes #518, closes #742)
  • Added: Use exit code 78 if test file is unparseable (closes #317)
  • Changed: removed alpha from non-linux binary names
  • Changed: StartTime is no longer calculated from goss start. Calculated from first test start, this allows accurate reporting when showing a cached result
  • Changed: Completely re-worked matchers and shared output logic
  • Changed: Cache test results in serve instead of output (closes #612)
  • Added: Significantly improved test coverage of matcher, output code
  • Changed: Doc to reference cat -E /proc/<PID>/comm to avoid whitespace issues (closes #762)
  • Changed: Removed file.Size from autoadd (closes #262)
  • Added: matcher.as-reader this allows the matcher string to behave as an io.Reader output. Can be useful for testing
  • Removed: json_online output format, use: goss v -f json -o oneline