From 6a3bd6a2cf02e96fd5041500bafa3a35731d4981 Mon Sep 17 00:00:00 2001 From: Jin Date: Fri, 5 Mar 2021 17:14:50 +0800 Subject: [PATCH] Sort genquery outputs to be compatible with --incompatible_genquery_use_graphless_output (#531) Fixes: #529 --- tests/integration/BUILD | 20 +++++++++++++++++-- .../version-interval-deps.golden.dos | 14 ++++++------- .../version-interval-deps.golden.unix | 14 ++++++------- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/tests/integration/BUILD b/tests/integration/BUILD index b13664b42..4eb678be0 100644 --- a/tests/integration/BUILD +++ b/tests/integration/BUILD @@ -28,13 +28,21 @@ genquery( ], ) +genrule( + name = "testonly-deps-sorted", + srcs = [":testonly-deps"], + outs = ["testonly-deps-sorted.txt"], + cmd = "cat $< | sort > $@", + testonly = 1, +) + diff_test( name = "testonly_artifacts_test", file1 = select({ "@bazel_tools//src/conditions:windows": "testonly-deps.golden", "//conditions:default": "testonly-deps.golden.unix", }), - file2 = ":testonly-deps", + file2 = ":testonly-deps-sorted", ) # https://github.com/coursier/coursier/issues/1792 @@ -50,13 +58,21 @@ genquery( scope = ["@version_interval_testing//:io_grpc_grpc_netty_shaded"], ) +genrule( + name = "version-interval-deps-sorted", + srcs = [":version_interval_deps"], + outs = ["version-interval-deps-sorted.txt"], + cmd = "cat $< | sort > $@", + testonly = 1, +) + diff_test( name = "version_interval_deps_test", file1 = select({ "@bazel_tools//src/conditions:windows": "version-interval-deps.golden.dos", "//conditions:default": "version-interval-deps.golden.unix", }), - file2 = ":version_interval_deps", + file2 = ":version-interval-deps-sorted.txt", ) java_import( diff --git a/tests/integration/version-interval-deps.golden.dos b/tests/integration/version-interval-deps.golden.dos index 42451a7a2..9385e1ad5 100644 --- a/tests/integration/version-interval-deps.golden.dos +++ b/tests/integration/version-interval-deps.golden.dos @@ -1,9 +1,9 @@ -@version_interval_testing//:io_grpc_grpc_netty_shaded -@version_interval_testing//:v1/https/repo1.maven.org/maven2/io/grpc/grpc-netty-shaded/1.29.0/grpc-netty-shaded-1.29.0.jar +@version_interval_testing//:com_google_android_annotations +@version_interval_testing//:com_google_code_gson_gson +@version_interval_testing//:com_google_errorprone_error_prone_annotations +@version_interval_testing//:io_grpc_grpc_api @version_interval_testing//:io_grpc_grpc_core -@version_interval_testing//:v1/https/repo1.maven.org/maven2/io/grpc/grpc-core/1.29.0/grpc-core-1.29.0.jar +@version_interval_testing//:io_grpc_grpc_netty_shaded @version_interval_testing//:io_perfmark_perfmark_api -@version_interval_testing//:io_grpc_grpc_api -@version_interval_testing//:com_google_errorprone_error_prone_annotations -@version_interval_testing//:com_google_code_gson_gson -@version_interval_testing//:com_google_android_annotations +@version_interval_testing//:v1/https/repo1.maven.org/maven2/io/grpc/grpc-core/1.29.0/grpc-core-1.29.0.jar +@version_interval_testing//:v1/https/repo1.maven.org/maven2/io/grpc/grpc-netty-shaded/1.29.0/grpc-netty-shaded-1.29.0.jar diff --git a/tests/integration/version-interval-deps.golden.unix b/tests/integration/version-interval-deps.golden.unix index 1c4936013..556ff4c85 100644 --- a/tests/integration/version-interval-deps.golden.unix +++ b/tests/integration/version-interval-deps.golden.unix @@ -1,9 +1,9 @@ -@version_interval_testing//:io_grpc_grpc_netty_shaded -@version_interval_testing//:v1/https/repo1.maven.org/maven2/io/grpc/grpc-netty-shaded/1.29.0/grpc-netty-shaded-1.29.0.jar +@version_interval_testing//:com_google_android_annotations +@version_interval_testing//:com_google_code_gson_gson +@version_interval_testing//:com_google_errorprone_error_prone_annotations +@version_interval_testing//:io_grpc_grpc_api @version_interval_testing//:io_grpc_grpc_core -@version_interval_testing//:v1/https/repo1.maven.org/maven2/io/grpc/grpc-core/1.29.0/grpc-core-1.29.0.jar +@version_interval_testing//:io_grpc_grpc_netty_shaded @version_interval_testing//:io_perfmark_perfmark_api -@version_interval_testing//:io_grpc_grpc_api -@version_interval_testing//:com_google_errorprone_error_prone_annotations -@version_interval_testing//:com_google_code_gson_gson -@version_interval_testing//:com_google_android_annotations +@version_interval_testing//:v1/https/repo1.maven.org/maven2/io/grpc/grpc-core/1.29.0/grpc-core-1.29.0.jar +@version_interval_testing//:v1/https/repo1.maven.org/maven2/io/grpc/grpc-netty-shaded/1.29.0/grpc-netty-shaded-1.29.0.jar