From 53db0cb2cac689f9e9d492d2e7bfe1795e417cf3 Mon Sep 17 00:00:00 2001 From: Blake Li Date: Fri, 10 Feb 2023 14:18:14 -0500 Subject: [PATCH] chore: Fix pre-commit. (#1294) --- .githooks/pre-commit | 4 ++-- DEVELOPMENT.md | 9 --------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 164e989f38..241070d6de 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -118,7 +118,7 @@ fi if [ $NUM_JAVA_FILES_CHANGED -gt 0 ] || [ $NUM_UNIT_GOLDEN_FILES_CHANGED -gt 0 ] then echo_status "Checking unit tests..." - mvn test + mvn install --batch-mode --no-transfer-progress -Dcheckstyle.skip -Dfmt.skip TEST_STATUS=$? if [ $TEST_STATUS != 0 ] then @@ -133,7 +133,7 @@ if [ $NUM_JAVA_FILES_CHANGED -gt 0 ] \ || [ $NUM_INTEGRATION_BAZEL_FILES_CHANGED -gt 0 ] then echo_status "Checking integration tests..." - bazel --batch test --disk_cache="$BAZEL_CACHE_DIR" //test/integration/... + bazelisk --batch test --disk_cache="$BAZEL_CACHE_DIR" //test/integration/... TEST_STATUS=$? if [ $TEST_STATUS != 0 ] then diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 229919c367..2b8a9a17b8 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -11,15 +11,6 @@ ```sh cp .githooks/pre-commit .git/hooks/pre-commit ``` - - ### Note: You may see this error with the pre-commits due to the monorepo migration: - ``` - [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project gapic-generator-java: Compilation failure: Compilation failure: - [ERROR] gapic-generator-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/rest/ServiceClientTestClassComposer.java:[19,43] package com.google.api.gax.httpjson.testing does not exist - [ERROR] gapic-generator-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/rest/ServiceClientTestClassComposer.java:[24,38] package com.google.api.gax.rpc.testing does not exist - [ERROR] gapic-generator-java/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpc/ServiceClientTestClassComposer.java:[18,39] package com.google.api.gax.grpc.testing does not exist - ``` - Remove the pre-commit hooks. Tracking the issue in https://github.com/googleapis/gapic-generator-java/issues/1253 3. Install [`bazelisk`](https://github.com/bazelbuild/bazelisk) in your `PATH`.