This is an archive of the discontinued LLVM Phabricator instance.

LNT: Sort testsuites ascendingly
ClosedPublic

Authored by tnfchris on Dec 11 2020, 5:59 AM.

Details

Reviewers
thopre
Summary

When running a large number of testsuites having them sorted
alphabetically makes them easier to find.

This also allows us to group testsuite by prefixing them with
language.

Diff Detail

Event Timeline

tnfchris requested review of this revision.Dec 11 2020, 5:59 AM
tnfchris created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptDec 11 2020, 5:59 AM
thopre added inline comments.Dec 11 2020, 6:42 AM
lnt/server/db/v4db.py
59

Shouldn't you use an OrderedDict instead of dict to guarantee the ordering will be the same as when inserted?

tnfchris added inline comments.Dec 11 2020, 6:45 AM
lnt/server/db/v4db.py
59

From what I understand, in Python 3, dict is guaranteed to keep order during insertion https://mail.python.org/pipermail/python-dev/2017-December/151283.html

thopre accepted this revision.Dec 11 2020, 6:49 AM

LGTM

lnt/server/db/v4db.py
59

Ah yes indeed, https://docs.python.org/3/library/stdtypes.html#dict has:

Changed in version 3.7: Dictionary order is guaranteed to be insertion order. This behavior was an implementation detail of CPython from 3.6.

This revision is now accepted and ready to land.Dec 11 2020, 6:49 AM
thopre requested changes to this revision.Dec 11 2020, 7:00 AM
thopre added inline comments.
lnt/server/db/v4db.py
59

Wait, we currently only require Python 3.6 or later because that's what lots of distribution provide. Could you make it use OrderedDict instead?

This revision now requires changes to proceed.Dec 11 2020, 7:00 AM
tnfchris added inline comments.Dec 11 2020, 7:08 AM
lnt/server/db/v4db.py
59

Wait, we currently only require Python 3.6 or later because that's what lots of distribution provide. Could you make it use OrderedDict instead?

Sure, but I don't think it matters much though.. This isn't a correctness thing but just a way to attempt to provide some structure. Regardless of the order here other functions can change this.

thopre accepted this revision.Dec 11 2020, 7:41 AM
thopre added inline comments.
lnt/server/db/v4db.py
59

Ah yes, sorry, forgot what the point of the patch was.

This revision is now accepted and ready to land.Dec 11 2020, 7:41 AM
tnfchris closed this revision.Dec 13 2020, 6:19 AM