Skip to content

Validate Routes in Test Cases throwing an error if route is not specified when required#490

Open
goetas wants to merge 2 commits intomainfrom
validate-config
Open

Validate Routes in Test Cases throwing an error if route is not specified when required#490
goetas wants to merge 2 commits intomainfrom
validate-config

Conversation

@goetas
Copy link

@goetas goetas commented Jan 21, 2026

Validate Routes in Test Cases

Discovered in https://github.com/getyourguide/routes/pull/3029 , see (https://github.com/getyourguide/routes/pull/3029#discussion_r2704499904)

This pull request introduces validation to ensure that when simple routing is requested (with wantMatch set to false), a route must be provided in the test cases. Without a defined route, the parser now returns an explicit error.

Changes include:

  • Addition of an error constant ErrRouteRequiredForSimpleRouting to signal missing required routes.
  • Parser update to check that test cases either define a rewrite, redirect, delegate, or at least one route when wantMatch is false.
  • A new test file with test cases illustrating missing route scenarios.
  • Unit tests validating that missing routes cause parsing to fail appropriately.

This improves the robustness of configuration validation by enforcing necessary route definitions in test cases.

@goetas goetas changed the title Validate routes Validate Routes in Test Cases throwing an error if route is not specified when required Jan 21, 2026
@goetas goetas marked this pull request as ready for review January 21, 2026 09:01
@goetas goetas requested review from a team and gygrobot as code owners January 21, 2026 09:01
@goetas goetas requested a review from cainelli January 21, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant