Undo kclSamplesInputPath approach.
Instead, just add a second reliable executor input file to use.
This commit is contained in:
@ -2,7 +2,7 @@ import { test, expect } from './zoo-test'
|
||||
import {
|
||||
orRunWhenFullSuiteEnabled,
|
||||
getUtils,
|
||||
kclSamplesInputPath,
|
||||
executorInputPath,
|
||||
} from './test-utils'
|
||||
import { join } from 'path'
|
||||
import { bracket } from 'lib/exampleKcl'
|
||||
@ -250,11 +250,11 @@ test(
|
||||
])
|
||||
await Promise.all([
|
||||
fsp.copyFile(
|
||||
kclSamplesInputPath(['ball-bearing', 'main.kcl']),
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
join(routerTemplateDir, 'main.kcl')
|
||||
),
|
||||
fsp.copyFile(
|
||||
kclSamplesInputPath(['flange', 'main.kcl']),
|
||||
executorInputPath('e2e-can-sketch-on-chamfer.kcl'),
|
||||
join(bracketDir, 'main.kcl')
|
||||
),
|
||||
])
|
||||
|
@ -4,7 +4,6 @@ import {
|
||||
getUtils,
|
||||
executorInputPath,
|
||||
getPlaywrightDownloadDir,
|
||||
kclSamplesInputPath,
|
||||
} from './test-utils'
|
||||
import fsp from 'fs/promises'
|
||||
|
||||
@ -21,11 +20,11 @@ test(
|
||||
await Promise.all([fsp.mkdir(bracketDir, { recursive: true })])
|
||||
await Promise.all([
|
||||
fsp.copyFile(
|
||||
kclSamplesInputPath(['flange', 'main.kcl']),
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
path.join(bracketDir, 'other.kcl')
|
||||
),
|
||||
fsp.copyFile(
|
||||
kclSamplesInputPath(['ball-bearing', 'main.kcl']),
|
||||
executorInputPath('e2e-can-sketch-on-chamfer.kcl'),
|
||||
path.join(bracketDir, 'main.kcl')
|
||||
),
|
||||
])
|
||||
@ -108,7 +107,7 @@ test(
|
||||
},
|
||||
{ timeout: 15_000 }
|
||||
)
|
||||
.toBeGreaterThan(300_000)
|
||||
.toBeGreaterThan(30_000)
|
||||
})
|
||||
})
|
||||
|
||||
@ -188,7 +187,7 @@ test(
|
||||
},
|
||||
{ timeout: 15_000 }
|
||||
)
|
||||
.toBeGreaterThan(70_000)
|
||||
.toBeGreaterThan(50_000)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { test, expect } from './zoo-test'
|
||||
import { executorInputPath, kclSamplesInputPath } from './test-utils'
|
||||
import { executorInputPath } from './test-utils'
|
||||
import { join } from 'path'
|
||||
import fsp from 'fs/promises'
|
||||
|
||||
@ -11,7 +11,7 @@ test(
|
||||
const bracketDir = join(dir, 'bracket')
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
await fsp.copyFile(
|
||||
kclSamplesInputPath(['flange', 'main.kcl']),
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
join(bracketDir, 'main.kcl')
|
||||
)
|
||||
})
|
||||
@ -51,7 +51,7 @@ test(
|
||||
const bracketDir = join(dir, 'bracket')
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
await fsp.copyFile(
|
||||
kclSamplesInputPath(['flange', 'main.kcl']),
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
join(bracketDir, 'main.kcl')
|
||||
)
|
||||
})
|
||||
|
@ -8,7 +8,6 @@ import {
|
||||
createProject,
|
||||
getPlaywrightDownloadDir,
|
||||
orRunWhenFullSuiteEnabled,
|
||||
kclSamplesInputPath,
|
||||
} from './test-utils'
|
||||
import fsp from 'fs/promises'
|
||||
import fs from 'fs'
|
||||
@ -87,7 +86,7 @@ test(
|
||||
const bracketDir = path.join(dir, 'bracket')
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
await fsp.copyFile(
|
||||
kclSamplesInputPath(['flange', 'main.kcl']),
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
path.join(bracketDir, 'main.kcl')
|
||||
)
|
||||
})
|
||||
@ -124,7 +123,7 @@ test(
|
||||
const bracketDir = path.join(dir, 'bracket')
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
await fsp.copyFile(
|
||||
kclSamplesInputPath(['flange', 'main.kcl']),
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
path.join(bracketDir, 'main.kcl')
|
||||
)
|
||||
const errorDir = path.join(dir, 'broken-code')
|
||||
@ -213,7 +212,7 @@ test(
|
||||
const bracketDir = path.join(dir, 'bracket')
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
await fsp.copyFile(
|
||||
kclSamplesInputPath(['flange', 'main.kcl']),
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
path.join(bracketDir, 'main.kcl')
|
||||
)
|
||||
const emptyDir = path.join(dir, 'empty')
|
||||
@ -290,7 +289,7 @@ test(
|
||||
const bracketDir = path.join(dir, 'bracket')
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
await fsp.copyFile(
|
||||
kclSamplesInputPath(['flange', 'main.kcl']),
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
path.join(bracketDir, 'main.kcl')
|
||||
)
|
||||
|
||||
@ -356,7 +355,7 @@ test(
|
||||
const bracketDir = path.join(dir, 'bracket')
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
await fsp.copyFile(
|
||||
kclSamplesInputPath(['flange', 'main.kcl']),
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
path.join(bracketDir, 'main.kcl')
|
||||
)
|
||||
await fsp.copyFile(
|
||||
@ -475,7 +474,7 @@ test.describe('Can export from electron app', () => {
|
||||
const bracketDir = path.join(dir, 'bracket')
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
await fsp.copyFile(
|
||||
kclSamplesInputPath(['flange', 'main.kcl']),
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
path.join(bracketDir, 'main.kcl')
|
||||
)
|
||||
})
|
||||
|
@ -4,9 +4,9 @@ import path from 'path'
|
||||
import * as fsp from 'fs/promises'
|
||||
import {
|
||||
getUtils,
|
||||
kclSamplesInputPath,
|
||||
TEST_COLORS,
|
||||
TestColor,
|
||||
executorInputPath,
|
||||
orRunWhenFullSuiteEnabled,
|
||||
} from './test-utils'
|
||||
import { TEST_CODE_TRIGGER_ENGINE_EXPORT_ERROR } from './storageStates'
|
||||
@ -582,7 +582,7 @@ extrude002 = extrude(profile002, length = 150)
|
||||
const bracketDir = path.join(dir, 'bracket')
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
await fsp.copyFile(
|
||||
kclSamplesInputPath(['flange', 'main.kcl']),
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
path.join(bracketDir, 'main.kcl')
|
||||
)
|
||||
})
|
||||
@ -685,7 +685,7 @@ extrude002 = extrude(profile002, length = 150)
|
||||
const legoDir = path.join(dir, 'lego')
|
||||
await fsp.mkdir(legoDir, { recursive: true })
|
||||
await fsp.copyFile(
|
||||
kclSamplesInputPath(['ball-bearing', 'main.kcl']),
|
||||
executorInputPath('e2e-can-sketch-on-chamfer.kcl'),
|
||||
path.join(legoDir, 'main.kcl')
|
||||
)
|
||||
})
|
||||
|
@ -1007,10 +1007,6 @@ export function executorInputPath(fileName: string): string {
|
||||
return path.join('rust', 'kcl-lib', 'e2e', 'executor', 'inputs', fileName)
|
||||
}
|
||||
|
||||
export function kclSamplesInputPath(samplePathSegments: string[]): string {
|
||||
return path.join('public', 'kcl-samples', ...samplePathSegments)
|
||||
}
|
||||
|
||||
export async function doAndWaitForImageDiff(
|
||||
page: Page,
|
||||
fn: () => Promise<unknown>,
|
||||
|
@ -8,7 +8,6 @@ import {
|
||||
tomlToSettings,
|
||||
TEST_COLORS,
|
||||
orRunWhenFullSuiteEnabled,
|
||||
kclSamplesInputPath,
|
||||
} from './test-utils'
|
||||
import { SettingsLevel } from 'lib/settings/settingsTypes'
|
||||
import { SETTINGS_FILE_NAME, PROJECT_SETTINGS_FILE_NAME } from 'lib/constants'
|
||||
@ -272,7 +271,7 @@ test.describe('Testing settings', () => {
|
||||
const bracketDir = join(dir, projectName)
|
||||
await fsp.mkdir(bracketDir, { recursive: true })
|
||||
await fsp.copyFile(
|
||||
kclSamplesInputPath(['flange', 'main.kcl']),
|
||||
executorInputPath('cylinder-inches.kcl'),
|
||||
join(bracketDir, 'main.kcl')
|
||||
)
|
||||
}
|
||||
|
4
rust/kcl-lib/e2e/executor/inputs/cylinder-inches.kcl
Normal file
4
rust/kcl-lib/e2e/executor/inputs/cylinder-inches.kcl
Normal file
@ -0,0 +1,4 @@
|
||||
@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn(XZ)
|
||||
|> circle(center = [0, 0], radius = 20)
|
||||
extrude001 = extrude(sketch001, length = 10)
|
Reference in New Issue
Block a user