Skip to content

Create python file with random names for testing refactoring#966

Merged
DonJayamanne merged 2 commits into
microsoft:masterfrom
DonJayamanne:issue964
Mar 6, 2018
Merged

Create python file with random names for testing refactoring#966
DonJayamanne merged 2 commits into
microsoft:masterfrom
DonJayamanne:issue964

Conversation

@DonJayamanne
Copy link
Copy Markdown

Fixes #964

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 6, 2018

Codecov Report

Merging #966 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #966      +/-   ##
==========================================
- Coverage   64.02%   64.01%   -0.01%     
==========================================
  Files         260      260              
  Lines       12027    12027              
  Branches     2130     2130              
==========================================
- Hits         7700     7699       -1     
- Misses       4318     4319       +1     
  Partials        9        9
Impacted Files Coverage Δ
...reter/locators/services/cacheableLocatorService.ts 91.83% <0%> (-2.05%) ⬇️

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 a44c255...386611b. Read the comment docs.

Copy link
Copy Markdown

@ericsnowcurrently ericsnowcurrently left a comment

Choose a reason for hiding this comment

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

LGTM

The duplicated code makes me want to suggest factoring a common base or fixture to share. However, I'll resist. :)

Comment thread src/test/initialize.ts
PythonSettings.dispose();
}

export async function wait(timeoutMilliseconds: number) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

hurray for ripping out code! :)

const EXTENSION_DIR = path.join(__dirname, '..', '..', '..');
const refactorSourceFile = path.join(__dirname, '..', '..', '..', 'src', 'test', 'pythonFiles', 'refactoring', 'standAlone', 'refactor.py');
const refactorTargetFile = path.join(__dirname, '..', '..', '..', 'out', 'test', 'pythonFiles', 'refactoring', 'standAlone', 'refactor.py');
const refactorTargetFileDir = path.join(__dirname, '..', '..', '..', 'out', 'test', 'pythonFiles', 'refactoring', 'standAlone');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

or refactorTargetDir?

await wait(500);
fs.unlinkSync(refactorTargetFile);
}
initializeDI();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why once per test rather than once per suite?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Each test needs it's own setup,

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Things could change during the test run, changes in the environment

@DonJayamanne DonJayamanne merged commit 951ceda into microsoft:master Mar 6, 2018
@DonJayamanne DonJayamanne deleted the issue964 branch March 15, 2018 17:59
@lock lock Bot locked as resolved and limited conversation to collaborators Jul 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix AppVeyor unit tests for code refactoring

2 participants