From 580e42ac2e4d5aea2935fa12e5483c997639e22a Mon Sep 17 00:00:00 2001 From: Hiroshige Hayashizaki Date: Fri, 20 Mar 2020 10:08:18 +0000 Subject: [PATCH] Bug 1623546 [wpt PR 22328] - [WPT/common/security-features] Sort subtests 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 Reviewed-by: Eriko Kurimoto Reviewed-by: Hiroki Nakagawa Commit-Queue: Hiroshige Hayashizaki Cr-Commit-Position: refs/heads/master@{#751602} -- wpt-commits: 6a665f63ae39b552f60b971f11c34b215861fcb3 wpt-pr: 22328 --- .../tests/common/security-features/tools/generate.py | 9 +++++++-- .../tools/template/test.debug.html.template | 4 +++- .../tools/template/test.release.html.template | 4 +++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/testing/web-platform/tests/common/security-features/tools/generate.py b/testing/web-platform/tests/common/security-features/tools/generate.py index 75b7c1da5ac1..7710a824b2dc 100755 --- a/testing/web-platform/tests/common/security-features/tools/generate.py +++ b/testing/web-platform/tests/common/security-features/tools/generate.py @@ -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) diff --git a/testing/web-platform/tests/common/security-features/tools/template/test.debug.html.template b/testing/web-platform/tests/common/security-features/tools/template/test.debug.html.template index 7650f02c2862..b6be088f6112 100644 --- a/testing/web-platform/tests/common/security-features/tools/template/test.debug.html.template +++ b/testing/web-platform/tests/common/security-features/tools/template/test.debug.html.template @@ -15,7 +15,9 @@ diff --git a/testing/web-platform/tests/common/security-features/tools/template/test.release.html.template b/testing/web-platform/tests/common/security-features/tools/template/test.release.html.template index 71d83f83a262..bac2d5b5a4d7 100644 --- a/testing/web-platform/tests/common/security-features/tools/template/test.release.html.template +++ b/testing/web-platform/tests/common/security-features/tools/template/test.release.html.template @@ -11,7 +11,9 @@