tidypy icon indicating copy to clipboard operation
tidypy copied to clipboard

Add prospector-json as a Reporter

Open laundmo opened this issue 3 years ago • 3 comments

Did this while trying to get tidpy to work in vscode, nothing too complex. tries to as closely as possible emulate the prospector json format, though some things had to be faked such as start/end timestamps and duration, as i couldn't figure out whether those were collected or in any way accessible for a Reporter.

test suite + linter should have run and passed.

laundmo avatar Aug 01 '21 17:08 laundmo

LGTM. Thanks for contributing!

If you could add a test for it (see test_report_structured.py for a simple example) and update the README.rst, I'll merge this right in.

jayclassless avatar Aug 08 '21 17:08 jayclassless

@jayclassless i added a test now, but im unsure how to proceed since it will always fail due to the timestamp changing. i have to get a fake timestamp for the started/stopped keys, which is just the current time, This means that any example will be different from the run by some part of the timestamp.

how can i ignore the timestamps? should i parse the json and compare that way?

laundmo avatar Aug 09 '21 14:08 laundmo

how can i ignore the timestamps? should i parse the json and compare that way?

You could parse it and check the resulting dictionary, or you could use something like freezegun to hardcode a "system" time for the duration of the test.

jayclassless avatar Aug 10 '21 00:08 jayclassless