8000 Redis: Added system test by athakor · Pull Request #6375 · googleapis/google-cloud-java · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@athakor
Copy link
Contrib 8000 utor
@athakor athakor commented Sep 30, 2019

towards #5947

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Sep 30, 2019
@athakor athakor added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 30, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 30, 2019
@athakor athakor added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 30, 2019
@pmakani pmakani removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 30, 2019
@athakor
Copy link
Contributor Author
athakor commented Sep 30, 2019

@chingor13 Build failed due to Redis service is not enable or activate for this project.

Copy link
Contributor
@chingor13 chingor13 left a comment

Choose a reason for hiding this comment

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

We likely want to create the instance in a @BeforeClass and delete it in the @AfterClass teardown. We also need to make sure this can run multiple times in parallel by avoiding using the same instance name/id.

@chingor13
Copy link
Contributor

@athakor I enabled the Redis API on the test project and restarted the test. It's now failing with a validation error about an invalid network parameter.

@codecov
Copy link
codecov bot commented Oct 1, 2019

Codecov Report

Merging #6375 into master will decrease coverage by 0.15%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #6375      +/-   ##
============================================
- Coverage      46.5%   46.34%   -0.16%     
+ Complexity    28131    27968     -163     
============================================
  Files          2625     2613      -12     
  Lines        289532   287931    -1601     
  Branches      33753    33756       +3     
============================================
- Hits         134637   133452    -1185     
+ Misses       144654   144259     -395     
+ Partials      10241    10220      -21
Impacted Files Coverage Δ Complexity Δ
...in/java/com/google/cloud/storage/PolicyHelper.java 95.23% <0%> (-4.77%) 7% <0%> (+1%)
...m/google/cloud/redis/v1beta1/CloudRedisClient.java 56.41% <0%> (-3.96%) 35% <0%> (ø)
...able/gaxx/reframing/ReframingResponseObserver.java 88.99% <0%> (-1.84%) 29% <0%> (-1%)
...ain/java/com/google/cloud/storage/StorageImpl.java 76.72% <0%> (-1.66%) 108% <0%> (+8%)
...cloud/datacatalog/v1beta1/DataCatalogSettings.java 9.33% <0%> (-1.44%) 2% <0%> (ø)
...loud/datacatalog/v1beta1/stub/DataCatalogStub.java 3.7% <0%> (-0.85%) 1% <0%> (ø)
...ain/java/com/google/cloud/pubsub/v1/Publisher.java 89.15% <0%> (-0.34%) 40% <0%> (ø)
...rc/main/java/com/google/cloud/storage/Storage.java 79.39% <0%> (-0.33%) 0% <0%> (ø)
...com/google/cloud/redis/v1/stub/CloudRedisStub.java 5.88% <0%> (ø) 1% <0%> (ø) ⬇️
...google/cloud/redis/v1beta1/CloudRedisSettings.java 12.72% <0%> (ø) 2% <0%> (ø) ⬇️
... and 38 more

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 d760f2c...a1f48d8. Read the comment docs.

@athakor athakor added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 1, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 1, 2019
/** Creates a Redis instance based on the specified tier and memory size. */
LocationName parent = LocationName.of(projectId, LOCATION);
Instance instance = Instance.newBuilder().setTier(TIER).setMemorySizeGb(MEMORY_SIZE_GB).build();
client.createInstanceAsync(parent, INSTANCE, instance).get();
Copy link
Contributor

Choose a reason for hiding this comment

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

This is failing with an invalid config: Invalid authorized network 'default'. Legacy networks are not supported.

Copy link
Contributor

Choose a reason for hiding this comment

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

@chingor13 Its working for grass-clump-project locally, from console as well as api explorer. Does it need any setting on project thats used for CI? Otherwise we will have to create VPC run system test and delete VPC which would add dependency on compute client.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is likely because our test project is very old and has some older grandfathered in settings (like default networking) still configured. I'll investigate some more.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm hesitant to change the default network for the test project, so I created a new redis-vpc network in our test project. Let's make the test configurable (via a maven param like -Dredis.network=redis-vpc which we can add here (and in the continuous integration config). We can default that value to default for most other users who run the tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

sounds good. Thanks @chingor13

@athakor athakor added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 7, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 7, 2019
@athakor
Copy link
Contributor Author
athakor commented Oct 7, 2019

@chingor13 PTAL

Copy link
Contributor
@chingor13 chingor13 left a comment

Choose a reason for hiding this comment

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

Thanks, one last suggestion.

INSTANCE_NAME_PREFIX + "-" + UUID.randomUUID().toString().substring(0, 8);
private static final String LOCATION = "us-central1";
private static final int MEMORY_SIZE_GB = 1;
private static final String AUTHORIZED_NETWORK = System.getProperty("redis.network");
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
private static final String AUTHORIZED_NETWORK = System.getProperty("redis.network");
private static final String AUTHORIZED_NETWORK = System.getProperty("redis.network", "default");

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

Comment on lines 55 to 58
String authorizedNetwork =
AUTHORIZED_NETWORK == null || AUTHORIZED_NETWORK.isEmpty()
? "projects/" + projectId + "/global/networks/default"
: "projects/" + projectId + "/global/networks/" + AUTHORIZED_NETWORK;
Copy link
Contributor

Choose a reason for hiding this comment

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

We can simplify this if we set the default above:

String authorizedNetwork = "projects/" + projectId + "/global/networks/" + AUTHORIZED_NETWORK;

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. @chingor13 PTAL

@chingor13 chingor13 self-assigned this Oct 7, 2019
@chingor13 chingor13 changed the title Redis : Added system test Redis: Added system test Oct 7, 2019
@athakor athakor added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 9, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 9, 2019
@pmakani pmakani added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 9, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 9, 2019
@chingor13 chingor13 merged commit 25d1c99 into googleapis:master Oct 9, 2019
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.

6 participants

0