Skip to content

Conversation

@Taknok
Copy link
Contributor

@Taknok Taknok commented Nov 15, 2023

Description

The 'cmp' matcher when used with a negation as 'should_not' has a confusion formating when control fails:
image

This, because the 'format_actual' always pass 'false' to the 'format_expectation'. Thus the 'format_expectation' never reach the 'negate_str'.

When passing the negate value to the 'format_expectation' the output is more intuitive:
image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New content (non-breaking change)
  • Breaking change (a content change which would break existing functionality or processes)
  • other

Checklist:

  • I have read the CONTRIBUTING document.

@Taknok Taknok requested a review from a team as a code owner November 15, 2023 15:58
@netlify
Copy link

netlify bot commented Nov 15, 2023

Deploy Preview for chef-inspec canceled.

Name Link
🔨 Latest commit 0dcf73a
🔍 Latest deploy log https://app.netlify.com/sites/chef-inspec/deploys/65cd25315d43b300080f6bc2

@chef-expeditor
Copy link
Contributor

Hello Taknok! Thanks for the pull request!

Here is what will happen next:

  1. Your PR will be reviewed by the maintainers.
  2. Possible Outcomes
    a. If everything looks good, one of them will approve it, and your PR will be merged.
    b. The maintainer may request follow-on work (e.g. code fix, linting, etc). We would encourage you to address this work in 2-3 business days to keep the conversation going and to get your contribution in sooner.
    c. Cases exist where a PR is neither aligned to Chef InSpec's product roadmap, or something the team can own or maintain long-term. In these cases, the maintainer will provide justification and close out the PR.

Thank you for contributing!

@Taknok
Copy link
Contributor Author

Taknok commented Jan 8, 2024

I allow myself to send a message to up the topic as there was no comment since the beginning and 2 month passed.

@Taknok
Copy link
Contributor Author

Taknok commented Feb 8, 2024

Should I drop this PR ? Is this an unwanted feature ?

Copy link
Contributor

@Vasu1105 Vasu1105 left a comment

Choose a reason for hiding this comment

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

Thanks @Taknok and sorry for delay in reply. LGTM. Could you please rebase the branch and fix the lint failures and add unit test if possible around this?

The 'cmp' matcher when used with a negation as 'should_not' does
has a confusion formating when control fails:
expected: 3
     got: 3

This, because the 'format_actual' always pass 'false' to the
'format_expectation'. Thus the 'format_expectation' never reach the
'negate_str'.

Signed-off-by: Pg <pg.developper.fr@gmail.com>
@Taknok
Copy link
Contributor Author

Taknok commented Feb 13, 2024

Hi,
I rebased my branch onto the main.
Which linting failure are you refering ? I do not see the buildkite report. The others do not show linting failures.
My modification does not impact the tests as the code was already there, the option was just not passed till the end.
On inspec/main:
image

On taknok/main:
image

@Vasu1105
Copy link
Contributor

@Taknok This PR also missing DCO sign off please follow the Details https://github.com/chef/chef/blob/main/CONTRIBUTING.md#developer-certification-of-origin-dco and do the needful.

Signed-off-by: Pg <pg.developper.fr@gmail.com>
Co-authored-by: Vasundhara Jagdale <vjagdale@progress.com>
@Taknok
Copy link
Contributor Author

Taknok commented Feb 14, 2024

Push force: The linting commit has also the DCO now.

Copy link
Contributor

@Vasu1105 Vasu1105 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @Taknok.

@Vasu1105 Vasu1105 merged commit f5fd9a7 into inspec:main Feb 20, 2024
Vasu1105 added a commit that referenced this pull request Mar 13, 2024
* Allow the negate formating for cmp

The 'cmp' matcher when used with a negation as 'should_not' does
has a confusion formating when control fails:
expected: 3
     got: 3

This, because the 'format_actual' always pass 'false' to the
'format_expectation'. Thus the 'format_expectation' never reach the
'negate_str'.

Signed-off-by: Pg <pg.developper.fr@gmail.com>

* Linting

Signed-off-by: Pg <pg.developper.fr@gmail.com>
Co-authored-by: Vasundhara Jagdale <vjagdale@progress.com>

---------

Signed-off-by: Pg <pg.developper.fr@gmail.com>
Co-authored-by: Vasundhara Jagdale <vjagdale@progress.com>
Vasu1105 added a commit that referenced this pull request Mar 13, 2024
* Allow the negate formating for cmp

The 'cmp' matcher when used with a negation as 'should_not' does
has a confusion formating when control fails:
expected: 3
     got: 3

This, because the 'format_actual' always pass 'false' to the
'format_expectation'. Thus the 'format_expectation' never reach the
'negate_str'.



* Linting




---------

Signed-off-by: Pg <pg.developper.fr@gmail.com>
Co-authored-by: Pg <pg.developper.fr@gmail.com>
Nik08 pushed a commit that referenced this pull request Sep 13, 2024
* Allow the negate formating for cmp

The 'cmp' matcher when used with a negation as 'should_not' does
has a confusion formating when control fails:
expected: 3
     got: 3

This, because the 'format_actual' always pass 'false' to the
'format_expectation'. Thus the 'format_expectation' never reach the
'negate_str'.

Signed-off-by: Pg <pg.developper.fr@gmail.com>

* Linting

Signed-off-by: Pg <pg.developper.fr@gmail.com>
Co-authored-by: Vasundhara Jagdale <vjagdale@progress.com>

---------

Signed-off-by: Pg <pg.developper.fr@gmail.com>
Co-authored-by: Vasundhara Jagdale <vjagdale@progress.com>
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.

3 participants