microsoft / microsoft/VFSForGit
Accessor methods should not change machine state
Open
Nobody has claimed this yet.
affects: tests
pr: refactoring
- Dominant language
- C#
- Stars
- 6.1k
- Forks
- 474
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 8
Description
Enlistment.GetNewLogFileName(logsRoot) method checks whether the logsRoot exists and if not tries to create it.
This causes un-desired side effects when logsRoot is a Mock path and cause UT of classes (like ProductUpgrader) which uses this method to fail.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at Enlistment.GetNewLogFileName(logsRoot) and inspect how it checks and creates the logsRoot path. Use the ProductUpgrader unit tests as the relevant validation; done means accessor use with a mock path causes no filesystem changes and those tests no longer fail.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100