see https://github.com/jmcgeheeiv/pyfakefs This has a bunch of advantages over our current FileSystemMock: Avoids us having to maintain our own re-implementation (which currently has a variety of issues) Can configure it to emulate Windows/Linux/macOS behaviour on other systems, allowing us to test things still work on Windows more easily Provides a path away from our current FileSystem class towards using the standard library functions directly
<rdar://problem/87785236>
Created attachment 450272 [details] Patch
Comment on attachment 450272 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=450272&action=review > Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder_legacy_unittest.py:57 > + self.setUpPyfakefs() I agree that using pyfakefs through the TestCaseMixin is the right thing to do for this class. I'm curious if you looked at the Patcher and considered it at all? Or was the Mixin just the natural choice because this particular set of tests was already using setup.
Comment on attachment 450272 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=450272&action=review >> Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder_legacy_unittest.py:57 >> + self.setUpPyfakefs() > > I agree that using pyfakefs through the TestCaseMixin is the right thing to do for this class. I'm curious if you looked at the Patcher and considered it at all? Or was the Mixin just the natural choice because this particular set of tests was already using setup. Using Patcher requires reimplementing a lot of the TestCaseMixin machinery for very little gain.
Committed r288878 (246630@main): <https://commits.webkit.org/246630@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 450272 [details].