Skip to content

Bug: Deleting the fillet deletes the previous revolve as well #6842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/lang/modifyAst/addEdgeTreatment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@
await kclManager.executeAst({ ast })
const artifactGraph = kclManager.artifactGraph

expect(kclManager.errors).toEqual([])

Check failure on line 357 in src/lang/modifyAst/addEdgeTreatment.test.ts

View workflow job for this annotation

GitHub Actions / npm-unit-test

src/lang/modifyAst/addEdgeTreatment.test.ts > Testing modifyAstCloneWithEdgeTreatmentAndTag with fillets > should add a fillet with existing tag on other segment

AssertionError: expected [ …(1) ] to deeply equal [] - Expected + Received - [] + [ + KCLError { + "message": "engine: Failed to wait for promise from send modeling command: JsValue([Object({\"success\":false,\"errors\":[{\"error_code\":\"internal_api\",\"message\":\"{\\\"success\\\":false,\\\"errors\\\":[{\\\"message\\\":\\\"Force interrupt, executionIsStale, new AST requested\\\",\\\"error_code\\\":\\\"bad_request\\\"}]}\"}]})])", + "kind": "engine", + "sourceRange": [ + 0, + 0, + 0, + ], + "msg": "Failed to wait for promise from send modeling command: JsValue([Object({\"success\":false,\"errors\":[{\"error_code\":\"internal_api\",\"message\":\"{\\\"success\\\":false,\\\"errors\\\":[{\\\"message\\\":\\\"Force interrupt, executionIsStale, new AST requested\\\",\\\"error_code\\\":\\\"bad_request\\\"}]}\"}]})])", + "operations": [], + "artifactCommands": [], + "artifactGraph": Map {}, + "filenames": {}, + "defaultPlanes": null, + }, + ] ❯ runModifyAstCloneWithEdgeTreatmentAndTag src/lang/modifyAst/addEdgeTreatment.test.ts:357:29 ❯ src/lang/modifyAst/addEdgeTreatment.test.ts:588:9

Check failure on line 357 in src/lang/modifyAst/addEdgeTreatment.test.ts

View workflow job for this annotation

GitHub Actions / npm-unit-test

src/lang/modifyAst/addEdgeTreatment.test.ts > Testing modifyAstCloneWithEdgeTreatmentAndTag with fillets > should add a fillet to an already tagged segment

AssertionError: expected [ …(1) ] to deeply equal [] - Expected + Received - [] + [ + KCLError { + "message": "engine: Failed to wait for promise from send modeling command: JsValue([Object({\"success\":false,\"errors\":[{\"error_code\":\"internal_api\",\"message\":\"{\\\"success\\\":false,\\\"errors\\\":[{\\\"message\\\":\\\"Force interrupt, executionIsStale, new AST requested\\\",\\\"error_code\\\":\\\"bad_request\\\"}]}\"}]})])", + "kind": "engine", + "sourceRange": [ + 0, + 0, + 0, + ], + "msg": "Failed to wait for promise from send modeling command: JsValue([Object({\"success\":false,\"errors\":[{\"error_code\":\"internal_api\",\"message\":\"{\\\"success\\\":false,\\\"errors\\\":[{\\\"message\\\":\\\"Force interrupt, executionIsStale, new AST requested\\\",\\\"error_code\\\":\\\"bad_request\\\"}]}\"}]})])", + "operations": [], + "artifactCommands": [], + "artifactGraph": Map {}, + "filenames": {}, + "defaultPlanes": null, + }, + ] ❯ runModifyAstCloneWithEdgeTreatmentAndTag src/lang/modifyAst/addEdgeTreatment.test.ts:357:29 ❯ src/lang/modifyAst/addEdgeTreatment.test.ts:556:9

Check failure on line 357 in src/lang/modifyAst/addEdgeTreatment.test.ts

View workflow job for this annotation

GitHub Actions / npm-unit-test

src/lang/modifyAst/addEdgeTreatment.test.ts > Testing modifyAstCloneWithEdgeTreatmentAndTag with fillets > should add a fillet to the sketch pipe

AssertionError: expected [ …(1) ] to deeply equal [] - Expected + Received - [] + [ + KCLError { + "message": "engine: Failed to wait for promise from send modeling command: JsValue([Object({\"success\":false,\"errors\":[{\"error_code\":\"internal_api\",\"message\":\"{\\\"success\\\":false,\\\"errors\\\":[{\\\"message\\\":\\\"Force interrupt, executionIsStale, new AST requested\\\",\\\"error_code\\\":\\\"bad_request\\\"}]}\"}]})])", + "kind": "engine", + "sourceRange": [ + 0, + 0, + 0, + ], + "msg": "Failed to wait for promise from send modeling command: JsValue([Object({\"success\":false,\"errors\":[{\"error_code\":\"internal_api\",\"message\":\"{\\\"success\\\":false,\\\"errors\\\":[{\\\"message\\\":\\\"Force interrupt, executionIsStale, new AST requested\\\",\\\"error_code\\\":\\\"bad_request\\\"}]}\"}]})])", + "operations": [], + "artifactCommands": [], + "artifactGraph": Map {}, + "filenames": {}, + "defaultPlanes": null, + }, + ] ❯ runModifyAstCloneWithEdgeTreatmentAndTag src/lang/modifyAst/addEdgeTreatment.test.ts:357:29 ❯ src/lang/modifyAst/addEdgeTreatment.test.ts:524:9

Check failure on line 357 in src/lang/modifyAst/addEdgeTreatment.test.ts

View workflow job for this annotation

GitHub Actions / npm-unit-test

src/lang/modifyAst/addEdgeTreatment.test.ts > Testing modifyAstCloneWithEdgeTreatmentAndTag with fillets > should add a fillet to a specific segment

AssertionError: expected [ …(1) ] to deeply equal [] - Expected + Received - [] + [ + KCLError { + "message": "engine: Failed to wait for promise from send modeling command: JsValue([Object({\"success\":false,\"errors\":[{\"error_code\":\"internal_api\",\"message\":\"{\\\"success\\\":false,\\\"errors\\\":[{\\\"message\\\":\\\"Force interrupt, executionIsStale, new AST requested\\\",\\\"error_code\\\":\\\"bad_request\\\"}]}\"}]})])", + "kind": "engine", + "sourceRange": [ + 0, + 0, + 0, + ], + "msg": "Failed to wait for promise from send modeling command: JsValue([Object({\"success\":false,\"errors\":[{\"error_code\":\"internal_api\",\"message\":\"{\\\"success\\\":false,\\\"errors\\\":[{\\\"message\\\":\\\"Force interrupt, executionIsStale, new AST requested\\\",\\\"error_code\\\":\\\"bad_request\\\"}]}\"}]})])", + "operations": [], + "artifactCommands": [], + "artifactGraph": Map {}, + "filenames": {}, + "defaultPlanes": null, + }, + ] ❯ runModifyAstCloneWithEdgeTreatmentAndTag src/lang/modifyAst/addEdgeTreatment.test.ts:357:29 ❯ src/lang/modifyAst/addEdgeTreatment.test.ts:492:9

