diff --git a/.circleci/config.yml b/.circleci/config.yml index 5a5afd7c9d..8f2b2a11e8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ jobs: gapic-generator-java-tests: working_directory: /tmp/ environment: - TEST_REPORTS_DIR: /tmp/workspace/bazel/reports/gapic-generator-java + TEST_REPORTS_DIR: ~/.cache/bazel BAZEL_VERSION: 3.5.1 PYTHON_VERSION: 3.5.2 machine: true @@ -28,21 +28,20 @@ jobs: name: Make reports directory command: | mkdir -p ${TEST_REPORTS_DIR} + echo "Test reports will be stored in ${TEST_REPORTS_DIR}" - run: name: Build targets for gapic-generator-java command: | cd /tmp/gapic-generator-java - bazel --batch build //... + bazel --batch build //src/... - run: name: Run unit tests for gapic-generator-java command: | cd /tmp/gapic-generator-java - bazel --batch test //... --noshow_progress + bazel --batch test //src/test/... --noshow_progress find . -type f -regex ".*/bazel-testlogs/.*xml" -exec cp {} ${TEST_REPORTS_DIR} \; - store_test_results: - path: bazel/reports/gapic-generator-java - - store_artifacts: - path: bazel/reports/gapic-generator-java + path: ~/.cache/bazel google-java-format: docker: - image: l.gcr.io/google/bazel diff --git a/.githooks/pre-commit b/.githooks/pre-commit index a0ef4987d4..1a1c841589 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -100,7 +100,7 @@ fi if [ $NUM_JAVA_FILES_CHANGED -gt 0 ] || [ $NUM_BAZEL_FILES_CHANGED -gt 0 ] then echo_status "Checking the build..." - bazel --batch build --disk_cache="$BAZEL_CACHE_DIR" //... + bazel --batch build --disk_cache="$BAZEL_CACHE_DIR" //src/... BUILD_STATUS=$? if [ $BUILD_STATUS != 0 ] then @@ -112,7 +112,7 @@ fi if [ $NUM_JAVA_FILES_CHANGED -gt 0 ] then echo_status "Checking tests..." - bazel --batch test --disk_cache="$BAZEL_CACHE_DIR" //... + bazel --batch test --disk_cache="$BAZEL_CACHE_DIR" //src/test/... TEST_STATUS=$? if [ $TEST_STATUS != 0 ] then diff --git a/repositories.bzl b/repositories.bzl index 9da79a5faf..9b1a8cd45b 100644 --- a/repositories.bzl +++ b/repositories.bzl @@ -59,9 +59,9 @@ def gapic_generator_java_repositories(): _maybe( http_archive, name = "com_google_googleapis", - strip_prefix = "googleapis-dbdd8ddeb6d9556952aa8784d9e48f2566c9911a", + strip_prefix = "googleapis-bda7ce951def5ae6e5c4258d0e569188dd4ae02b", urls = [ - "https://github.com/googleapis/googleapis/archive/dbdd8ddeb6d9556952aa8784d9e48f2566c9911a.zip", + "https://github.com/googleapis/googleapis/archive/bda7ce951def5ae6e5c4258d0e569188dd4ae02b.zip", ], ) diff --git a/test/integration/BUILD.bazel b/test/integration/BUILD.bazel new file mode 100644 index 0000000000..60a4ca6aa9 --- /dev/null +++ b/test/integration/BUILD.bazel @@ -0,0 +1,26 @@ +package(default_visibility = ["//visibility:public"]) + +#################################################### +# API Library Rules +#################################################### +# These will eventually go away once more APIs in googleapis have been migrated to the microgenerator. + +load( + "@com_google_googleapis_imports//:imports.bzl", + java_gapic_library = "java_gapic_library2", +) + +java_gapic_library( + name = "asset_java_gapic", + srcs = ["@com_google_googleapis//google/cloud/asset/v1:asset_proto_with_info"], + grpc_service_config = "@com_google_googleapis//google/cloud/asset/v1:cloudasset_grpc_service_config.json", + package = "google.cloud.asset.v1", + test_deps = [ + "@com_google_googleapis//google/cloud/asset/v1:asset_java_grpc", + "@com_google_googleapis//google/iam/v1:iam_java_grpc", + ], + deps = [ + "@com_google_googleapis//google/cloud/asset/v1:asset_java_proto", + "@com_google_googleapis//google/iam/v1:iam_java_proto", + ], +)