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

fix: Integration tests on windows #1283

Merged
merged 33 commits into from
Oct 29, 2020
Merged

Conversation

adamfilipow92
Copy link
Contributor

Fixes #1282

Test Plan

How do we know the code works?

Integration tests on windows should works

@github-actions
Copy link
Contributor

Buildscan url for ubuntu-workflow run 333642729
https://gradle.com/s/n4pj4ns4eqpls

@github-actions
Copy link
Contributor

Buildscan url for ubuntu-workflow run 333752188
https://gradle.com/s/epct6zkiyxkt2

@github-actions
Copy link
Contributor

Buildscan url for ubuntu-workflow run 333813859
https://gradle.com/s/pnqofmb5vsilg

@github-actions
Copy link
Contributor

Buildscan url for ubuntu-workflow run 333883441
https://gradle.com/s/mp2qeiptef75k

@codecov-io
Copy link

codecov-io commented Oct 28, 2020

Codecov Report

Merging #1283 into master will decrease coverage by 0.10%.
The diff coverage is 10.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1283      +/-   ##
============================================
- Coverage     79.76%   79.66%   -0.11%     
  Complexity      724      724              
============================================
  Files           235      235              
  Lines          4483     4489       +6     
  Branches        768      771       +3     
============================================
  Hits           3576     3576              
- Misses          509      514       +5     
- Partials        398      399       +1     

@github-actions
Copy link
Contributor

Buildscan url for ubuntu-workflow run 333925165
https://gradle.com/s/mh76ps5e5rqde

@github-actions
Copy link
Contributor

Buildscan url for ubuntu-workflow run 333964681
https://gradle.com/s/uc5iog466w6lo

@github-actions
Copy link
Contributor

Buildscan url for ubuntu-workflow run 333977503
https://gradle.com/s/zeqyfnovp5aq6

@github-actions
Copy link
Contributor

Buildscan url for ubuntu-workflow run 334081456
https://gradle.com/s/nl3izdknbkuuc

@github-actions
Copy link
Contributor

Buildscan url for ubuntu-workflow run 334114456
https://gradle.com/s/y6im3ndf5krtc

@github-actions
Copy link
Contributor

Buildscan url for ubuntu-workflow run 334138541

@github-actions
Copy link
Contributor

Buildscan url for ubuntu-workflow run 334193230
https://gradle.com/s/jzqihqria3ejm

@github-actions
Copy link
Contributor

Buildscan url for ubuntu-workflow run 334621677
https://gradle.com/s/drvpyg6len35q

@github-actions
Copy link
Contributor

Buildscan url for ubuntu-workflow run 334653171
https://gradle.com/s/kjfwczxfvkdi6

@github-actions
Copy link
Contributor

Buildscan url for ubuntu-workflow run 334659370
https://gradle.com/s/67f74t4rproca

@github-actions
Copy link
Contributor

Buildscan url for ubuntu-workflow run 334710329
https://gradle.com/s/3tsvh4cyymbas

} catch (e: IOException) {
throw FlankGeneralError("Error: Failed to read service account credential.\n${e.message}")
}.getOrElse {
if (isWindows) GoogleCredentials.fromStream(defaultCredentialPath.toFile().inputStream())
Copy link
Contributor

@pawelpasterz pawelpasterz Oct 29, 2020

Choose a reason for hiding this comment

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

What will be the error message when flan fails reading credentials on Windows as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably similiar to previous one from ServiceAccountCredentials.getApplicationDefault()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I changed it to throws FlankGeneralException like on non-windows.

@@ -69,18 +68,20 @@ object FtlConstants {
}

val defaultCredentialPath: Path by lazy {
Paths.get(System.getProperty("user.home"), ".config/gcloud/application_default_credentials.json")
if (isWindows) Paths.get(System.getenv("HOMEPATH"), ".config/gcloud/application_default_credentials.json")
Copy link
Contributor

Choose a reason for hiding this comment

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

How about

       val homePath = if(isWindows) (System.getenv("HOMEPATH") else System.getProperty("user.home")
       Paths.get(homePath, ".config/gcloud/application_default_credentials.json")

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed! Thanks!

@github-actions
Copy link
Contributor

Buildscan url for ubuntu-workflow run 335608461
https://gradle.com/s/hmlg6svuhmhnm

@adamfilipow92 adamfilipow92 merged commit 5f4b0ba into master Oct 29, 2020
@adamfilipow92 adamfilipow92 deleted the fix-windows-integration-tests branch October 29, 2020 11:17
@github-actions
Copy link
Contributor

Buildscan url for ubuntu-workflow run 335688160
https://gradle.com/s/fmi6qazsdfnhk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows | Integration not working
5 participants