Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support to customize gcloud command of LocalDatastoreHelper #137

Merged
merged 8 commits into from Jun 4, 2020

Conversation

athakor
Copy link
Contributor

@athakor athakor commented May 25, 2020

Fixes #19

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 25, 2020
@athakor athakor requested a review from BenWhitehead May 25, 2020 06:39
@codecov
Copy link

codecov bot commented May 25, 2020

Codecov Report

Merging #137 into master will decrease coverage by 1.17%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #137      +/-   ##
============================================
- Coverage     58.98%   57.80%   -1.18%     
  Complexity      384      384              
============================================
  Files            46       47       +1     
  Lines          2304     2351      +47     
  Branches        254      263       +9     
============================================
  Hits           1359     1359              
- Misses          838      885      +47     
  Partials        107      107              
Impacted Files Coverage Δ Complexity Δ
.../cloud/datastore/testing/LocalDatastoreHelper.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...java/com/google/cloud/datastore/DatastoreImpl.java 0.00% <0.00%> (ø) 0.00% <0.00%> (ø%)
...atastore/TransactionOperationExceptionHandler.java 0.00% <0.00%> (ø) 0.00% <0.00%> (?%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b7b89e3...13f7c7f. Read the comment docs.

Copy link
Collaborator

@BenWhitehead BenWhitehead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not build & test cleanly for me in my environment which doesn't have gcloud on my PATH, the full test suite would run successfully prior to this change.

My java & maven:

Apache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117; 2019-08-27T11:06:16-04:00)
Maven home: ~/opt/maven/latest
Java version: 1.8.0_201, vendor: Oracle Corporation, runtime: ~/opt/java/jdk1.8.0_201/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.2.17-1rodete3-amd64", arch: "amd64", family: "unix"
build log with timeout failure

