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 configuration.Output.ShowStartMarkers support #2612

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

davidmatson
Copy link
Contributor

@davidmatson davidmatson commented Jan 21, 2025

PR Summary

Allow displaying an indication when each test starts:

[|] Test name...

PR Checklist

  • PR has meaningful title
  • Summary describes changes
  • PR is ready to be merged
  • Tests are added/update (if required)
    (Parity with ShowNavigationMarkers)
  • Documentation is updated/added (if required)

fixes #2583

@nohwnd nohwnd changed the title Add configuration.Debug.ShowStartMarkers support (fixes #2583). Add configuration.Debug.ShowStartMarkers support Jan 22, 2025
Copy link
Member

@nohwnd nohwnd left a comment

Choose a reason for hiding this comment

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

It would be nice to add a high level test that will ensure the output is correct. This would probably be a P-test.

Allow displaying an indication when each test starts:
[|] Test name...
@davidmatson
Copy link
Contributor Author

It would be nice to add a high level test that will ensure the output is correct. This would probably be a P-test.

sure, added one in Pester.RSpec.Output.ts.ps1.

@nohwnd nohwnd changed the title Add configuration.Debug.ShowStartMarkers support Add configuration.Output.ShowStartMarkers support Jan 30, 2025
@nohwnd
Copy link
Member

nohwnd commented Jan 30, 2025

@fflaten do you have some opinion here? I am not against the functionality, but the option feels a little too special in the output tab. In v5 we tried to move away from the super configurable output, and this is slightly bringing that back.

@fflaten
Copy link
Collaborator

fflaten commented Feb 2, 2025

I agree. I'd prefer a generic ANSI option showing progress like "Test abc running (x/y tests completed)" and potentially more. Not worried about CI noise as long as it's configurable.

How do other frameworks solve this (the starting indicator)?

@davidmatson
Copy link
Contributor Author

davidmatson commented Feb 3, 2025

I'd be happy to move it back to the Debug tab if that's preferred (I originally had it there but moved it per PR feedback).

Displaying a separate line for test starting seems to be a common practice or option. For example, with GoogleTest, there's a separate "[ RUN ]" line:

PS C:\temp> .\simple-googletest-test.exe
Running main() from <...>\gtest_main.cc
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from tests
[ RUN      ] tests.passes
[       OK ] tests.passes (0 ms)
[----------] 1 test from tests (0 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (0 ms total)
[  PASSED  ] 1 test.

With Boost.Test, there's an option to enable a separate "Entering test case" line:

PS C:\temp> .\simple-boost-test.exe -l all
Running 1 test case...
Entering test module "boost-testmd-tests"
...\program.cpp(6): Entering test case "passes"
.../program.cpp(9): info: check x == 1 has passed
...\program.cpp(6): Leaving test case "passes"; testing time: 412us
Leaving test module "boost-testmd-tests"; testing time: 1321us

*** No errors detected

@davidmatson
Copy link
Contributor Author

xUnit.net also has a separate "[STARTING]" line in verbose mode:

PS C:\temp> & xunit.console.exe .\simple-xunittest.dll -verbose
xUnit.net Console Runner v2.9.3+9712244020 (64-bit .NET Framework 4.8, runtime: 4.0.30319.42000)
  Discovering: simple-xunittest
  Discovered:  simple-xunittest
  Starting:    simple-xunittest
    Tests.Test_That_Passes [STARTING]
    Tests.Test_That_Passes [FINISHED] Time: 0.1723501s
  Finished:    simple-xunittest
=== TEST EXECUTION SUMMARY ===
   simple-xunittest  Total: 1, Errors: 0, Failed: 0, Skipped: 0, Time: 0.256s

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.

Log test starting
3 participants