99 "java_gapic_assembly_gradle_pkg" ,
1010)
1111load ("@rules_gapic//:gapic.bzl" , "proto_library_with_info" )
12- load ("//:rules_bazel/java/integration_test.bzl" , "golden_update" )
1312load ("@rules_proto//proto:defs.bzl" , "proto_library" )
1413
1514package (default_visibility = ["//visibility:public" ])
@@ -18,30 +17,26 @@ package(default_visibility = ["//visibility:public"])
1817# Integration Test Rules
1918####################################################
2019
21- INTEGRATION_TEST_LIBRARIES = [
22- "asset" , # Basic case.
23- "credentials" , # Check that the capital name edge case is handled.
24- "iam" , # Mixin-only special-case API can build on its own.
25- "kms" , # Mixins, with an override in the proto file.
26- "pubsub" , # Special=case handling for "_deleted-topic_" resource name patterns.
27- "logging" , # Java package remapping in gapic.yaml.
28- "redis" , # Has a gapic.yaml.
29- "storage" , # Exercises storage-specific edge cases.
30- "library" , # No gRPC service config.
31- "compute" , # REGAPIC test.
32- ]
33-
34- # Keys must match the values in INTEGRATION_TEST_LIBRARIES above.
3520API_GAPIC_TARGETS = {
21+ # basic case
3622 "asset" : "@com_google_googleapis//google/cloud/asset/v1:asset_java_gapic" ,
23+ # Check that the capital name edge case is handled.
3724 "credentials" : "@com_google_googleapis//google/iam/credentials/v1:credentials_java_gapic" ,
38- "iam" : ":iam_java_gapic" , # Googleapis' LRO does not have a Java Gapic.
39- "kms" : ":kms_java_gapic" , # Local target because mixins are not rolled out yet.
25+ # Mixin-only special-case API can build on its own.
26+ "iam" : ":iam_java_gapic" , # local target: Googleapis' LRO does not have a Java Gapic.
27+ # mixins, with an override in the proto file
28+ "kms" : ":kms_java_gapic" , # local target: mixins are not rolled out yet.
29+ # Special=case handling for "_deleted-topic_" resource name patterns.
4030 "pubsub" : ":pubsub_java_gapic" ,
31+ # Java package remapping in gapic.yaml
4132 "logging" : "@com_google_googleapis//google/logging/v2:logging_java_gapic" ,
33+ # Has a gapic.yaml.
4234 "redis" : "@com_google_googleapis//google/cloud/redis/v1beta1:redis_java_gapic" ,
35+ # Exercises storage-specific edge cases.
4336 "storage" : "@com_google_googleapis//google/storage/v2:storage_java_gapic" ,
37+ # No gRPC service config.
4438 "library" : "@com_google_googleapis//google/example/library/v1:library_java_gapic" ,
39+ # REGAPIC test.
4540 "compute" : "@com_google_googleapis_discovery//google/cloud/compute/v1:compute_small_java_gapic" ,
4641}
4742
@@ -50,16 +45,20 @@ API_GAPIC_TARGETS = {
5045 srcs = ["//scripts:diff_gen_and_golden.sh" ],
5146 args = [lib_name ],
5247 data = [
53- API_GAPIC_TARGETS [ lib_name ] + "_srcjar_raw.srcjar" ,
48+ gapic_target + "_srcjar_raw.srcjar" ,
5449 "//test/integration/goldens/%s:goldens_files" % lib_name ,
5550 ],
56- ) for lib_name in INTEGRATION_TEST_LIBRARIES ]
51+ ) for lib_name , gapic_target in API_GAPIC_TARGETS . items () ]
5752
58- [golden_update (
53+ [sh_binary (
5954 name = "%s_update" % lib_name ,
60- data = ["//test/integration/goldens/%s:goldens_files" % lib_name ],
61- target = API_GAPIC_TARGETS [lib_name ],
62- ) for lib_name in INTEGRATION_TEST_LIBRARIES ]
55+ srcs = ["//scripts:update_golden.sh" ],
56+ args = [lib_name ],
57+ data = [
58+ gapic_target + "_srcjar_raw.srcjar" ,
59+ "//test/integration/goldens/%s:goldens_files" % lib_name ,
60+ ],
61+ ) for lib_name , gapic_target in API_GAPIC_TARGETS .items ()]
6362
6463####################################################
6564# API Library Rules
0 commit comments