You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.
in com/google/cloud/pubsub/client/demos/cli/PubsubIntegrationTest.java, the following line isn't effective after setting environment variable TEST_PROJECT_ID: @BeforeClass public static void setUpBeforeClass() throws Exception { String[] args = {PROJECT_ID, "create_topic", TOPIC_NAME}; Main.main(args); String[] subArgs = {PROJECT_ID, "create_subscription", SUBSCRIPTION_NAME, TOPIC_NAME}; Main.main(subArgs); }
I had to manually modify the default project ID to an existing project ID for the integration tests to run: private static final String DEFAULT_TEST_PROJECT_ID = "hilliao-on-justinburke";
I expect the environment variable 'TEST_PROJECT_ID' java code to be effective.
Here's the build error without modifying the java code:
ITs-MacBook-Pro@ITs-MacBook-Pro: $ echo $TEST_PROJECT_ID
hilliao-on-justinburke
ITs-MacBook-Pro@ITs-MacBook-Pro: $ mvn package
[INFO] Scanning for projects...
[WARNING] The project com.google.apis-samples:pubsub-appengine-sample:war:1 uses prerequisites which is only intended for maven-plugin projects but not for non maven-plugin projects. For such purposes you should use the maven-enforcer-plugin. See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] pubsub-pull-sample [jar]
[INFO] Example for the Google Cloud Pub/Sub on Google App Engine. [war]
[INFO] Cloud Dataflow Examples [jar]
[INFO] cloud-pubsub-samples-java [pom]
[INFO]
[INFO] -------------< com.google.apis-samples:pubsub-pull-sample >-------------
[INFO] Building pubsub-pull-sample 1.0 [1/4]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-checkstyle-plugin:2.15:check (checkstyle) @ pubsub-pull-sample ---
[INFO] Starting audit...
Audit done.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ pubsub-pull-sample ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/hilliao/cloud-pubsub-samples-java/cmdline-pull/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ pubsub-pull-sample ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 6 source files to /Users/hilliao/cloud-pubsub-samples-java/cmdline-pull/target/classes
[WARNING] /Users/hilliao/cloud-pubsub-samples-java/cmdline-pull/src/main/java/com/google/cloud/pubsub/client/demos/cli/Main.java: /Users/hilliao/cloud-pubsub-samples-java/cmdline-pull/src/main/java/com/google/cloud/pubsub/client/demos/cli/Main.java uses or overrides a deprecated API.
[WARNING] /Users/hilliao/cloud-pubsub-samples-java/cmdline-pull/src/main/java/com/google/cloud/pubsub/client/demos/cli/Main.java: Recompile with -Xlint:deprecation for details.
[INFO]
[INFO] --- versions-maven-plugin:2.1:display-dependency-updates (default) @ pubsub-pull-sample ---
[INFO] The following dependencies in Dependencies have newer versions:
[INFO] com.google.apis:google-api-services-pubsub ...
[INFO] v1-rev8-1.21.0 -> v1-rev20181213-1.27.0
[INFO] commons-cli:commons-cli ................................. 1.3.1 -> 1.4
[INFO] junit:junit ...................................... 4.12 -> 4.13-beta-1
[INFO] org.mockito:mockito-all ........................ 1.10.19 -> 2.0.2-beta
[INFO]
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ pubsub-pull-sample ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/hilliao/cloud-pubsub-samples-java/cmdline-pull/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ pubsub-pull-sample ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/hilliao/cloud-pubsub-samples-java/cmdline-pull/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ pubsub-pull-sample ---
[INFO] Surefire report directory: /Users/hilliao/cloud-pubsub-samples-java/cmdline-pull/target/surefire-reports
T E S T S
Running com.google.cloud.pubsub.client.demos.cli.PubsubIntegrationTest
com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
"code" : 403,
"errors" : [ {
"domain" : "global",
"message" : "User not authorized to perform this action.",
"reason" : "forbidden"
} ],
"message" : "User not authorized to perform this action.",
"status" : "PERMISSION_DENIED"
}
at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:145)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:321)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1056)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
at com.google.cloud.pubsub.client.demos.cli.TopicMethods.createTopic(TopicMethods.java:56)
at com.google.cloud.pubsub.client.demos.cli.Main$CmdLineOperation$1.run(Main.java:58)
at com.google.cloud.pubsub.client.demos.cli.Main.main(Main.java:207)
at com.google.cloud.pubsub.client.demos.cli.PubsubIntegrationTest.setUpBeforeClass(PubsubIntegrationTest.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] pubsub-pull-sample 1.0 ............................. FAILURE [ 4.184 s]
[INFO] Example for the Google Cloud Pub/Sub on Google App Engine. 1 SKIPPED
[INFO] Cloud Dataflow Examples 1 .......................... SKIPPED
[INFO] cloud-pubsub-samples-java 0.1 ...................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.794 s
[INFO] Finished at: 2019-01-10T16:36:05-06:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project pubsub-pull-sample: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ? -> [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/PluginExecutionException
The text was updated successfully, but these errors were encountered:
in com/google/cloud/pubsub/client/demos/cli/PubsubIntegrationTest.java, the following line isn't effective after setting environment variable TEST_PROJECT_ID:
@BeforeClass public static void setUpBeforeClass() throws Exception { String[] args = {PROJECT_ID, "create_topic", TOPIC_NAME}; Main.main(args); String[] subArgs = {PROJECT_ID, "create_subscription", SUBSCRIPTION_NAME, TOPIC_NAME}; Main.main(subArgs); }
I had to manually modify the default project ID to an existing project ID for the integration tests to run:
private static final String DEFAULT_TEST_PROJECT_ID = "hilliao-on-justinburke";
I expect the environment variable 'TEST_PROJECT_ID' java code to be effective.
Here's the build error without modifying the java code:
ITs-MacBook-Pro@ITs-MacBook-Pro: $ echo $TEST_PROJECT_ID
hilliao-on-justinburke
ITs-MacBook-Pro@ITs-MacBook-Pro: $ mvn package
[INFO] Scanning for projects...
[WARNING] The project com.google.apis-samples:pubsub-appengine-sample:war:1 uses prerequisites which is only intended for maven-plugin projects but not for non maven-plugin projects. For such purposes you should use the maven-enforcer-plugin. See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] pubsub-pull-sample [jar]
[INFO] Example for the Google Cloud Pub/Sub on Google App Engine. [war]
[INFO] Cloud Dataflow Examples [jar]
[INFO] cloud-pubsub-samples-java [pom]
[INFO]
[INFO] -------------< com.google.apis-samples:pubsub-pull-sample >-------------
[INFO] Building pubsub-pull-sample 1.0 [1/4]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-checkstyle-plugin:2.15:check (checkstyle) @ pubsub-pull-sample ---
[INFO] Starting audit...
Audit done.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ pubsub-pull-sample ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/hilliao/cloud-pubsub-samples-java/cmdline-pull/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ pubsub-pull-sample ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 6 source files to /Users/hilliao/cloud-pubsub-samples-java/cmdline-pull/target/classes
[WARNING] /Users/hilliao/cloud-pubsub-samples-java/cmdline-pull/src/main/java/com/google/cloud/pubsub/client/demos/cli/Main.java: /Users/hilliao/cloud-pubsub-samples-java/cmdline-pull/src/main/java/com/google/cloud/pubsub/client/demos/cli/Main.java uses or overrides a deprecated API.
[WARNING] /Users/hilliao/cloud-pubsub-samples-java/cmdline-pull/src/main/java/com/google/cloud/pubsub/client/demos/cli/Main.java: Recompile with -Xlint:deprecation for details.
[INFO]
[INFO] --- versions-maven-plugin:2.1:display-dependency-updates (default) @ pubsub-pull-sample ---
[INFO] The following dependencies in Dependencies have newer versions:
[INFO] com.google.apis:google-api-services-pubsub ...
[INFO] v1-rev8-1.21.0 -> v1-rev20181213-1.27.0
[INFO] commons-cli:commons-cli ................................. 1.3.1 -> 1.4
[INFO] junit:junit ...................................... 4.12 -> 4.13-beta-1
[INFO] org.mockito:mockito-all ........................ 1.10.19 -> 2.0.2-beta
[INFO]
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ pubsub-pull-sample ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/hilliao/cloud-pubsub-samples-java/cmdline-pull/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ pubsub-pull-sample ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/hilliao/cloud-pubsub-samples-java/cmdline-pull/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ pubsub-pull-sample ---
[INFO] Surefire report directory: /Users/hilliao/cloud-pubsub-samples-java/cmdline-pull/target/surefire-reports
T E S T S
Running com.google.cloud.pubsub.client.demos.cli.PubsubIntegrationTest
com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
"code" : 403,
"errors" : [ {
"domain" : "global",
"message" : "User not authorized to perform this action.",
"reason" : "forbidden"
} ],
"message" : "User not authorized to perform this action.",
"status" : "PERMISSION_DENIED"
}
at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:145)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:321)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1056)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
at com.google.cloud.pubsub.client.demos.cli.TopicMethods.createTopic(TopicMethods.java:56)
at com.google.cloud.pubsub.client.demos.cli.Main$CmdLineOperation$1.run(Main.java:58)
at com.google.cloud.pubsub.client.demos.cli.Main.main(Main.java:207)
at com.google.cloud.pubsub.client.demos.cli.PubsubIntegrationTest.setUpBeforeClass(PubsubIntegrationTest.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] pubsub-pull-sample 1.0 ............................. FAILURE [ 4.184 s]
[INFO] Example for the Google Cloud Pub/Sub on Google App Engine. 1 SKIPPED
[INFO] Cloud Dataflow Examples 1 .......................... SKIPPED
[INFO] cloud-pubsub-samples-java 0.1 ...................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.794 s
[INFO] Finished at: 2019-01-10T16:36:05-06:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project pubsub-pull-sample: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ? -> [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/PluginExecutionException
The text was updated successfully, but these errors were encountered: