This is an archive of the discontinued LLVM Phabricator instance.

[LNT] Add support for v2 fmt in test data library
ClosedPublic

Authored by thopre on Aug 5 2019, 7:40 AM.

Details

Summary

Add support for generating LNT JSON report file format in version 2 in
the test data creation library. All unit tests introduced in earlier
patch for existing code pass with this new code.

Diff Detail

Repository
rL LLVM

Event Timeline

thopre created this revision.Aug 5 2019, 7:40 AM
thopre updated this revision to Diff 213460.Aug 5 2019, 1:59 PM

Rebase on top of latest changes

cmatthews accepted this revision.Aug 12 2019, 10:56 AM

Looks good.

lnt/testing/__init__.py
52 ↗(On Diff #213460)

Could you add a comment or assertion text explaining why this check is needed.

211 ↗(On Diff #213460)

info = dict(self.info)

This revision is now accepted and ready to land.Aug 12 2019, 10:56 AM
thopre updated this revision to Diff 214793.Aug 13 2019, 3:14 AM

Add comments explaining version checks

thopre updated this revision to Diff 214829.Aug 13 2019, 7:19 AM
thopre marked 2 inline comments as done.

Reduce amount of dictionary update done

thopre marked an inline comment as done.Aug 13 2019, 7:19 AM
thopre added inline comments.
lnt/testing/__init__.py
52 ↗(On Diff #213460)

Are these comments appropriate?

thopre requested review of this revision.Aug 16 2019, 4:18 PM

Putting back under review to get confirmation changes made are ok.

What does this mean for the existing v1 users? Will they continue using v1 format, i.e. will LNT keep using whatever it was using before this patch or will it switch to v2? Btw, is there some place/short summary of the rationale behind v2? Not really related to this patch per se, just want to understand the implication of the new format for the downstream users.

What does this mean for the existing v1 users? Will they continue using v1 format, i.e. will LNT keep using whatever it was using before this patch or will it switch to v2? Btw, is there some place/short summary of the rationale behind v2? Not really related to this patch per se, just want to understand the implication of the new format for the downstream users.

Yes existing users will still use the v1 format. The API is just extended to be able create a v2 format. As to the rationale I guess https://reviews.llvm.org/D34584 should contain some info.

I see. It also looks like "run_order" was switched to llvm_project_revision for some reason (I couldn't quite get why - is it simply because the old schema used it? Seems not worth it even if it's hard to correct it in LNT), but if it won't change the behavior (i.e. produced reports) for existing LNT users then it's fine. There seems to be some confusion around what run order is supposed to be already.

I see. It also looks like "run_order" was switched to llvm_project_revision for some reason (I couldn't quite get why - is it simply because the old schema used it? Seems not worth it even if it's hard to correct it in LNT), but if it won't change the behavior (i.e. produced reports) for existing LNT users then it's fine. There seems to be some confusion around what run order is supposed to be already.

+1, i'm late to the party, but this part seems really unfortunate.

I see. It also looks like "run_order" was switched to llvm_project_revision for some reason (I couldn't quite get why - is it simply because the old schema used it? Seems not worth it even if it's hard to correct it in LNT), but if it won't change the behavior (i.e. produced reports) for existing LNT users then it's fine. There seems to be some confusion around what run order is supposed to be already.

I agree that run_order is a nicer name since one might want to use lnt for something else than llvm. But that ought to be done as a separate patch, this just allows producer to generate a v2 format.

Putting back under review to get confirmation changes made are ok.

Ping?

thopre marked an inline comment as done.Sep 2 2019, 7:58 AM
thopre added inline comments.
lnt/testing/__init__.py
52 ↗(On Diff #213460)

Ping?

cmatthews added inline comments.Sep 3 2019, 10:58 AM
lnt/testing/__init__.py
52 ↗(On Diff #213460)

assert self.report_version <= 2, "This library only supports v2 and newer."

When someone hits an assertion, it is nice to see the assertion message, instead of having to navigate to the code.

thopre updated this revision to Diff 218534.Sep 3 2019, 2:31 PM

Add failure message to asserts

thopre marked an inline comment as done.Sep 3 2019, 2:32 PM
thopre marked an inline comment as done.Sep 15 2019, 2:17 PM
thopre added inline comments.
lnt/testing/__init__.py
52 ↗(On Diff #213460)

How about now?

cmatthews accepted this revision.Sep 18 2019, 10:36 AM

Thanks!

This revision is now accepted and ready to land.Sep 18 2019, 10:36 AM
thopre updated this revision to Diff 220860.Sep 19 2019, 6:43 AM

Make code more python3-compatible

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 19 2019, 6:47 AM