-
Notifications
You must be signed in to change notification settings - Fork 29
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
Wait for config to be ready before accessing values #3799
Conversation
@@ -577,7 +577,7 @@ suite('Setup Test Suite', () => { | |||
mockExecuteCommand.restore() | |||
mockRunSetup.restore() | |||
stub(config, 'isPythonExtensionUsed').returns(false) | |||
stub(config, 'getPythonBinPath').resolves(join('python')) | |||
stub(config, 'getPythonBinPath').returns(join('python')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[F] This was the cause of these test warnings.
@@ -389,18 +390,14 @@ export class Setup | |||
} | |||
} | |||
|
|||
private isDVCBeingUsedGlobally() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We append the path to python to the PATH
variable for the edge case that DVC is being used as a binary but with a virtual environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I was locally testing, when I chose a global version of DVC, isPythonExtensionUsed
returns true, showing the "Select Python Interpreter" on the front end:
I assumed that was just how isPythonExtensionUsed
worked and added an extra check with isDVCBeingUsedGlobally
, but maybe there is a bug with the function or there is something wrong about my local environment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because we append the virtual environment path to the PATH environment variable it is technically being used.
@@ -374,7 +374,8 @@ export class Setup | |||
return this.sendDataToWebview() | |||
} | |||
|
|||
public getDvcCliDetails(): DvcCliDetails { | |||
private async getDvcCliDetails(): Promise<DvcCliDetails> { | |||
await this.config.isReady() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[F] Need to make sure that the config has set the pythonBinPath before we try to access it.
8fefe2d
to
e76244b
Compare
Code Climate has analyzed commit 98a89eb and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (85% is the threshold). This pull request will bring the total coverage in the repository to 94.7% (0.0% change). View more on Code Climate. |
I saw lots of type errors being sent to the integration test logs. After investigating I found and fixed some issues.