Note: I changed the failsafe timeout to 120 seconds instead of 1200 to generate this log.

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <configuration>
          <forkedProcessTimeoutInSeconds>120</forkedProcessTimeoutInSeconds>
        </configuration>
      </plugin>
    </plugins>
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 4 modules...
[INFO] Installing Nexus Staging features:
[INFO]   ... total of 4 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] Google Cloud Datastore Parent                                      [pom]
[INFO] proto-google-cloud-datastore-v1                                    [jar]
[INFO] Google Cloud Datastore                                             [jar]
[INFO] Google Cloud datastore BOM                                         [pom]
[INFO] 
[INFO] -----------< com.google.cloud:google-cloud-datastore-parent >-----------
[INFO] Building Google Cloud Datastore Parent 1.102.5-SNAPSHOT            [1/4]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce) @ google-cloud-datastore-parent ---
[INFO] Adding ignore: module-info
[INFO] Adding ignore: META-INF/versions/*/module-info
[INFO] 
[INFO] --- maven-checkstyle-plugin:3.1.1:check (checkstyle) @ google-cloud-datastore-parent ---
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.5:prepare-agent (default) @ google-cloud-datastore-parent ---
[INFO] argLine set to -javaagent:/usr/local/google/home/benwhitehead/.m2/repository/org/jacoco/org.jacoco.agent/0.8.5/org.jacoco.agent-0.8.5-runtime.jar=destfile=/usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/target/jacoco.exec
[INFO] 
[INFO] --- build-helper-maven-plugin:3.1.0:add-resource (add-main-proto-resources) @ google-cloud-datastore-parent ---
[INFO] 
[INFO] --- build-helper-maven-plugin:3.1.0:add-test-resource (add-test-proto-resources) @ google-cloud-datastore-parent ---
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.5:report (report) @ google-cloud-datastore-parent ---
[INFO] Skipping JaCoCo execution due to missing execution data file.
[INFO] 
[INFO] --- maven-jar-plugin:3.2.0:test-jar (default) @ google-cloud-datastore-parent ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] 
[INFO] --- maven-failsafe-plugin:3.0.0-M4:integration-test (default) @ google-cloud-datastore-parent ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-failsafe-plugin:3.0.0-M4:verify (default) @ google-cloud-datastore-parent ---
[INFO] 
[INFO] >>> clirr-maven-plugin:2.8:check (default) > compile @ google-cloud-datastore-parent >>>
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce) @ google-cloud-datastore-parent ---
[INFO] Adding ignore: module-info
[INFO] Adding ignore: META-INF/versions/*/module-info
[INFO] 
[INFO] --- maven-checkstyle-plugin:3.1.1:check (checkstyle) @ google-cloud-datastore-parent ---
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.5:prepare-agent (default) @ google-cloud-datastore-parent ---
[INFO] argLine set to -javaagent:/usr/local/google/home/benwhitehead/.m2/repository/org/jacoco/org.jacoco.agent/0.8.5/org.jacoco.agent-0.8.5-runtime.jar=destfile=/usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/target/jacoco.exec
[INFO] 
[INFO] --- build-helper-maven-plugin:3.1.0:add-resource (add-main-proto-resources) @ google-cloud-datastore-parent ---
[INFO] 
[INFO] <<< clirr-maven-plugin:2.8:check (default) < compile @ google-cloud-datastore-parent <<<
[INFO] 
[INFO] 
[INFO] --- clirr-maven-plugin:2.8:check (default) @ google-cloud-datastore-parent ---
[INFO] Skipping execution
[INFO] 
[INFO] --------< com.google.api.grpc:proto-google-cloud-datastore-v1 >---------
[INFO] Building proto-google-cloud-datastore-v1 0.85.5-SNAPSHOT           [2/4]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce) @ proto-google-cloud-datastore-v1 ---
[INFO] Adding ignore: module-info
[INFO] Adding ignore: META-INF/versions/*/module-info
[INFO] 
[INFO] --- maven-checkstyle-plugin:3.1.1:check (checkstyle) @ proto-google-cloud-datastore-v1 ---
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.5:prepare-agent (default) @ proto-google-cloud-datastore-v1 ---
[INFO] argLine set to -javaagent:/usr/local/google/home/benwhitehead/.m2/repository/org/jacoco/org.jacoco.agent/0.8.5/org.jacoco.agent-0.8.5-runtime.jar=destfile=/usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/proto-google-cloud-datastore-v1/target/jacoco.exec
[INFO] 
[INFO] --- build-helper-maven-plugin:3.1.0:add-resource (add-main-proto-resources) @ proto-google-cloud-datastore-v1 ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ proto-google-cloud-datastore-v1 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/proto-google-cloud-datastore-v1/src/main/resources
[INFO] Copying 3 resources
[INFO] 
[INFO] --- flatten-maven-plugin:1.2.2:flatten (flatten) @ proto-google-cloud-datastore-v1 ---
[INFO] Generating flattened POM of project com.google.api.grpc:proto-google-cloud-datastore-v1:jar:0.85.5-SNAPSHOT...
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ proto-google-cloud-datastore-v1 ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- build-helper-maven-plugin:3.1.0:add-test-resource (add-test-proto-resources) @ proto-google-cloud-datastore-v1 ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ proto-google-cloud-datastore-v1 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/proto-google-cloud-datastore-v1/src/test/resources
[INFO] skip non existing resourceDirectory /usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/proto-google-cloud-datastore-v1/src/test/proto
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ proto-google-cloud-datastore-v1 ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:3.0.0-M4:test (default-test) @ proto-google-cloud-datastore-v1 ---
[INFO] No tests to run.
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.5:report (report) @ proto-google-cloud-datastore-v1 ---
[INFO] Skipping JaCoCo execution due to missing execution data file.
[INFO] 
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ proto-google-cloud-datastore-v1 ---
[INFO] 
[INFO] --- maven-jar-plugin:3.2.0:test-jar (default) @ proto-google-cloud-datastore-v1 ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] 
[INFO] --- maven-failsafe-plugin:3.0.0-M4:integration-test (default) @ proto-google-cloud-datastore-v1 ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-failsafe-plugin:3.0.0-M4:verify (default) @ proto-google-cloud-datastore-v1 ---
[INFO] 
[INFO] >>> clirr-maven-plugin:2.8:check (default) > compile @ proto-google-cloud-datastore-v1 >>>
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce) @ proto-google-cloud-datastore-v1 ---
[INFO] Adding ignore: module-info
[INFO] Adding ignore: META-INF/versions/*/module-info
[INFO] 
[INFO] --- maven-checkstyle-plugin:3.1.1:check (checkstyle) @ proto-google-cloud-datastore-v1 ---
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.5:prepare-agent (default) @ proto-google-cloud-datastore-v1 ---
[INFO] argLine set to -javaagent:/usr/local/google/home/benwhitehead/.m2/repository/org/jacoco/org.jacoco.agent/0.8.5/org.jacoco.agent-0.8.5-runtime.jar=destfile=/usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/proto-google-cloud-datastore-v1/target/jacoco.exec
[INFO] 
[INFO] --- build-helper-maven-plugin:3.1.0:add-resource (add-main-proto-resources) @ proto-google-cloud-datastore-v1 ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ proto-google-cloud-datastore-v1 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/proto-google-cloud-datastore-v1/src/main/resources
[INFO] Copying 3 resources
[INFO] Copying 3 resources
[INFO] 
[INFO] --- flatten-maven-plugin:1.2.2:flatten (flatten) @ proto-google-cloud-datastore-v1 ---
[INFO] Generating flattened POM of project com.google.api.grpc:proto-google-cloud-datastore-v1:jar:0.85.5-SNAPSHOT...
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ proto-google-cloud-datastore-v1 ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] <<< clirr-maven-plugin:2.8:check (default) < compile @ proto-google-cloud-datastore-v1 <<<
[INFO] 
[INFO] 
[INFO] --- clirr-maven-plugin:2.8:check (default) @ proto-google-cloud-datastore-v1 ---
[INFO] Skipping execution
[INFO] 
[INFO] --------------< com.google.cloud:google-cloud-datastore >---------------
[INFO] Building Google Cloud Datastore 1.102.5-SNAPSHOT                   [3/4]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce) @ google-cloud-datastore ---
[INFO] Adding ignore: module-info
[INFO] Adding ignore: META-INF/versions/*/module-info
[INFO] 
[INFO] --- maven-checkstyle-plugin:3.1.1:check (checkstyle) @ google-cloud-datastore ---
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.5:prepare-agent (default) @ google-cloud-datastore ---
[INFO] argLine set to -javaagent:/usr/local/google/home/benwhitehead/.m2/repository/org/jacoco/org.jacoco.agent/0.8.5/org.jacoco.agent-0.8.5-runtime.jar=destfile=/usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/google-cloud-datastore/target/jacoco.exec
[INFO] 
[INFO] --- build-helper-maven-plugin:3.1.0:add-resource (add-main-proto-resources) @ google-cloud-datastore ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ google-cloud-datastore ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/google-cloud-datastore/src/main/resources
[INFO] skip non existing resourceDirectory /usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/google-cloud-datastore/src/main/proto
[INFO] 
[INFO] --- flatten-maven-plugin:1.2.2:flatten (flatten) @ google-cloud-datastore ---
[INFO] Generating flattened POM of project com.google.cloud:google-cloud-datastore:jar:1.102.5-SNAPSHOT...
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ google-cloud-datastore ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 61 source files to /usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/google-cloud-datastore/target/classes
[WARNING] bootstrap class path not set in conjunction with -source 1.7
[WARNING] /usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Key.java:[131,42] printToString(com.google.protobuf.MessageOrBuilder) in com.google.protobuf.TextFormat has been deprecated
[WARNING] /usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/google-cloud-datastore/src/main/java/com/google/cloud/datastore/spi/v1/HttpDatastoreRpc.java:[71,52] projectEndpoint(java.lang.String) in com.google.datastore.v1.client.DatastoreOptions.Builder has been deprecated
[INFO] /usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/google-cloud-datastore/src/main/java/com/google/cloud/datastore/StructuredQuery.java: Some input files use unchecked or unsafe operations.
[INFO] /usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/google-cloud-datastore/src/main/java/com/google/cloud/datastore/StructuredQuery.java: Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] --- build-helper-maven-plugin:3.1.0:add-test-resource (add-test-proto-resources) @ google-cloud-datastore ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ google-cloud-datastore ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] skip non existing resourceDirectory /usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/google-cloud-datastore/src/test/proto
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ google-cloud-datastore ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 38 source files to /usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/google-cloud-datastore/target/test-classes
[WARNING] bootstrap class path not set in conjunction with -source 1.7
[INFO] /usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/google-cloud-datastore/src/test/java/com/google/cloud/datastore/it/ITDatastoreTest.java: /usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/google-cloud-datastore/src/test/java/com/google/cloud/datastore/it/ITDatastoreTest.java uses unchecked or unsafe operations.
[INFO] /usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/google-cloud-datastore/src/test/java/com/google/cloud/datastore/it/ITDatastoreTest.java: Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] --- maven-surefire-plugin:3.0.0-M4:test (default-test) @ google-cloud-datastore ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.google.cloud.datastore.SerializationTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.554 s - in com.google.cloud.datastore.SerializationTest
[INFO] Running com.google.cloud.datastore.PathElementTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in com.google.cloud.datastore.PathElementTest
[INFO] Running com.google.cloud.datastore.BlobTest
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in com.google.cloud.datastore.BlobTest
[INFO] Running com.google.cloud.datastore.CursorTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 s - in com.google.cloud.datastore.CursorTest
[INFO] Running com.google.cloud.datastore.DatastoreOptionsTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.075 s - in com.google.cloud.datastore.DatastoreOptionsTest
[INFO] Running com.google.cloud.datastore.LatLngTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s - in com.google.cloud.datastore.LatLngTest
[INFO] Running com.google.cloud.datastore.KeyValueTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in com.google.cloud.datastore.KeyValueTest
[INFO] Running com.google.cloud.datastore.BaseKeyTest
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s - in com.google.cloud.datastore.BaseKeyTest
[INFO] Running com.google.cloud.datastore.IncompleteKeyTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in com.google.cloud.datastore.IncompleteKeyTest
[INFO] Running com.google.cloud.datastore.StructuredQueryTest
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.026 s - in com.google.cloud.datastore.StructuredQueryTest
[INFO] Running com.google.cloud.datastore.ListValueTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in com.google.cloud.datastore.ListValueTest
[INFO] Running com.google.cloud.datastore.EntityTest
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 s - in com.google.cloud.datastore.EntityTest
[INFO] Running com.google.cloud.datastore.NullValueTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in com.google.cloud.datastore.NullValueTest
[INFO] Running com.google.cloud.datastore.BaseEntityTest
[INFO] Tests run: 17, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.011 s - in com.google.cloud.datastore.BaseEntityTest
[INFO] Running com.google.cloud.datastore.ProjectionEntityTest
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in com.google.cloud.datastore.ProjectionEntityTest
[INFO] Running com.google.cloud.datastore.DatastoreHelperTest
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.09 s - in com.google.cloud.datastore.DatastoreHelperTest
[INFO] Running com.google.cloud.datastore.DoubleValueTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in com.google.cloud.datastore.DoubleValueTest
[INFO] Running com.google.cloud.datastore.BaseDatastoreBatchWriterTest
[INFO] Tests run: 27, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.017 s - in com.google.cloud.datastore.BaseDatastoreBatchWriterTest
[INFO] Running com.google.cloud.datastore.ValueTest
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in com.google.cloud.datastore.ValueTest
[INFO] Running com.google.cloud.datastore.KeyFactoryTest
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in com.google.cloud.datastore.KeyFactoryTest
[INFO] Running com.google.cloud.datastore.RawValueTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in com.google.cloud.datastore.RawValueTest
[INFO] Running com.google.cloud.datastore.BooleanValueTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in com.google.cloud.datastore.BooleanValueTest
[INFO] Running com.google.cloud.datastore.KeyTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 s - in com.google.cloud.datastore.KeyTest
[INFO] Running com.google.cloud.datastore.it.MultipleAttemptsRuleTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.082 s - in com.google.cloud.datastore.it.MultipleAttemptsRuleTest
[INFO] Running com.google.cloud.datastore.EntityValueTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s - in com.google.cloud.datastore.EntityValueTest
[INFO] Running com.google.cloud.datastore.TransactionExceptionHandlerTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 s - in com.google.cloud.datastore.TransactionExceptionHandlerTest
[INFO] Running com.google.cloud.datastore.BlobValueTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in com.google.cloud.datastore.BlobValueTest
[INFO] Running com.google.cloud.datastore.FullEntityTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in com.google.cloud.datastore.FullEntityTest
[INFO] Running com.google.cloud.datastore.DatastoreExceptionTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 s - in com.google.cloud.datastore.DatastoreExceptionTest
[INFO] Running com.google.cloud.datastore.StringValueTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in com.google.cloud.datastore.StringValueTest
[INFO] Running com.google.cloud.datastore.LongValueTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in com.google.cloud.datastore.LongValueTest
[INFO] Running com.google.cloud.datastore.LatLngValueTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in com.google.cloud.datastore.LatLngValueTest
[INFO] Running com.google.cloud.datastore.TimestampValueTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in com.google.cloud.datastore.TimestampValueTest
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 165, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.5:report (report) @ google-cloud-datastore ---
[INFO] Loading execution data file /usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/google-cloud-datastore/target/jacoco.exec
[INFO] Analyzed bundle 'Google Cloud Datastore' with 121 classes
[INFO] 
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ google-cloud-datastore ---
[INFO] Building jar: /usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/google-cloud-datastore/target/google-cloud-datastore-1.102.5-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-jar-plugin:3.2.0:test-jar (default) @ google-cloud-datastore ---
[INFO] Building jar: /usr/local/google/home/benwhitehead/src/github.com/googleapis/java/datastore/google-cloud-datastore/target/google-cloud-datastore-1.102.5-SNAPSHOT-tests.jar
[INFO] 
[INFO] --- maven-failsafe-plugin:3.0.0-M4:integration-test (default) @ google-cloud-datastore ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.google.cloud.datastore.ITEmulatorDatastoreTest
May 28, 2020 6:07:43 PM com.google.cloud.testing.BlockingProcessStreamReader writeLog
INFO: [datastore] Adding handler(s) to newly registered Channel.
May 28, 2020 6:07:43 PM com.google.cloud.testing.BlockingProcessStreamReader writeLog
INFO: [datastore] Detected non-HTTP/2 connection.
May 28, 2020 6:07:43 PM com.google.cloud.testing.BlockingProcessStreamReader writeLog
INFO: [datastore] Adding handler(s) to newly registered Channel.
May 28, 2020 6:07:45 PM com.google.cloud.testing.BlockingProcessStreamReader writeLog
INFO: [datastore] Detected HTTP/2 connection.
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore]
May 28, 2020 6:07:45 PM com.google.cloud.testing.BlockingProcessStreamReader writeLog
INFO: [datastore] Exception when handling request: ABORTED: too much contention on these datastore entities. please try again.
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore]
May 28, 2020 6:07:47 PM com.google.cloud.testing.BlockingProcessStreamReader writeLog
INFO: [datastore] Exception when handling request: ALREADY_EXISTS: entity already exists
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore]
May 28, 2020 6:07:47 PM com.google.cloud.testing.BlockingProcessStreamReader writeLog
INFO: [datastore] Exception when handling request: NOT_FOUND: no entity to update
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore] 
[datastore]
May 28, 2020 6:07:49 PM com.google.cloud.testing.BlockingProcessStreamReader writeLog
INFO: [datastore] Exception when handling request: ABORTED: too much contention on these datastore entities. please try again.
May 28, 2020 6:07:49 PM com.google.cloud.testing.BlockingProcessStreamReader writeLog
INFO: [datastore] Time to persist datastore: 6 ms
[datastore] *** shutting down gRPC server since JVM is shutting down
[datastore] *** server shut down
[INFO] Tests run: 36, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.911 s - in com.google.cloud.datastore.ITEmulatorDatastoreTest
[INFO] Running com.google.cloud.datastore.testing.ITLocalDatastoreHelperTest
May 28, 2020 6:07:50 PM com.google.cloud.testing.BlockingProcessStreamReader writeLog
INFO: [datastore] Adding handler(s) to newly registered Channel.
May 28, 2020 6:07:50 PM com.google.cloud.testing.BlockingProcessStreamReader writeLog
INFO: [datastore] Detected non-HTTP/2 connection.
May 28, 2020 6:07:50 PM com.google.cloud.testing.BlockingProcessStreamReader writeLog
INFO: [datastore] Adding handler(s) to newly registered Channel.
May 28, 2020 6:07:51 PM com.google.cloud.testing.BlockingProcessStreamReader writeLog
INFO: [datastore] Detected HTTP/2 connection.
[datastore]
May 28, 2020 6:07:51 PM com.google.cloud.testing.BlockingProcessStreamReader writeLog
WARNING: [datastore] Cannot reset a Datastore Emulator when it is storing data on disk.
[datastore] Re-run the emulator with the --testing flag to start the emulator in-memory.
May 28, 2020 6:08:20 PM com.google.cloud.testing.BlockingProcessStreamReader writeLog
WARNING: [datastore] An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
[datastore] java.lang.NullPointerException
[datastore] 	at io.netty.buffer.ByteBufUtil.utf8MaxBytes(ByteBufUtil.java:599)
[datastore] 	at io.netty.buffer.ByteBufUtil.writeUtf8(ByteBufUtil.java:498)
[datastore] 	at io.gapi.emulators.netty.SimpleHttpHandler.writeUtf8(SimpleHttpHandler.java:117)
[datastore] 	at io.gapi.emulators.netty.SimpleHttpHandler$1.onError(SimpleHttpHandler.java:83)
[datastore] 	at io.gapi.emulators.netty.ResetHandler.handleRequest(ResetHandler.java:58)
[datastore] 	at io.gapi.emulators.netty.SimpleHttpHandler.channelRead(SimpleHttpHandler.java:67)
[datastore] 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
[datastore] 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
[datastore] 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
[datastore] 	at io.gapi.emulators.netty.SimpleHttpHandler.channelRead(SimpleHttpHandler.java:102)
[datastore] 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
[datastore] 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
[datastore] 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
[datastore] 	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
[datastore] 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
[datastore] 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
[datastore] 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
[datastore] 	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
[datastore] 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
[datastore] 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
[datastore] 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
[datastore] 	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:323)
[datastore] 	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:297)
[datastore] 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
[datastore] 	at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:38)
[datastore] 	at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:353)
[datastore] 	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
[datastore] 	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
[datastore] 	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:474)
[datastore] 	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:909)
[datastore] 	at java.lang.Thread.run(Thread.java:748)
[datastore]
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 36, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- maven-failsafe-plugin:3.0.0-M4:verify (default) @ google-cloud-datastore ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Google Cloud Datastore Parent 1.102.5-SNAPSHOT ..... SUCCESS [  0.903 s]
[INFO] proto-google-cloud-datastore-v1 0.85.5-SNAPSHOT .... SUCCESS [  0.404 s]
[INFO] Google Cloud Datastore 1.102.5-SNAPSHOT ............ FAILURE [02:06 min]
[INFO] Google Cloud datastore BOM 1.102.5-SNAPSHOT ........ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:08 min
[INFO] Finished at: 2020-05-28T18:09:44-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:3.0.0-M4:verify (default) on project google-cloud-datastore: There was a timeout or other error in the fork -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :google-cloud-datastore

@athakor
Copy link
Contributor Author

athakor commented Jun 2, 2020

This does not build & test cleanly for me in my environment which doesn't have gcloud on my PATH, the full test suite would run successfully prior to this change.

My java & maven:

Apache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117; 2019-08-27T11:06:16-04:00)
Maven home: ~/opt/maven/latest
Java version: 1.8.0_201, vendor: Oracle Corporation, runtime: ~/opt/java/jdk1.8.0_201/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.2.17-1rodete3-amd64", arch: "amd64", family: "unix"

build log with timeout failure

@BenWhitehead Thanks for catching this, it's fixed please check again this in your env.

Copy link
Collaborator

@BenWhitehead BenWhitehead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test suite runs cleanly for me thanks for digging into the timeout.

One small request to cleanup the tmp dirs that get created, after that we can merge.


@Before
public void setUp() throws IOException {
dataDir = Files.createTempDirectory("gcd");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, can you also add a delete in an @After so we're not leaving lots of directories around?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

assertEquals(dataDir, helper.getGcdPath());
LocalDatastoreHelper actualHelper = helper.toBuilder().build();
assertLocalDatastoreHelpersEquivelent(helper, actualHelper);
Path dataDir = Files.createTempDirectory("gcd_data_dir");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleanup dir like above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@athakor
Copy link
Contributor Author

athakor commented Jun 3, 2020

@BenWhitehead Both the comments have been addressed. PTAL

@@ -53,6 +54,11 @@ public void setUp() throws IOException {
dataDir = Files.createTempDirectory("gcd");
}

@After
public void tearDown() throws IOException {
Files.delete(dataDir);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling Files.delete will fail if it is a directory which is not empty javadoc.

Instead you can use the helper method com.google.cloud.datastore.testing.LocalDatastoreHelper#deleteRecursively by making it package-private.

Copy link
Contributor Author

@athakor athakor Jun 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. PTAL

@BenWhitehead BenWhitehead merged commit 976d979 into googleapis:master Jun 4, 2020
gcf-merge-on-green bot pushed a commit that referenced this pull request Jun 17, 2020
🤖 I have created a release \*beep\* \*boop\* 
---
## [1.104.0](https://www.github.com/googleapis/java-datastore/compare/v1.103.0...v1.104.0) (2020-06-17)


### Features

* add opencensus tracing/stats support for Datastore RPC operations ([#130](https://www.github.com/googleapis/java-datastore/issues/130)) ([5aee52f](https://www.github.com/googleapis/java-datastore/commit/5aee52f5013d6780e523e0c6d7d00a1826b83b9b))
* add support to customize gcloud command of LocalDatastoreHelper ([#137](https://www.github.com/googleapis/java-datastore/issues/137)) ([976d979](https://www.github.com/googleapis/java-datastore/commit/976d9791572117dc703d8d7d6963bdd6603ecd63))


### Bug Fixes

* fix version number in changelog to correctly reflect what was released to maven central ([#145](https://www.github.com/googleapis/java-datastore/issues/145)) ([c509a2a](https://www.github.com/googleapis/java-datastore/commit/c509a2a4229f864edef8681677d73f3c7be1101f))


### Dependencies

* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.8.0 ([#161](https://www.github.com/googleapis/java-datastore/issues/161)) ([39c8d72](https://www.github.com/googleapis/java-datastore/commit/39c8d723b318d08ca494b71167eaa80b1df6423d))
* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.8.1 ([#163](https://www.github.com/googleapis/java-datastore/issues/163)) ([7bfa07e](https://www.github.com/googleapis/java-datastore/commit/7bfa07eb3a7cf84fcf3e19f6a33914162fa28499))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Customize gcloudCommand of LocalDatastoreHelper
3 participants