Skip to content

Extend unit test with the ability to assert certain files not existing - #261

Open
furtib wants to merge 4 commits into
Ericsson:mainfrom
furtib:extend_unit_test_file_not_exists
Open

Extend unit test with the ability to assert certain files not existing#261
furtib wants to merge 4 commits into
Ericsson:mainfrom
furtib:extend_unit_test_file_not_exists

Conversation

@furtib

@furtib furtib commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Why:
We want to be able to write tests that assert that certain files do not exist (and require that all files listed under files exist).

What:

  • Added parameter to assert that a file does not exist (if these files are also in files, remove them)
  • Made it a requirement for all file = ["..."] patterns to match a file.

Addresses:
none

@furtib
furtib requested a review from Szelethus July 5, 2026 13:01
@furtib furtib self-assigned this Jul 5, 2026
@furtib furtib added the enhancement New feature or request label Jul 5, 2026
@furtib furtib mentioned this pull request Jul 5, 2026

@Szelethus Szelethus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I know I'm nitpicking, but the phrasing is off. The overall PR direction is good.

Comment thread test/unit/grep_check.py Outdated
Comment thread test/unit/grep_check.py
args = parse_args()
check_args(args)

assert_files_missing(args.no_files)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I've been looking at this PR for a bit, and this is the point that convinced me that "absent" isn't the correct phrase. You write "missing" here, but those files are "absent", but that doesn't really telegraph whats desiren, which is "expectedly missing" or "should be missing".

@furtib furtib Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

renamed it to expected_missing_file.

Comment thread test/unit/grep_check.py Outdated
furtib and others added 2 commits July 5, 2026 15:42
Co-authored-by: Kristóf Umann <dkszelethus@gmail.com>
@furtib
furtib requested a review from Szelethus July 5, 2026 13:48

@Szelethus Szelethus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM after some naming adjustments.

Comment thread test/unit/grep_check.py
help="Path or glob pattern to the file(s) to search within.",
)
parser.add_argument(
"--no_files",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we adjust this name as well?

Comment thread test/unit/grep_check.py
"""Entry point for the pattern-matching test."""
args = parse_args()
check_args(args)
def assert_files_missing(files):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
def assert_files_missing(files):
def assert_expectedly_missing_files(files):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants