Commit 911129b
Fix MockFileSystem temp path mismatch in write-scope methods
MockFileSystem on non-Windows returns a hardcoded Unix-ified path ('/temp/')
for GetTempPath() — it unixifies 'C:\temp' rather than calling
System.IO.Path.GetTempPath(). This diverges from the real API which reads
TMPDIR. AllowedSpecialFolder.Temp in the ValidationContext uses the real
System.IO.Path.GetTempPath() (resolves to '/tmp/' on standard Linux), creating
a mismatch: the scope allows '/tmp/' but the mock FS creates staging paths
at '/temp/zzyysk35.wbk'.
Fix: ScopeCurrentWorkingDirectoryForWrite and ScopeSourceDirectoryForWrite
now call inner.Path.GetTempPath() on non-Windows and add the result as an
explicit scope root alongside AllowedSpecialFolders.Temp. This covers both
the real OS temp ('/tmp/' via AllowedSpecialFolders) and the mock's hardcoded
path ('/temp/' via the explicit root), without relaxing permissions on Windows
where MockFileSystem temp is consistent with the real API.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>1 parent 0eaf884 commit 911129b
2 files changed
Lines changed: 28 additions & 10 deletions
File tree
- src/Elastic.Documentation.Configuration
- tests-integration/Elastic.Assembler.IntegrationTests
Lines changed: 25 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
104 | 126 | | |
105 | 127 | | |
106 | 128 | | |
107 | 129 | | |
108 | 130 | | |
109 | 131 | | |
110 | | - | |
| 132 | + | |
| 133 | + | |
111 | 134 | | |
112 | 135 | | |
113 | 136 | | |
| |||
128 | 151 | | |
129 | 152 | | |
130 | 153 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
| 154 | + | |
137 | 155 | | |
138 | 156 | | |
139 | 157 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| |||
0 commit comments