const selection: Selections = {
graphSelections: segmentRanges.map((segmentRange) => {
Expand Down Expand Up @@ -399,7 +399,7 @@
await kclManager.executeAst({ ast })
const artifactGraph = kclManager.artifactGraph

expect(kclManager.errors).toEqual([])

Check failure on line 402 in src/lang/modifyAst/addEdgeTreatment.test.ts

View workflow job for this annotation

GitHub Actions / npm-unit-test

src/lang/modifyAst/addEdgeTreatment.test.ts > Testing deleteEdgeTreatment with chamfers > should delete a non-piped chamfer from a body with multiple treatments

AssertionError: expected [ …(1) ] to deeply equal [] - Expected + Received - [] + [ + KCLError { + "message": "engine: Failed to wait for promise from send modeling command: JsValue([Object({\"success\":false,\"errors\":[{\"error_code\":\"internal_api\",\"message\":\"{\\\"success\\\":false,\\\"errors\\\":[{\\\"message\\\":\\\"Force interrupt, executionIsStale, new AST requested\\\",\\\"error_code\\\":\\\"bad_request\\\"}]}\"}]})])", + "kind": "engine", + "sourceRange": [ + 0, + 0, + 0, + ], + "msg": "Failed to wait for promise from send modeling command: JsValue([Object({\"success\":false,\"errors\":[{\"error_code\":\"internal_api\",\"message\":\"{\\\"success\\\":false,\\\"errors\\\":[{\\\"message\\\":\\\"Force interrupt, executionIsStale, new AST requested\\\",\\\"error_code\\\":\\\"bad_request\\\"}]}\"}]})])", + "operations": [], + "artifactCommands": [], + "artifactGraph": Map {}, + "filenames": {}, + "defaultPlanes": null, + }, + ] ❯ runDeleteEdgeTreatmentTest src/lang/modifyAst/addEdgeTreatment.test.ts:402:29 ❯ src/lang/modifyAst/addEdgeTreatment.test.ts:994:9

Check failure on line 402 in src/lang/modifyAst/addEdgeTreatment.test.ts

View workflow job for this annotation

GitHub Actions / npm-unit-test

src/lang/modifyAst/addEdgeTreatment.test.ts > Testing deleteEdgeTreatment with chamfers > should delete a piped chamfer from a body with multiple treatments

AssertionError: expected [ …(1) ] to deeply equal [] - Expected + Received - [] + [ + KCLError { + "message": "engine: Failed to wait for promise from send modeling command: JsValue([Object({\"success\":false,\"errors\":[{\"error_code\":\"internal_api\",\"message\":\"{\\\"success\\\":false,\\\"errors\\\":[{\\\"message\\\":\\\"Force interrupt, executionIsStale, new AST requested\\\",\\\"error_code\\\":\\\"bad_request\\\"}]}\"}]})])", + "kind": "engine", + "sourceRange": [ + 0, + 0, + 0, + ], + "msg": "Failed to wait for promise from send modeling command: JsValue([Object({\"success\":false,\"errors\":[{\"error_code\":\"internal_api\",\"message\":\"{\\\"success\\\":false,\\\"errors\\\":[{\\\"message\\\":\\\"Force interrupt, executionIsStale, new AST requested\\\",\\\"error_code\\\":\\\"bad_request\\\"}]}\"}]})])", + "operations": [], + "artifactCommands": [], + "artifactGraph": Map {}, + "filenames": {}, + "defaultPlanes": null, + }, + ] ❯ runDeleteEdgeTreatmentTest src/lang/modifyAst/addEdgeTreatment.test.ts:402:29 ❯ src/lang/modifyAst/addEdgeTreatment.test.ts:962:9

Check failure on line 402 in src/lang/modifyAst/addEdgeTreatment.test.ts

View workflow job for this annotation

GitHub Actions / npm-unit-test

src/lang/modifyAst/addEdgeTreatment.test.ts > Testing deleteEdgeTreatment with chamfers > should delete a non-piped chamfer tagged with getNextAdjacentEdge

AssertionError: expected [ …(1) ] to deeply equal [] - Expected + Received - [] + [ + KCLError { + "message": "engine: Failed to wait for promise from send modeling command: JsValue([Object({\"success\":false,\"errors\":[{\"error_code\":\"internal_api\",\"message\":\"{\\\"success\\\":false,\\\"errors\\\":[{\\\"message\\\":\\\"Force interrupt, executionIsStale, new AST requested\\\",\\\"error_code\\\":\\\"bad_request\\\"}]}\"}]})])", + "kind": "engine", + "sourceRange": [ + 0, + 0, + 0, + ], + "msg": "Failed to wait for promise from send modeling command: JsValue([Object({\"success\":false,\"errors\":[{\"error_code\":\"internal_api\",\"message\":\"{\\\"success\\\":false,\\\"errors\\\":[{\\\"message\\\":\\\"Force interrupt, executionIsStale, new AST requested\\\",\\\"error_code\\\":\\\"bad_request\\\"}]}\"}]})])", + "operations": [], + "artifactCommands": [], + "artifactGraph": Map {}, + "filenames": {}, + "defaultPlanes": null, + }, + ] ❯ runDeleteEdgeTreatmentTest src/lang/modifyAst/addEdgeTreatment.test.ts:402:29 ❯ src/lang/modifyAst/addEdgeTreatment.test.ts:929:9

Check failure on line 402 in src/lang/modifyAst/addEdgeTreatment.test.ts

View workflow job for this annotation

GitHub Actions / npm-unit-test

src/lang/modifyAst/addEdgeTreatment.test.ts > Testing deleteEdgeTreatment with chamfers > should delete a piped chamfer tagged with getOppositeEdge

AssertionError: expected [ …(1) ] to deeply equal [] - Expected + Received - [] + [ + KCLError { + "message": "engine: Failed to wait for promise from send modeling command: JsValue([Object({\"success\":false,\"errors\":[{\"error_code\":\"internal_api\",\"message\":\"{\\\"success\\\":false,\\\"errors\\\":[{\\\"message\\\":\\\"Force interrupt, executionIsStale, new AST requested\\\",\\\"error_code\\\":\\\"bad_request\\\"}]}\"}]})])", + "kind": "engine", + "sourceRange": [ + 0, + 0, + 0, + ], + "msg": "Failed to wait for promise from send modeling command: JsValue([Object({\"success\":false,\"errors\":[{\"error_code\":\"internal_api\",\"message\":\"{\\\"success\\\":false,\\\"errors\\\":[{\\\"message\\\":\\\"Force interrupt, executionIsStale, new AST requested\\\",\\\"error_code\\\":\\\"bad_request\\\"}]}\"}]})])", + "operations": [], + "artifactCommands": [], + "artifactGraph": Map {}, + "filenames": {}, + "defaultPlanes": null, + }, + ] ❯ runDeleteEdgeTreatmentTest src/lang/modifyAst/addEdgeTreatment.test.ts:402:29 ❯ src/lang/modifyAst/addEdgeTreatment.test.ts:903:9

Check failure on line 402 in src/lang/modifyAst/addEdgeTreatment.test.ts

View workflow job for this annotation

GitHub Actions / npm-unit-test

src/lang/modifyAst/addEdgeTreatment.test.ts > Testing deleteEdgeTreatment with chamfers > should delete a standalone chamfer without assignment from a single segment

AssertionError: expected [ …(1) ] to deeply equal [] - Expected + Received - [] + [ + KCLError { + "message": "engine: Failed to wait for promise from send modeling command: JsValue([Object({\"success\":false,\"errors\":[{\"error_code\":\"internal_api\",\"message\":\"{\\\"success\\\":false,\\\"errors\\\":[{\\\"message\\\":\\\"Force interrupt, executionIsStale, new AST requested\\\",\\\"error_code\\\":\\\"bad_request\\\"}]}\"}]})])", + "kind": "engine", + "sourceRange": [ + 318, + 385, + 0, + ], + "msg": "Failed to wait for promise from send modeling command: JsValue([Object({\"success\":false,\"errors\":[{\"error_code\":\"internal_api\",\"message\":\"{\\\"success\\\":false,\\\"errors\\\":[{\\\"message\\\":\\\"Force interrupt, executionIsStale, new AST requested\\\",\\\"error_code\\\":\\\"bad_request\\\"}]}\"}]})])", + "operations": [ + { + "labeledArgs": {}, + "name": "startSketchOn", + "sourceRange": [ + 12, + 29, + 0, + ], + "type": "StdLibCall", + "unlabeledArg": { + "sourceRange": [ + 26, + 28, + 0, + ], + "value": { + "artifact_id": "400a2ed4-52ae-5786-967d-7fdba1bd0850", + "type": "Plane", + }, + }, + }, + { + "labeledArgs": { + "angle": { + "sourceRange": [ + 298, + 301, + 0, + ], + "value": { + "ty": { + "angle": { + "type": "Degrees", + }, + "len": { + "type": "Mm", + }, + "type": "Default", + }, + "type": "Number", + "value": 360, + }, + }, + "axis": { + "sourceRange": [ + 310, + 311, + 0, + ], + "value": { + "type": "Object", + "value": { + "direction": { + "type": "Array", + "value": [ + { + "ty": { + "angle": { + "type": "Degrees", + }, + "len": { + "type": "Mm", + }, + "type": "Default", + }, + "type": "Number", + "value": 0, + }, + { + "ty": { + "angle": { + "type": "Degrees", + }, + "len": { + "type": "Mm", + }, + "type": "Default", + }, + "type": "Number", + "value": 1, + }, + ], + }, + "origin": { + "type": "Array", + "value": [ + { + "ty": { + "angle": { + "type": "Degrees", + }, + "len": { + "type": "Mm", + }, + "type": "Default", + }, + "type": "Number", + "value": 0, + }, + { + "ty": { + "angle": { + "type": "Degrees", + }, + "len": { + "type": "Mm", + }, + "type": "Default", + }, + "t

// define snippet range
const edgeTreatmentRange = topLevelRange(
Expand Down Expand Up @@ -801,6 +801,32 @@
expectedCode
)
}, 10_000)
it(`should delete a piped ${edgeTreatmentType} from a revolve`, async () => {

Check failure on line 804 in src/lang/modifyAst/addEdgeTreatment.test.ts

View workflow job for this annotation

GitHub Actions / npm-unit-test

src/lang/modifyAst/addEdgeTreatment.test.ts > Testing deleteEdgeTreatment with chamfers > should delete a piped chamfer from a revolve

Error: Test timed out in 10000ms. If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout". ❯ src/lang/modifyAst/addEdgeTreatment.test.ts:804:7
const code = `sketch001 = startSketchOn(XY)
profile001 = startProfile(sketch001, at = [8, -6])
|> yLine(length = 12)
|> xLine(length = 16)
|> yLine(length = -12, tag = $seg01)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|> close()
revolve001 = revolve(profile001, angle = 360, axis = Y)
|> ${edgeTreatmentType}(${parameterName} = 5, tags = [getCommonEdge(faces = [seg01, seg02])])`
const edgeTreatmentSnippet = `${edgeTreatmentType}(${parameterName} = 5, tags = [getCommonEdge(faces = [seg01, seg02])])`
const expectedCode = `sketch001 = startSketchOn(XY)
profile001 = startProfile(sketch001, at = [8, -6])
|> yLine(length = 12)
|> xLine(length = 16)
|> yLine(length = -12, tag = $seg01)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|> close()
revolve001 = revolve(profile001, angle = 360, axis = Y)`

await runDeleteEdgeTreatmentTest(
code,
edgeTreatmentSnippet,
expectedCode
)
}, 10_000)
it(`should delete a standalone assigned ${edgeTreatmentType} from a single segment`, async () => {
const code = `sketch001 = startSketchOn(XY)
|> startProfile(at = [-10, 10])
Expand Down
Loading