Skip to content

Add error-path tests for WorkflowCompilationResource #5020

@Yicong-Huang

Description

@Yicong-Huang

Task Summary

workflow-compiling-service/src/test/scala/.../WorkflowCompilationResourceSpec.scala currently has a single happy-path test (filter + limit + projection chain compiles successfully). The service's compiler always runs in lenient mode — it accumulates per-operator errors and returns a WorkflowCompilationResult with physicalPlan = None when any error occurs — and that contract has no direct coverage today.

Add cases exercising the error paths the frontend depends on:

  • Scan source with no fileName set: resolveScanSourceOpFileName(Some(errorList)) should accumulate, not throw; response is WorkflowCompilationFailure with the scan op in operatorIdToError.
  • Schema mismatch (e.g. projection of a non-existent attribute): per-port schema reported as None, op present in operatorIdToError.
  • Python codegen #EXCEPTION DURING CODE GENERATION: regex path: error captured, compile does not throw.
  • REST response shape: failure cases serialize as WorkflowCompilationFailure JSON the frontend can parse.

These tests lock the lenient-mode contract before any refactor that consolidates this compiler with amber's copy.

Task Type

  • Testing / QA

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions