From 6f22e1634fc4bae47972b64edd33545e949524f7 Mon Sep 17 00:00:00 2001 From: Mira Leung Date: Fri, 2 Oct 2020 12:58:36 -0700 Subject: [PATCH] fix: use imperative bazel rule names --- BUILD.bazel | 4 ++-- rules_bazel/java/java_diff_test.bzl | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 7edfa6b8ac..245547c69f 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -49,7 +49,7 @@ java_binary( # JUnit runner binary, this is used to generate test output for updating goldens files. # Run `bazel run testTarget_update` will trigger this runner. java_binary( - name = "junit_runner", + name = "golden_update_junit_runner", srcs = [ "//src/test/java/com/google/api/generator/gapic/dummy:dummy_files", "//src/test/java/com/google/api/generator/engine:engine_files", @@ -62,7 +62,7 @@ java_binary( "//src/test/java/com/google/api/generator/gapic/composer/goldens:goldens_files", "//src/test/java/com/google/api/generator/gapic/testdata:gapic_config_files", "//src/test/java/com/google/api/generator/gapic/testdata:service_config_files", - ], + ], jvm_flags = ["-Xmx512m"], main_class = "com.google.api.generator.test.framework.SingleJUnitTestRunner", visibility = ["//visibility:public"], diff --git a/rules_bazel/java/java_diff_test.bzl b/rules_bazel/java/java_diff_test.bzl index 41ba278117..d6290590ce 100644 --- a/rules_bazel/java/java_diff_test.bzl +++ b/rules_bazel/java/java_diff_test.bzl @@ -44,7 +44,7 @@ junit_output_zip = rule( implementation = _junit_output_impl, ) -def _overwritten_golden_impl(ctx): +def _overwrite_golden_impl(ctx): script_content = """ #!/bin/bash cd ${{BUILD_WORKSPACE_DIRECTORY}} @@ -60,7 +60,7 @@ def _overwritten_golden_impl(ctx): return [DefaultInfo(executable = ctx.outputs.bin)] -overwritten_golden = rule( +overwrite_golden = rule( attrs = { "unit_test_results": attr.label( mandatory = True, @@ -70,7 +70,7 @@ overwritten_golden = rule( "bin": "%{name}.sh", }, executable = True, - implementation = _overwritten_golden_impl, + implementation = _overwrite_golden_impl, ) def golden_update(name, test_class_name, srcs): @@ -78,10 +78,10 @@ def golden_update(name, test_class_name, srcs): junit_output_zip( name = junit_output_name, test_class_name = test_class_name, - test_runner = "//:junit_runner", + test_runner = "//:golden_update_junit_runner", srcs = srcs, ) - overwritten_golden( + overwrite_golden( name = name, unit_test_results = ":%s" % junit_output_name )