Skip to content
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

[TT-1608] Parrot Wildcards #1610

Closed
wants to merge 6 commits into from
Closed

[TT-1608] Parrot Wildcards #1610

wants to merge 6 commits into from

Conversation

kalverra
Copy link
Collaborator

@kalverra kalverra commented Jan 29, 2025

  • Adds the ability to use path wildcards, e.g. /wildcard/* and /partial*/wildcard
  • Improves benchmarking accuracy
  • Adds the ability to match a route to any different method type

Below is a summarization created by an LLM (gpt-4-0125-preview). Be mindful of hallucinations and verify accuracy.

Why

The changes introduce deprecation notices for Killgrave and MockServer in favor of transitioning to Parrot. Additionally, it enhances Parrot with wildcard route support, performance benchmarking adjustments, and improved documentation. The introduction of the cage structure within Parrot is to manage routes and sub-routes effectively, allowing for dynamic and wildcard routing capabilities. These updates aim to streamline testing frameworks and improve the flexibility and performance of route handling in tests.

What

  • lib/docker/test_env/killgrave.go
    • Deprecated Killgrave struct and NewKillgrave function. Encourages transition to Parrot.
  • lib/docker/test_env/mockserver.go
    • Deprecated MockServer struct. Advises moving to Parrot.
  • parrot/.changeset/v0.2.0.md
    • Added details about new version features like wildcard routing and performance benchmarks.
  • parrot/Makefile
    • Simplified by removing redundant environment variable settings.
  • parrot/README.md
    • Updated feature list and clarified usage instructions.
  • parrot/cage.go
    • Introduced cage and cageLevel structures for handling routes and sub-routes, including wildcard support.
  • parrot/cage_test.go
    • Added tests for the new cage structure, verifying route handling capabilities.
  • parrot/cmd/main.go
    • Streamlined recorder registration in the main application logic.
  • parrot/errors.go
    • Added ErrCageNotFound for missing sub-route errors.
  • parrot/examples_test.go
    • Updated examples to reflect the ability to handle wildcard routes.
  • parrot/parrot.go
    • Major refactor to use the cage structure for route management. Deprecated direct route map usage.
  • parrot/parrot_benchmark_test.go
    • Added benchmarks for registering and responding to wildcard routes.
  • parrot/parrot_test.go
    • Expanded testing to cover new wildcard and method-any route features.

@kalverra kalverra requested review from sebawo and a team as code owners January 29, 2025 01:27
@kalverra kalverra changed the title Parrot Wildcards [TT-1608] Parrot Wildcards Jan 29, 2025
@cl-sonarqube-production
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
12.0% Duplication on New Code (required ≤ 5%)

See analysis details on SonarQube

@kalverra kalverra closed this Jan 31, 2025
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