Entry point to print test logs from JSON output.#684
Entry point to print test logs from JSON output.#684jeffherman wants to merge 2 commits intogoogle:masterfrom
Conversation
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """Output a JSON-encoded log output to standard out. |
There was a problem hiding this comment.
I think this should be in contrib/ or bin/, not util/
There was a problem hiding this comment.
setuptools.find_packages (used in setup.py) will only search for directories with __init__.py. Adding either contrib/ or bin/ to openhtf's package list will result in either contrib or bin being a top-level importable module. While it's unlikely that anyone would ever publish a bin or contrib pypi module, it's not clear that we should be co-opting this part of the namespace for openhtf-specific purposes.
There was a problem hiding this comment.
I agree with @jeffherman. Unless you want to force people to go to our GitHub page and download utilities separately, stuff like this should go somewhere inside the actual package.
However I am an advocate of using runnable modules (invoke with python -m) instead of declaring entry points for setuptools to wire up executable scripts. In my anecdotal experience, the entry points mechanism is more brittle and doesn't always work with all environments. Whereas if you've gotten as far as successfully making the packager itself importable, it's more unlikely runnable modules within will fail.
|
@Kenadia, I remember having talked about this at one of the maintainers' meetings. Do you remember what our consensus was? I feel like we agreed on the runnable module approach but I can't remember where we decided to put them. Were we going to add a tools/ or bin/ to util/ or somewhere else in the package? |
|
@jeffherman, I talked with @jettisonjoe, and if you'd like to update this PR, we'd like to put this script in a (As an aside, I wonder if the name |
Test results produced by OpenHTF are in JSON format. This entry point facilitates perusing through complex logs by parsing the JSON and color-highlighting each line based on its logging level. To run:
$ openhtf-testcat your_test_output.jsonThis change is