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

test: adds integration tests for workload identity federation #581

Merged
merged 13 commits into from
Mar 17, 2021
Merged

test: adds integration tests for workload identity federation #581

merged 13 commits into from
Mar 17, 2021

Conversation

lsirac
Copy link
Contributor

@lsirac lsirac commented Feb 25, 2021

A setup script workloadidentityfederation-setup.sh is added to make the workload identity pool configuration changes on the current project, if needed. The setup script only needs to be run once on a project (already ran).

@lsirac lsirac requested a review from a team as a code owner February 25, 2021 03:52
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Feb 25, 2021
@lsirac lsirac requested a review from chingor13 February 25, 2021 03:52
@elharo
Copy link
Contributor

elharo commented Feb 25, 2021

Tests fail on windows:

Error: Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.052 s <<< FAILURE! - in com.google.auth.oauth2.ITWorkloadIdentityFederationTest
Error: com.google.auth.oauth2.ITWorkloadIdentityFederationTest.identityPoolCredentials Time elapsed: 0.046 s <<< ERROR!
java.lang.NullPointerException
at com.google.auth.oauth2.ITWorkloadIdentityFederationTest.getServiceAccountKeyFileAsJson(ITWorkloadIdentityFederationTest.java:247)
at com.google.auth.oauth2.ITWorkloadIdentityFederationTest.setup(ITWorkloadIdentityFederationTest.java:93)

Error: com.google.auth.oauth2.ITWorkloadIdentityFederationTest.awsCredentials Time elapsed: 0 s <<< ERROR!
java.lang.NullPointerException
at com.google.auth.oauth2.ITWorkloadIdentityFederationTest.getServiceAccountKeyFileAsJson(ITWorkloadIdentityFederationTest.java:247)
at com.google.auth.oauth2.ITWorkloadIdentityFederationTest.setup(ITWorkloadIdentityFederationTest.java:93)

@chingor13
Copy link
Contributor

Tests fail on windows:

The windows and unit test failures are because these tests are integration tests that we only want to run in certain cases (need credentials and need to run on Kokoro).

@codecov
Copy link

codecov bot commented Feb 25, 2021

Codecov Report

Merging #581 (2beb042) into master (5c7deec) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #581      +/-   ##
============================================
+ Coverage     83.45%   83.49%   +0.04%     
- Complexity      594      599       +5     
============================================
  Files            41       42       +1     
  Lines          2695     2708      +13     
  Branches        286      288       +2     
============================================
+ Hits           2249     2261      +12     
- Misses          303      304       +1     
  Partials        143      143              
Impacted Files Coverage Δ Complexity Δ
...tp/java/com/google/auth/oauth2/AwsCredentials.java 93.26% <100.00%> (-0.91%) 15.00 <5.00> (-1.00)
...google/auth/oauth2/ExternalAccountCredentials.java 97.76% <100.00%> (+0.14%) 29.00 <5.00> (+3.00)
...om/google/auth/oauth2/IdentityPoolCredentials.java 86.17% <100.00%> (+0.14%) 12.00 <0.00> (ø)
.../google/auth/oauth2/SystemEnvironmentProvider.java 100.00% <100.00%> (ø) 3.00 <3.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 5c7deec...2beb042. Read the comment docs.

@lsirac lsirac requested a review from chingor13 March 5, 2021 19:35
@lsirac lsirac requested a review from chingor13 March 16, 2021 02:44
@generated-files-bot
Copy link

generated-files-bot bot commented Mar 16, 2021

Warning: This pull request is touching the following templated files:

  • .kokoro/nightly/integration.cfg
  • .kokoro/presubmit/integration.cfg

this.environmentProvider = SystemEnvironmentProvider.getInstance();

this.impersonatedCredentials = initializeImpersonatedCredentials();
this(
Copy link
Contributor

Choose a reason for hiding this comment

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

In hindsight, we should have made these protected constructors accept only the Builders to avoid bloating all these constructor overloads.

@chingor13 chingor13 added the automerge Merge the pull request once unit tests and other checks pass. label Mar 16, 2021
@gcf-merge-on-green gcf-merge-on-green bot merged commit 31ebe6e into googleapis:master Mar 17, 2021
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Mar 17, 2021
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.

3 participants