Unverified Commit a0ba5450 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

exclude test files from copy in trace-next-server (#28819)

parent 4141aaef
...@@ -21,10 +21,16 @@ async function main() { ...@@ -21,10 +21,16 @@ async function main() {
const origRepoDir = path.join(__dirname, '..') const origRepoDir = path.join(__dirname, '..')
const repoDir = path.join(tmpdir, `tmp-next-${Date.now()}`) const repoDir = path.join(tmpdir, `tmp-next-${Date.now()}`)
const workDir = path.join(tmpdir, `trace-next-${Date.now()}`) const workDir = path.join(tmpdir, `trace-next-${Date.now()}`)
const origTestDir = path.join(origRepoDir, 'test')
const dotDir = path.join(origRepoDir, './') + '.'
await fs.copy(origRepoDir, repoDir, { await fs.copy(origRepoDir, repoDir, {
filter: (item) => { filter: (item) => {
return !item.includes('node_modules') return (
!item.startsWith(origTestDir) &&
!item.startsWith(dotDir) &&
!item.includes('node_modules')
)
}, },
}) })
...@@ -88,7 +94,7 @@ async function main() { ...@@ -88,7 +94,7 @@ async function main() {
if (result.reasons[file].type === 'initial') { if (result.reasons[file].type === 'initial') {
continue continue
} }
tracedDeps.add(file) tracedDeps.add(file.replace(/\\/g, '/'))
const stat = await fs.stat(path.join(workDir, file)) const stat = await fs.stat(path.join(workDir, file))
if (stat.isFile()) { if (stat.isFile()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment