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

fix: supports search by name for service options when add router. #2066

Merged
merged 5 commits into from
Sep 19, 2021
Merged

fix: supports search by name for service options when add router. #2066

merged 5 commits into from
Sep 19, 2021

Conversation

TkClark
Copy link
Contributor

@TkClark TkClark commented Aug 12, 2021

  1. Web ui supports search by name for service options when add router.
  2. fix: When use the dashboard ui the priority of the route cann't be set if the upstream is not set when the route is set.

2. fixed the bug where the priority of the route cann't be set if the upstream is not set when the route is set.
@netlify
Copy link

netlify bot commented Aug 12, 2021

✔️ Deploy Preview for apisix-dashboard ready!

🔨 Explore the source changes: 5e59e0a

🔍 Inspect the deploy log: https://app.netlify.com/sites/apisix-dashboard/deploys/6136e5f672b2b800088da576

😎 Browse the preview: https://deploy-preview-2066--apisix-dashboard.netlify.app/

@codecov-commenter
Copy link

codecov-commenter commented Aug 23, 2021

Codecov Report

Merging #2066 (80861ae) into master (79012fd) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2066      +/-   ##
==========================================
+ Coverage   67.48%   67.52%   +0.04%     
==========================================
  Files         126      126              
  Lines        3294     3295       +1     
  Branches      802      802              
==========================================
+ Hits         2223     2225       +2     
+ Misses       1071     1070       -1     
Flag Coverage Δ
frontend-e2e-test 67.52% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
web/src/pages/Route/transform.ts 78.68% <ø> (ø)
web/src/pages/Route/components/Step1/MetaView.tsx 100.00% <100.00%> (ø)
...omponents/Upstream/components/UpstreamSelector.tsx 100.00% <0.00%> (+20.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 79012fd...80861ae. Read the comment docs.

@liuxiran
Copy link
Contributor

liuxiran commented Aug 23, 2021

Hi @TkClark , would you please add test case for your bug fix?

for example, create a Route with service and priority=1, and then check in the configure view to see if the priority field is 1

thanks very much.

and I would be better to change your commit message to some thing like:

fix: xxxxx.

thanks very much.

@TkClark TkClark changed the title supports search by name for service options when add router. fix bug fix: supports search by name for service options when add router. Sep 7, 2021
@TkClark
Copy link
Contributor Author

TkClark commented Sep 7, 2021

Hi @TkClark , would you please add test case for your bug fix?

for example, create a Route with service and priority=1, and then check in the configure view to see if the priority field is 1

thanks very much.

and I would be better to change your commit message to some thing like:

fix: xxxxx.

thanks very much.

just fixed the frontend bugs. And i don't see the test of react frontend

@liuxiran liuxiran added this to the 2.9 milestone Sep 8, 2021
@liuxiran
Copy link
Contributor

liuxiran commented Sep 8, 2021

Thanks for your feedback @TkClark , then let's turn to the test cases. Here is our fe e2e test develop guide, hope this can help you to write and debug your test cases.

Actually your pr contains two part of things:

feat: supports search by name for service options when add router

you can choose to start a new test file to add your test cases for this feature.

  1. create a service, you can refer this one:
  2. create a route, you can refer this one:
    it.only('should not create route with name above 100 characters', function () {

    during create a route, you can add some test code to cover you feature:
    file in the service field(part of your created service name), to check if there is a service item listed.

fix: would not set priority when create route

you can add some test codes to this file: https://github.com/apache/apisix-dashboard/blob/master/web/cypress/integration/route/create-edit-duplicate-delete-route.spec.js

  1. when create a route in
    try to file in the priority field together with other fields.
  2. when view a route in
    try to check if the priority field existed
  3. when edit a route in
    try to check if the priority has the right value, you can refer this one cy.get({priority}).should('have.value', xxxx)

@TkClark
Copy link
Contributor Author

TkClark commented Sep 10, 2021

Thanks for your feedback @TkClark , then let's turn to the test cases. Here is our fe e2e test develop guide, hope this can help you to write and debug your test cases.

Actually your pr contains two part of things:

feat: supports search by name for service options when add router

you can choose to start a new test file to add your test cases for this feature.

  1. create a service, you can refer this one:

  2. create a route, you can refer this one:

    it.only('should not create route with name above 100 characters', function () {

    during create a route, you can add some test code to cover you feature:
    file in the service field(part of your created service name), to check if there is a service item listed.

fix: would not set priority when create route

you can add some test codes to this file: https://github.com/apache/apisix-dashboard/blob/master/web/cypress/integration/route/create-edit-duplicate-delete-route.spec.js

  1. when create a route in

    try to file in the priority field together with other fields.

  2. when view a route in

    try to check if the priority field existed

  3. when edit a route in

    try to check if the priority has the right value, you can refer this one cy.get({priority}).should('have.value', xxxx)

OK.

cy.contains('View').click();
cy.get(selector.drawer).should('be.visible');
cy.get(selector.monacoScroll).within(() => {
cy.contains('priority').should('exist');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

It would be better to check whether service_id exist

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was add check whether service_id exist for the test case

@liuxiran
Copy link
Contributor

also cc @Baoyuantop @iamayushdas to have a look, thanks

Copy link
Contributor

@liuxiran liuxiran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT

@liuxiran
Copy link
Contributor

After checking the video log, we can found that the E2E failed caused by
image

we need to find a better way to fix this unstable test case.

video log here:
https://user-images.githubusercontent.com/2561857/133535785-4eae0421-9b8c-43e7-b667-9a3bc879c8ad.mp4

@liuxiran
Copy link
Contributor

re-run FE E2E test case

@juzhiyuan juzhiyuan merged commit f9f4b36 into apache:master Sep 19, 2021
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.

7 participants