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

Use python.envFile to get env file name when running Python code #10876

Merged
merged 21 commits into from
Jul 21, 2022

Conversation

DonJayamanne
Copy link
Contributor

Fixes #9691

@DonJayamanne DonJayamanne marked this pull request as ready for review July 20, 2022 17:03
@DonJayamanne DonJayamanne requested a review from a team as a code owner July 20, 2022 17:03
import { IPythonExtensionChecker } from '../../../../../platform/api/types';
import { createEventHandler } from '../../../../common';

suite('Custom Environment Variables Provider', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

could these be unit tests? Doesn't seem to requre vscode to be running

Copy link
Contributor Author

@DonJayamanne DonJayamanne Jul 20, 2022

Choose a reason for hiding this comment

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

I rely on vscode here as I'm using the VS Code API to create the file watcher and i don't want to mock that, too much work and not worth it at all.

Here we have 6 test and everything runs in <1s.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@amunger looks like i'll have to create unit tests and mock the vscode classes, as the file change detection doesn't work on CI, possibly due to a large number of files or other.

@codecov-commenter
Copy link

codecov-commenter commented Jul 20, 2022

Codecov Report

Merging #10876 (0f0fddd) into main (b96c58e) will increase coverage by 0%.
The diff coverage is 89%.

❗ Current head 0f0fddd differs from pull request most recent head d524656. Consider uploading reports for the commit d524656 to get more accurate results

@@          Coverage Diff           @@
##            main   #10876   +/-   ##
======================================
  Coverage     63%      63%           
======================================
  Files        486      489    +3     
  Lines      33791    33863   +72     
  Branches    5502     5508    +6     
======================================
+ Hits       21408    21492   +84     
+ Misses     10342    10327   -15     
- Partials    2041     2044    +3     
Impacted Files Coverage Δ
src/platform/common/variables/types.ts 100% <ø> (ø)
...ommon/process/environmentActivationService.node.ts 72% <75%> (-1%) ⬇️
...riables/customEnvironmentVariablesProvider.node.ts 83% <90%> (+10%) ⬆️
src/kernels/raw/finder/jupyterPaths.node.ts 79% <100%> (+1%) ⬆️
.../kernels/raw/launcher/kernelEnvVarsService.node.ts 81% <100%> (+<1%) ⬆️
src/kernels/variables/preWarmVariables.node.ts 91% <100%> (+<1%) ⬆️
src/platform/common/process/processFactory.node.ts 90% <100%> (ø)
src/platform/common/net/httpClient.ts 77% <0%> (-12%) ⬇️
src/kernels/installer/productInstaller.node.ts 74% <0%> (-5%) ⬇️
src/kernels/raw/launcher/kernelProcess.node.ts 69% <0%> (-1%) ⬇️
... and 63 more

@DonJayamanne DonJayamanne merged commit 7b12956 into main Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

python.envFile is not respected by Python code executed in Notebook and IW
4 participants