pytest-html icon indicating copy to clipboard operation
pytest-html copied to clipboard

Original test cases order kept

Open sygutss opened this issue 3 years ago • 6 comments

Because that sometimes somebody could want to have a possibility to keep the original order of test cases in the report, that possibility was added. The logic is control by specific flag in config file.

  1. Added necessary option flag in config.
  2. Added necessary logic if flag is set to True.
  3. Added necessary tests for new logic.
  4. Added additional section in documentation which describes how to turn on the new behaviour.

sygutss avatar Apr 21 '22 10:04 sygutss

[Question] Because of the fact that right now there is a problem with the current black version (Linters are failed) Should I also provide a fix for that under that PR? The latest version of black works fine and all pre-commit checks with all tests are passed.

sygutss avatar Apr 21 '22 10:04 sygutss

Thanks for the PR. 🙏

I'll fix black. 👍

BeyondEvil avatar Apr 21 '22 17:04 BeyondEvil

Try rebasing with master now.

BeyondEvil avatar Apr 21 '22 23:04 BeyondEvil

Rebased and code formatting fixes made by black

sygutss avatar Apr 22 '22 09:04 sygutss

See that tests for py37-windows failed, dunno why... Can we re-run those checks? I closed and re-opened the pull request, probably checks start is waiting for some approval.

sygutss avatar Apr 25 '22 20:04 sygutss

And now it failed for py38-windows.

I might just add re-run flaky for windows.

BeyondEvil avatar Apr 26 '22 08:04 BeyondEvil

Hi guys,

this feature looks really great and is exactly what I'm looking for. @sygutss @BeyondEvil any update in this PR? See any chance to merge it in near future? Thanks!

zwibldog avatar Feb 02 '23 13:02 zwibldog

As soon as 4.0.0 is GA (4.0.0rc0 out now!) I'll revisit this.

BeyondEvil avatar Mar 06 '23 17:03 BeyondEvil

@sygutss @zwibldog This should be the default behaviour in 4.0.0rc1.

Please test and report any issues. 🙏

BeyondEvil avatar Apr 05 '23 20:04 BeyondEvil

Hi @BeyondEvil I've updated to 4.0.0rc1 but it's not like expected in default behavior. Behavior is like the previous approach - By default we have firstly error cases and after them passed cases. After clicking on ordering in that column (header) we can switch opposite - First passed cases after failed cases. There is a lack of the possibility to achieve the original ordering

Conclusion - the original ordering is not the default behavior.

sygutss avatar Apr 06 '23 09:04 sygutss

Ok, thanks. I think I initially misunderstood the ask.

But OK, I get what you want now.

This happens to coincide with https://github.com/pytest-dev/pytest-html/issues/521

So I'll see if I can add a query param to set initial sort order (column, asc/desc, and "original" or something).

BeyondEvil avatar Apr 06 '23 09:04 BeyondEvil

Check out #637 and #634

They will be part of the 4.0.0rc2 release coming soon.

BeyondEvil avatar Apr 07 '23 23:04 BeyondEvil

Please try 4.0.0rc4. setting query param ”sort” to ”original” will now sort in execution order.

BeyondEvil avatar Apr 09 '23 07:04 BeyondEvil

Hi @BeyondEvil - I've tested it - in version 4.0.0rc4 and setting query param ”sort” to ”original” the ordering is as expected :)

Additional question - will be possible to enforce that behavior as a default one? eg. from the config file? I mean to always open by default the result html file with that ordering without a necessity to setting different ordering by query param manually?

sygutss avatar Apr 11 '23 09:04 sygutss

@BeyondEvil - Up for the previous question and also when is expected to roll out the official version?

sygutss avatar May 14 '23 06:05 sygutss

Sorry for the delay. This can be set using addopts and/or ini. And v4 is out.

Thanks! 🙏

BeyondEvil avatar Nov 04 '23 16:11 BeyondEvil