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

More test result methods #145

Merged
merged 3 commits into from
Jan 29, 2025
Merged

More test result methods #145

merged 3 commits into from
Jan 29, 2025

Conversation

EnricoMi
Copy link
Collaborator

@EnricoMi EnricoMi commented Jan 13, 2025

Adds more test state helper methods like is_failure, is_error, is_rerun and is_flaky. Further, provides easier access to all interim result types (iterating over TestCase or calling interim_result property).

@EnricoMi EnricoMi requested a review from weiwei January 13, 2025 13:24
@EnricoMi EnricoMi force-pushed the more-is-result-methods branch from 764a6e0 to ee24df5 Compare January 13, 2025 13:26
@EnricoMi
Copy link
Collaborator Author

CC @Cube707

@Cube707
Copy link
Contributor

Cube707 commented Jan 13, 2025

CC @Cube707

Sorry, but how is this different from #136 + #144?
Shouldn't we continue work on the existing, open PR's?

I mean if this gets it merged faster OK, I just need this working.
But I am not a real fan of getting my changes merged via a different PR and under a different author...

@EnricoMi
Copy link
Collaborator Author

EnricoMi commented Jan 13, 2025

I made another iteration over the underlying rework in #144. And I couldn't find your original PR to build my further changes on that, so I created a new branch with my changes.

I just found your PR and have added your credits to this PR: f3ee6a3

I hope this works for you. Sorry for the confusion.

@EnricoMi EnricoMi force-pushed the more-is-result-methods branch 2 times, most recently from 13dcd90 to 83268bf Compare January 13, 2025 14:25
@Cube707
Copy link
Contributor

Cube707 commented Jan 13, 2025

I just found your PR and have added your credits to this PR: f3ee6a3

nice thanks 👍

Copy link
Contributor

@Cube707 Cube707 left a comment

Choose a reason for hiding this comment

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

Some Thoughts I allready had on a previous iterration

junitparser/junitparser.py Outdated Show resolved Hide resolved
junitparser/junitparser.py Outdated Show resolved Hide resolved
Copy link
Contributor

@Cube707 Cube707 left a comment

Choose a reason for hiding this comment

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

some more notes on stuff

def result(self, value: Union[FinalResult, List[FinalResult]]):
# Check typing
if not (isinstance(value, FinalResult) or
isinstance(value, list) and all(isinstance(item, FinalResult) for item in value)):
Copy link
Contributor

@Cube707 Cube707 Jan 14, 2025

Choose a reason for hiding this comment

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

I am always unsure how well people know about operator binding order.
So it might be preferable to make the order of operation clear by adding parenthesis around the .. and ..

junitparser/xunit2.py Outdated Show resolved Hide resolved
junitparser/junitparser.py Outdated Show resolved Hide resolved
junitparser/xunit2.py Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Jan 14, 2025

Test Results

   48 files  ± 0     48 suites  ±0   3m 23s ⏱️ -1s
  103 tests + 2    103 ✅ + 2    0 💤 ±0  0 ❌ ±0 
4 944 runs  +96  4 773 ✅ +96  171 💤 ±0  0 ❌ ±0 

Results for commit 2b9358c. ± Comparison against base commit 3719033.

This pull request removes 1 and adds 3 tests. Note that renamed tests count towards both.
tests.test_xunit2.Test_TestCase ‑ test_case_fromstring
tests.test_general.Test_TestCase ‑ test_case_is_error
tests.test_xunit2.Test_TestCase ‑ test_case_flaky_fromstring
tests.test_xunit2.Test_TestCase ‑ test_case_rerun_fromstring

♻️ This comment has been updated with latest results.

@EnricoMi EnricoMi force-pushed the more-is-result-methods branch from 91c5255 to 1813897 Compare January 14, 2025 19:47
@EnricoMi EnricoMi force-pushed the more-is-result-methods branch from 1813897 to b28d948 Compare January 29, 2025 10:41
@EnricoMi EnricoMi marked this pull request as ready for review January 29, 2025 10:42
EnricoMi and others added 3 commits January 29, 2025 12:38
- Add is_failure and is_error to JUnit TestCase
- Add is_rerun and is_flaky to XUnit2 TestCase
- Provide access to XUnit2 interim (rerun & flaky) results

Co-authored-by: Jan Wille <mail@janwille.de>
Co-authored-by: Jan Wille <mail@janwille.de>
@EnricoMi EnricoMi force-pushed the more-is-result-methods branch from 7f4d4fe to 2b9358c Compare January 29, 2025 11:38
@EnricoMi EnricoMi merged commit a094649 into master Jan 29, 2025
29 checks passed
@EnricoMi EnricoMi deleted the more-is-result-methods branch January 29, 2025 13:36
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