Commit c11ee3e1 authored by Hiroshige Hayashizaki's avatar Hiroshige Hayashizaki Committed by Commit Bot

[WPT/common/security-features] Sort subtests to reduce diffs

When `spec.src.json` is modified, the order of subtests were
changed and thus unncessesary diffs were generated, even if
the subtest contents are not modified.
This CL sorts subtests to avoid such diffs.

Generated files will be modified in
https://chromium-review.googlesource.com/c/chromium/src/+/2109511

Bug: 906850
Change-Id: Ic17d8122b0b5139e89ec2b4423511b933941ad65
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2109570Reviewed-by: default avatarKenichi Ishibashi <bashi@chromium.org>
Reviewed-by: default avatarEriko Kurimoto <elkurin@chromium.org>
Reviewed-by: default avatarHiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751602}
parent 3467d8de
...@@ -198,8 +198,13 @@ def generate_test_file(spec_directory, test_helper_filenames, ...@@ -198,8 +198,13 @@ def generate_test_file(spec_directory, test_helper_filenames,
parameters = {} parameters = {}
parameters['scenarios'] = dump_test_parameters(scenarios).replace( # Sort scenarios, to avoid unnecessary diffs due to different orders in
"\n", "\n" + " " * 8) # `scenarios`.
serialized_scenarios = sorted(
[dump_test_parameters(scenario) for scenario in scenarios])
parameters['scenarios'] = ",\n".join(serialized_scenarios).replace(
"\n", "\n" + " " * 10)
test_directory = os.path.dirname(test_filename) test_directory = os.path.dirname(test_filename)
......
...@@ -15,7 +15,9 @@ ...@@ -15,7 +15,9 @@
<body> <body>
<script> <script>
TestCase( TestCase(
%(scenarios)s, [
%(scenarios)s
],
new SanityChecker() new SanityChecker()
).start(); ).start();
</script> </script>
......
...@@ -11,7 +11,9 @@ ...@@ -11,7 +11,9 @@
<body> <body>
<script> <script>
TestCase( TestCase(
%(scenarios)s, [
%(scenarios)s
],
new SanityChecker() new SanityChecker()
).start(); ).start();
</script> </script>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment