Simplify code around --stats-json-file#11432
Closed
gshuflin wants to merge 4 commits into
Closed
Conversation
[ci skip-rust] [ci skip-build-wheels]
[ci skip-rust] [ci skip-build-wheels]
[ci skip-rust] [ci skip-build-wheels]
And add a test for it. [ci skip-build-wheels]
Contributor
Author
|
This is based on #11431 |
asherf
reviewed
Jan 8, 2021
|
|
||
| def test_stats_json_write() -> None: | ||
| with freeze_time(datetime.datetime(2020, 1, 1, 12, 0, 0)) as frozen_time: | ||
| with temporary_dir() as tmpdir: |
Member
There was a problem hiding this comment.
asherf
reviewed
Jan 8, 2021
|
|
||
| contents = open(json_file).read() | ||
| json_contents = json.loads(contents) | ||
| for key in ["run_info", "pantsd_stats", "cumulative_timings", "recorded_options"]: |
Member
There was a problem hiding this comment.
asset set(json_contents.keys()) == {"run_info", "pantsd_stats", "cumulative_timings", "recorded_options"}
Member
|
I think we should remove the ability to write to a json file. I don't see a use for it. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Simplify the code paths around how RunTracker handles the
--stats-json-fileoption and add a test for it.