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

Add more CLI tests #152

Merged
merged 14 commits into from
Feb 16, 2025
Merged

Add more CLI tests #152

merged 14 commits into from
Feb 16, 2025

Conversation

Cube707
Copy link
Contributor

@Cube707 Cube707 commented Jan 14, 2025

Fixes #79.

Copy link

github-actions bot commented Jan 14, 2025

Test Results

   48 files  ±  0     48 suites  ±0   3m 25s ⏱️ +4s
  122 tests + 17    122 ✅ + 17    0 💤 ±0  0 ❌ ±0 
5 856 runs  +816  5 685 ✅ +816  171 💤 ±0  0 ❌ ±0 

Results for commit 5e44eef. ± Comparison against base commit 410b987.

This pull request removes 3 and adds 20 tests. Note that renamed tests count towards both.
tests.test_cli ‑ test_verify[data/jenkins.xml-1]
tests.test_cli ‑ test_verify[data/no_fails.xml-0]
tests.test_cli ‑ test_verify[data/normal.xml-1]
tests.test_cli ‑ test_merge
tests.test_cli ‑ test_merge_output_to_terminal
tests.test_cli ‑ test_verify[jenkins.xml-1]
tests.test_cli ‑ test_verify[no_fails.xml-0]
tests.test_cli ‑ test_verify[normal.xml-1]
tests.test_cli ‑ test_verify_with_glob
tests.test_cli.Test_CommandlineOptions ‑ test_help_shows_subcommands
tests.test_cli.Test_CommandlineOptions ‑ test_merge_argument_output
tests.test_cli.Test_CommandlineOptions ‑ test_merge_argument_path
tests.test_cli.Test_CommandlineOptions ‑ test_merge_help_options
…

♻️ This comment has been updated with latest results.

@Cube707 Cube707 force-pushed the feat/cli-tests branch 3 times, most recently from 7bef61a to 0af9fee Compare January 15, 2025 16:44
@Cube707
Copy link
Contributor Author

Cube707 commented Jan 15, 2025

I updated the testing to use python 3.9

python 3.6, 3.7 and 3.8 are End-Of-Life

@Cube707
Copy link
Contributor Author

Cube707 commented Jan 15, 2025

@EnricoMi ready for review now

@EnricoMi EnricoMi changed the title Adding more test for the cli Add more CLI tests Jan 16, 2025
@Cube707 Cube707 requested a review from EnricoMi January 17, 2025 13:51
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.x"]
python-version: ["3.9", "3.x"]
Copy link
Owner

Choose a reason for hiding this comment

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

10+ percent of users are still on older versions so it's probably better to still have some test coverage.

https://pypistats.org/packages/junitparser

@Cube707 Cube707 force-pushed the feat/cli-tests branch 2 times, most recently from f032fec to 2c275c3 Compare January 25, 2025 16:30
@Cube707
Copy link
Contributor Author

Cube707 commented Jan 25, 2025

this PR is on hold until #154 is resolved

@Cube707
Copy link
Contributor Author

Cube707 commented Jan 25, 2025

#154 once again shows why these tests are needed...

@EnricoMi
Copy link
Collaborator

@Cube707 please go ahead, #154 is fixed.

the command-parser for the `verify` subcommand is never used directly.
But as we might want to expand the parser and for consistency, we want to keep it around
under `lxml` the `encoding` property "UTF-8" is written in capslock, without `lxml` its lowercase.
So we ignore that property and only test for the "<?xml version='1.0'" part
@Cube707
Copy link
Contributor Author

Cube707 commented Feb 10, 2025

The PR should be ready now and CI passes,

not sure what to do about the codacy issue

@Cube707 Cube707 requested a review from weiwei February 10, 2025 15:55
@EnricoMi
Copy link
Collaborator

not sure what to do about the codacy issue

It complains about Unused variable 'verify_parser':
https://app.codacy.com/gh/weiwei/junitparser/pull-requests/152/issues#issue-b00f2d90b386fa0bad7e275a4f7bfd50

@Cube707
Copy link
Contributor Author

Cube707 commented Feb 11, 2025

It complains about Unused variable 'verify_parser':

Yeah which I set to be ignored but it only seems to apply to flake8 and I am not sure why two linters are used.

@@ -65,39 +70,25 @@ def _parser(prog_name=None): # pragma: no cover
)

# command: verify
merge_parser = command_parser.add_parser(
verify_parser = command_parser.add_parser( # noqa: F841
Copy link
Collaborator

Choose a reason for hiding this comment

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

I presume the variable is not needed if unused.

Suggested change
verify_parser = command_parser.add_parser( # noqa: F841
command_parser.add_parser(

Copy link
Contributor Author

@Cube707 Cube707 Feb 11, 2025

Choose a reason for hiding this comment

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

The verify_parser is still relevant and used and might be modified in the future.

Its variable binding is only unused because it currently only has the attributes inherited from the abstract_parser and no explicit ones of its own.

I believe it should be kept for consistency with the other parsers and to increase the readability for future modifications.

That's why I ignored the warning for flake8

@weiwei
Copy link
Owner

weiwei commented Feb 16, 2025

Thanks for the PR.

The codacy config is at the server side so it can't be skipped locally. I've fixed it for you.

@weiwei weiwei merged commit bca6112 into weiwei:master Feb 16, 2025
38 checks passed
@Cube707 Cube707 deleted the feat/cli-tests branch February 17, 2025 07:49
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.

Add tests of the CLI
3 participants