Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Aug 7, 2023

Mend Renovate

This PR contains the following updates:

Package Update Change
goss-org/goss patch v0.4.0-rc.1 -> v0.4.2

Release Notes

goss-org/goss (goss-org/goss)

v0.4.2

Compare Source

What's Changed

Full Changelog: goss-org/goss@v0.4.1...v0.4.2

v0.4.1

Compare Source

Features

What's Changed

Full Changelog: goss-org/goss@v0.4.0...v0.4.1

v0.4.0

Compare Source

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

Compare Source

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

v0.4.0-rc.2

Compare Source

Features

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: 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

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot changed the title Update dependency goss-org/goss to v0.4.0-rc.2 Update dependency goss-org/goss to v0.4.0-rc.3 Aug 7, 2023
@renovate renovate bot force-pushed the renovate/goss-org-goss-0.x branch from 8c3545c to 46c6bce Compare August 7, 2023 23:13
@renovate renovate bot force-pushed the renovate/goss-org-goss-0.x branch from 46c6bce to 9dd262b Compare August 23, 2023 16:50
@renovate renovate bot changed the title Update dependency goss-org/goss to v0.4.0-rc.3 Update dependency goss-org/goss to v0.4.0 Aug 23, 2023
@renovate renovate bot force-pushed the renovate/goss-org-goss-0.x branch from 9dd262b to 43ad70a Compare September 2, 2023 22:13
@renovate renovate bot changed the title Update dependency goss-org/goss to v0.4.0 Update dependency goss-org/goss to v0.4.1 Sep 2, 2023
@renovate renovate bot force-pushed the renovate/goss-org-goss-0.x branch from 43ad70a to 7f25bd6 Compare September 5, 2023 20:49
@renovate renovate bot changed the title Update dependency goss-org/goss to v0.4.1 Update dependency goss-org/goss to v0.4.2 Sep 15, 2023
@renovate renovate bot force-pushed the renovate/goss-org-goss-0.x branch from 7f25bd6 to d0779fc Compare September 15, 2023 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants