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

Make pytest extended logging logic dependent on --verbose flag #7486

Merged
merged 1 commit into from
Jun 15, 2023

Conversation

drew2a
Copy link
Contributor

@drew2a drew2a commented Jun 14, 2023

This PR makes extended logging (introduced in #7482 and #7485) dependent on --verbose flag.
Related to #7132, #7134

Without this PR, the output logic operates as expected when the --verbose flag is utilized. However, when running the test suite without this flag, we encounter an output that could be seen as inconvenient:

src/tribler/core/components/gigachannel/community/tests/test_gigachannel_community.py . in 1.158s (1.2s in total). in 0.230s (1.4s in total). in 0.198s (1.6s in total). in 0.131s (1.8s in total). in 0.089s (1.9s in total). in 0.084s (1.9s in total). in 0.239s (2.2s in total). in 0.584s (2.8s in total). in 0.236s (3.0s in total). in 0.433s (3.4s in total). in 0.135s (3.6s in total)^C^C in 0.009s (3.6s in total)

instead of

src/tribler/core/components/gigachannel/community/tests/test_gigachannel_community.py ................

This PR addresses the issue by enhancing logging, but only if the --verbose flag is explicitly activated.


For reference (The Hierarchy of hooks):

root
└── pytest_cmdline_main
 ├── pytest_plugin_registered
 ├── pytest_configure
 │ └── pytest_plugin_registered
 ├── pytest_sessionstart
 │ ├── pytest_plugin_registered
 │ └── pytest_report_header
 ├── pytest_collection
 │ ├── pytest_collectstart
 │ ├── pytest_make_collect_report
 │ │ ├── pytest_collect_file
 │ │ │ └── pytest_pycollect_makemodule
 │ │ └── pytest_pycollect_makeitem
 │ │ └── pytest_generate_tests
 │ │ └── pytest_make_parametrize_id
 │ ├── pytest_collectreport
 │ ├── pytest_itemcollected
 │ ├── pytest_collection_modifyitems
 │ └── pytest_collection_finish
 │ └── pytest_report_collectionfinish
 ├── pytest_runtestloop
 │ └── pytest_runtest_protocol
 │ ├── pytest_runtest_logstart
 │ ├── pytest_runtest_setup
 │ │ └── pytest_fixture_setup
 │ ├── pytest_runtest_makereport
 │ ├── pytest_runtest_logreport
 │ │ └── pytest_report_teststatus
 │ ├── pytest_runtest_call
 │ │ └── pytest_pyfunc_call
 │ ├── pytest_runtest_teardown
 │ │ └── pytest_fixture_post_finalizer
 │ └── pytest_runtest_logfinish
 ├── pytest_sessionfinish
 │ └── pytest_terminal_summary
 └── pytest_unconfigure

Refs:

@drew2a drew2a force-pushed the feature/pytest_extended_log_verbose branch from 8109605 to d2f4657 Compare June 14, 2023 11:14
@drew2a drew2a self-assigned this Jun 14, 2023
@drew2a drew2a added this to the 7.14.0 milestone Jun 14, 2023
@drew2a drew2a marked this pull request as ready for review June 14, 2023 12:01
@drew2a drew2a requested review from a team and kozlovsky and removed request for a team June 14, 2023 12:01
@drew2a drew2a merged commit 889eb2c into Tribler:main Jun 15, 2023
@drew2a drew2a deleted the feature/pytest_extended_log_verbose branch June 15, 2023 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants