Sort Rust TEST_MAPPING tests.

We currently seem to emit TEST_MAPPING files in an arbitrary order,
which causes diffs to look confusing even when nothing has changed.
Let's sort them by the test name, which is both stable and easier to
read.

Test: Run cargo2android multiple times and see no TEST_MAPPING diff.
Change-Id: I398aa84a4891380e4292223445bd53959c024421
This commit is contained in:
Joel Galenson
2021-04-06 10:18:21 -07:00
parent 57a9db7c48
commit 4f9d11f6b1

View File

@@ -152,6 +152,7 @@ class TestMapping(object):
test_mapping["presubmit"].append({"name": test, "options": test_options[test]}) test_mapping["presubmit"].append({"name": test, "options": test_options[test]})
else: else:
test_mapping["presubmit"].append({"name": test}) test_mapping["presubmit"].append({"name": test})
test_mapping["presubmit"] = sorted(test_mapping["presubmit"], key=lambda t: t["name"])
return test_mapping return test_mapping
def write_test_mapping(self, test_mapping): def write_test_mapping(self, test_mapping):