Skip to content

e2e: broken overlay DSL syntax should produce a clear error message and exit 1, not crash #10

Description

@Anand-rahul

What is missing

Every e2e spec installs a valid .graph-harness/overlay/*.gh file. There is no spec that tests what happens when an overlay file contains a syntax error.

Any real deployment will eventually have a typo in an overlay. The DSL parser must emit a human-readable error naming the file, exit non-zero, and never panic.

Proposed test

Fixture: go-module-empty (no extraction needed — just test the error path)

setup:
  - name: install_broken_overlay
    command: |
      mkdir -p .graph-harness/overlay
      printf 'selector BadSyntax {\n  anchor unknowntype "foo"\n}\n' \
        > .graph-harness/overlay/broken.gh

steps:
  - name: broken_overlay_exits_nonzero_with_clear_error
    command: graph-harness selectors test BadSyntax
    assert:
      - { type: exit_code, expected: 1 }
      - { type: contains, value: "broken.gh" }
      - { type: not_contains, value: "panic" }
      - { type: not_contains, value: "runtime error" }

Spec location: tests/e2e/specs/selectors/broken-overlay-reports-clear-error.yaml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions