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

Disabled backup service in extension tests can cause issues #52212

Closed
jrieken opened this issue Jun 18, 2018 · 4 comments
Closed

Disabled backup service in extension tests can cause issues #52212

jrieken opened this issue Jun 18, 2018 · 4 comments
Assignees
Labels
debt Code quality issues workspace-edit
Milestone

Comments

@jrieken
Copy link
Member

jrieken commented Jun 18, 2018

See https://github.com/Microsoft/vscode/blob/c93d5e7d9200d4839bd8718c39b577568ab3d78a/extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts#L556. The test fails because the document just contains AFTER not AFTERBEFORE

@bpasero
Copy link
Member

bpasero commented Jun 18, 2018

@jrieken this is because in order to preserve the contents of a model when renaming, I go through our backup service which happens to be disabled when running in a test environment. Once I remove this check for extensions, the test runs green:

https://github.com/Microsoft/vscode/blob/8be8f654687341db407086c7e277d80b7055e12a/src/vs/code/electron-main/windows.ts#L1141-L1149

@bpasero bpasero added the debt Code quality issues label Jun 18, 2018
@bpasero bpasero changed the title rename shouldn't revert dirty document Disabled backup service in extension tests can cause issues Jun 18, 2018
jrieken added a commit that referenced this issue Jun 19, 2018
@jrieken
Copy link
Member Author

jrieken commented Jun 19, 2018

@bpasero Is that backupPath something we can simply set to a temp-directory when running like this? Now, almost every extension test I wrote for the workspace edit is partially commented out which doesn't increase my confidence ;-)

@bpasero
Copy link
Member

bpasero commented Jun 19, 2018

@jrieken yeah I can look into providing a test-implementation that just operates in memory maybe.

@bpasero bpasero added this to the June 2018 milestone Jun 19, 2018
@bpasero
Copy link
Member

bpasero commented Jun 19, 2018

There is now an InMemoryBackupFileService whenever there is no backupPath configured.

@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues workspace-edit
Projects
None yet
Development

No branches or pull requests

2 participants