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

Refactor the apisix route validation test function #1824

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

afzal442
Copy link

@afzal442 afzal442 commented May 3, 2023

Type of change:

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches
  • Documentation
  • Refactor
  • Chore
  • CI/CD or Tests

What this PR does / why we need it:

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

Signed-off-by: afzal442 <afzal442@gmail.com>
@afzal442
Copy link
Author

afzal442 commented May 3, 2023

After testing it's got

=== RUN   TestValidateApisixRouteV2/validating_is_failed_due_to_unknown_plugin_name
2023-05-03T07:25:52Z    error   validation/utils.go:105 failed to get the schema of plugin Not-A-Plugin: can't find the plugin schema
--- PASS: TestValidateApisixRouteV2 (0.00s)
    --- PASS: TestValidateApisixRouteV2/validating_is_successes (0.00s)
    --- PASS: TestValidateApisixRouteV2/validating_is_failed_due_to_missing_required_fields (0.00s)
    --- PASS: TestValidateApisixRouteV2/validating_is_failed_due_to_invalid_break_response_code (0.00s)
    --- PASS: TestValidateApisixRouteV2/validating_is_failed_due_to_invalid_max_breaker_sec (0.00s)
    --- PASS: TestValidateApisixRouteV2/validating_is_failed_due_to_unknown_plugin_name (0.00s)
--- PASS: TestValidateApisixRouteHTTPV2 (0.00s)
    --- PASS: TestValidateApisixRouteHTTPV2/validating_is_successes (0.00s)
    --- PASS: TestValidateApisixRouteHTTPV2/validating_is_failed_due_to_missing_required_fields (0.00s)
    --- PASS: TestValidateApisixRouteHTTPV2/validating_is_failed_due_to_invalid_break_response_code (0.00s)
    --- PASS: TestValidateApisixRouteHTTPV2/validating_is_failed_due_to_invalid_max_breaker_sec (0.00s)
    --- PASS: TestValidateApisixRouteHTTPV2/validating_is_failed_due_to_unknown_plugin_name (0.00s)

@afzal442
Copy link
Author

afzal442 commented May 8, 2023

hi @tao12345666333 as a reminder, if you get time, you can review it. TY 🧷

@afzal442
Copy link
Author

afzal442 commented May 9, 2023

Sorry @tao12345666333 ! are those tests failing related to this PR?

@tao12345666333
Copy link
Member

Sorry for the delay. Could you please resolve the conflicts?

…func

Signed-off-by: afzal442 <afzal442@gmail.com>
Signed-off-by: afzal442 <afzal442@gmail.com>
@afzalbin64
Copy link

@tao12345666333 can you review it as conflicts resolved?

@tao12345666333 tao12345666333 added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Jun 29, 2023
@lingsamuel
Copy link
Member

I don't see any need for this PR. The new test function name doesn't match the content.
Can you explain why we need such change?

@afzal442
Copy link
Author

The new test function name doesn't match the content.

Sorry I couldn't get it. but I think the new test function name matches as you can see its original file.

@zll600
Copy link
Contributor

zll600 commented Jan 22, 2024

The new test function name doesn't match the content.

Sorry I couldn't get it. but I think the new test function name matches as you can see its original file.

Could you explain in detail why this PR is needed? I think the original one is good enough. Because

  • The test function did not use global variables.
  • The name of test function matches the its original file.

@afzal442
Copy link
Author

afzal442 commented Jan 22, 2024

@zll600 I am not able to understand you. what is the issue with this function TestValidateApisixRouteV2(t *testing.T) ?

The test function did not use global variables.

What do yoi mean? In the future if you need to add or rmv test cases, what will yoiu do?

This latest one is much easier to read than original one. Let me know. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/test triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

None yet

5 participants