This repository was archived by the owner on Mar 24, 2026. It is now read-only.
Refactor setup module starting#913
Closed
hamiltont wants to merge 16 commits intoTechEmpower:masterfrom
Closed
Conversation
This lets the handlers set their own levels. Otherwise all handlers are limited to the messages that the root logger is willing to pass to them (e.g. they only get messages that pass root logger's level setting)
Instead of opening a file handler, just use the logging framework. In addition to the normal StreamHandler, register a FileHandler to save a log file from running each test. The setup.py files depend on out and err file objects, so we fake them with a new class WrapLogger. This allows us to see real-time output from those files as well. It is also easier for the setup.py files as they use subprocess heavily, and it uses parameters for errfile and outfile
- Adds a default StreamHandler inside of __run_test that can be used to send unformatted output to stdout. This basically emulates 'print' while allowing the messages to also be logged into the FileHandler - Docs at top of FrameworkTest - Removes some extra calls to basicConfig - Refines WrapLogger to support all log levels - Adds utils.py file to store usefulties
Our usage of textwrap was causing extra newlines at the prefix and suffix of each message. This fixes that issue and cleans up the codebase a bit
Changes this poor output:
benchmarker : INFO --------------------------------------------------------------------------------
Starting go
--------------------------------------------------------------------------------
Into this better output:
benchmarker : INFO
--------------------------------------------------------------------------------
Starting go
--------------------------------------------------------------------------------
This enables much cleaner setup.py files and makes debugging easier by logging each shell command from setup.py before it is run. - Pass setup_module it's decorator framework_test - Use fw_test to run shell scripts
Uses helper thread to automatically keep track of subprocess.Popen output
Contributor
Author
|
Closing until this is more polished |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a work-in-progress PR. If you like the approach I'll apply this to the current setup files.
This enables much cleaner setup.py files, and makes debugging much easier by logging each shell command from a setup.py before it is run. It's basically two minor changes:
Gives nicer output in log:
TODO: Merge in ideas from https://gist.github.com/methane/a8c794c301b61fbdb356