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

system tests: remove unhelpful assertions #4502

Merged
merged 1 commit into from
Jan 5, 2023

Conversation

edsantiago
Copy link
Member

Regular primitive bats uses assertions like '[ $foo = something ]'.
These are worthless for debugging: when they fail, all you know
is that foo is not "something" but you don't know what foo is.

Find and replace those assertions with 'assert', which is
more informative. Instances found via:

$ ack '^ [' tests/.bats

There are many matches for 'test' (instead of '[') but those
mostly look like file-existence ones, which are less evil
than string-check tests. I'm leaving those be for now.

Signed-off-by: Ed Santiago [email protected]

None

@rhatdan
Copy link
Member

rhatdan commented Jan 5, 2023

/approve
LGTM
@flouthoc PTAL

Copy link
Collaborator

@flouthoc flouthoc left a comment

Choose a reason for hiding this comment

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

LGTM
/lgtm
/hold

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 5, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: edsantiago, flouthoc, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Regular primitive bats uses assertions like '[ $foo = something ]'.
These are worthless for debugging: when they fail, all you know
is that foo is not "something" but you don't know what foo _is_.

Find and replace those assertions with 'assert', which is
more informative. Instances found via:

   $ ack '^ *\[' tests/*.bats

There are many matches for 'test' (instead of '[') but those
mostly look like file-existence ones, which are less evil
than string-check tests. I'm leaving those be for now.

Signed-off-by: Ed Santiago <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented Jan 5, 2023

/lgtm

@edsantiago
Copy link
Member Author

/hold cancel

@openshift-merge-robot openshift-merge-robot merged commit 2f25e14 into containers:main Jan 5, 2023
@edsantiago edsantiago deleted the bats_fixes branch January 5, 2023 17:02
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants