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

test: e2e test chash upstream with key (query_string, arg_xxx) #932

Merged
merged 10 commits into from
Dec 2, 2020

Conversation

idbeta
Copy link
Contributor

@idbeta idbeta commented Dec 1, 2020

Please answer these questions before submitting a pull request

  • Why submit this pull request?
  • E2E test
  • New feature provided
  • Improve performance

related issue: #908

@codecov-io
Copy link

codecov-io commented Dec 1, 2020

Codecov Report

Merging #932 (5c3b6cf) into master (95f2612) will decrease coverage by 0.07%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #932      +/-   ##
==========================================
- Coverage   43.10%   43.02%   -0.08%     
==========================================
  Files          18       18              
  Lines        1290     1290              
==========================================
- Hits          556      555       -1     
- Misses        642      643       +1     
  Partials       92       92              
Impacted Files Coverage Δ
api/internal/core/store/store.go 78.57% <0.00%> (-0.65%) ⬇️

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 95f2612...5c3b6cf. Read the comment docs.

@idbeta idbeta mentioned this pull request Dec 1, 2020
2 tasks
@idbeta idbeta changed the title test: e2e test cHash upstream with key (query_string, arg_xxx) test: e2e test chash upstream with key (query_string, arg_xxx) Dec 1, 2020
}
resp.Body.Close()
}
//the results will be distributed among the 3 upstream
Copy link
Member

Choose a reason for hiding this comment

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

please add a comment: todo: need to find a better way to confirm the result

Copy link
Member

Choose a reason for hiding this comment

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

current way is unstable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed.

testCaseCheck(tc)
}

//hit routes
Copy link
Member

Choose a reason for hiding this comment

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

bad comment style, please fix other similar points

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed.

Comment on lines 132 to 144
{
caseDesc: "create route using the upstream just created",
Object: ManagerApiExpect(t),
Method: http.MethodPut,
Path: "/apisix/admin/routes/1",
Body: `{
"uri": "/server_port",
"upstream_id": "1"
}`,
Headers: map[string]string{"Authorization": token},
ExpectStatus: http.StatusOK,
Sleep: sleepTime,
},
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Contributor Author

@idbeta idbeta left a comment

Choose a reason for hiding this comment

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

fixed. @membphis

Copy link
Member

@membphis membphis left a comment

Choose a reason for hiding this comment

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

LGTM, except minor things

counts = append(counts, value)
}
sort.Ints(counts)
assert.True(t, float64(counts[2]-counts[0]) / float64(counts[1]) < 0.4) // the result is unstable, fix it later
Copy link
Member

Choose a reason for hiding this comment

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

add a todo keyword

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed.

counts = append(counts, value)
}
sort.Ints(counts)
assert.True(t, float64(counts[2]-counts[0]) / float64(counts[1]) < 0.4) // the result is unstable, fix it later
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@nic-chen
Copy link
Member

nic-chen commented Dec 2, 2020

ping @idbeta

Copy link
Member

@nic-chen nic-chen left a comment

Choose a reason for hiding this comment

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

LGTM Except for some code format issues

@membphis membphis merged commit 0e2bf1c into apache:master Dec 2, 2020
@idbeta idbeta deleted the e2e-test-upstream2 branch December 9, 2020 07:49
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.

4 participants