Skip to content

Commit

Permalink
Bug 1623546 [wpt PR 22328] - [WPT/common/security-features] Sort subt…
Browse files Browse the repository at this point in the history
…ests to reduce diffs, a=testonly

Automatic update from web-platform-tests
[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/+/2109570
Reviewed-by: Kenichi Ishibashi <[email protected]>
Reviewed-by: Eriko Kurimoto <[email protected]>
Reviewed-by: Hiroki Nakagawa <[email protected]>
Commit-Queue: Hiroshige Hayashizaki <[email protected]>
Cr-Commit-Position: refs/heads/master@{#751602}

--

wpt-commits: 6a665f63ae39b552f60b971f11c34b215861fcb3
wpt-pr: 22328
  • Loading branch information
hiroshige-g authored and moz-wptsync-bot committed Mar 21, 2020
1 parent e262299 commit 580e42a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,13 @@ def generate_test_file(spec_directory, test_helper_filenames,

parameters = {}

parameters['scenarios'] = dump_test_parameters(scenarios).replace(
"\n", "\n" + " " * 8)
# Sort scenarios, to avoid unnecessary diffs due to different orders in
# `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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
<body>
<script>
TestCase(
%(scenarios)s,
[
%(scenarios)s
],
new SanityChecker()
).start();
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
<body>
<script>
TestCase(
%(scenarios)s,
[
%(scenarios)s
],
new SanityChecker()
).start();
</script>
Expand Down

0 comments on commit 580e42a

Please sign in to comment.