Skip to content

Conversation

@samugi
Copy link
Contributor

@samugi samugi commented Jun 1, 2022

No description provided.

@samugi samugi requested a review from a team as a code owner June 1, 2022 20:46
@samugi samugi requested review from a team and removed request for a team June 1, 2022 20:47
Comment on lines +467 to +482
location /transactions.xml {
content_by_lua_block {
ngx.req.read_body()
local post_args = ngx.req.get_post_args()
local app_id_match, usage_match
for k, v in pairs(post_args) do
if k == 'transactions[0][app_key]' then
ngx.exit(500)
elseif k == 'transactions[0][usage][hits]' then
usage_match = v == '3'
elseif k == 'transactions[0][app_id]' then
app_id_match = v == 'appid'
end
end
ngx.shared.result = usage_match and app_id_match
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is executed when /force_report_to_backend is called, when the backend_client is instantiated, so it includes the usage (hits) from 3 calls now instead of 2, because the /force_report_to_backend endpoint is an upstream too so it increases the hits as well. It used to be 2 in the old test because that endpoint was accessed without going through APIcast.

Comment on lines +467 to +482
location /transactions.xml {
content_by_lua_block {
ngx.req.read_body()
local post_args = ngx.req.get_post_args()
local app_id_match, usage_match
for k, v in pairs(post_args) do
if k == 'transactions[0][app_key]' then
ngx.exit(500)
elseif k == 'transactions[0][usage][hits]' then
usage_match = v == '3'
elseif k == 'transactions[0][app_id]' then
app_id_match = v == 'appid'
end
end
ngx.shared.result = usage_match and app_id_match
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is executed when /force_report_to_backend is called, when the backend_client is instantiated, so it includes the usage (hits) from 3 calls now instead of 2, because the /force_report_to_backend endpoint is an upstream too so it increases the hits as well. It used to be 2 in the old test because that endpoint was accessed without going through APIcast.

@samugi samugi force-pushed the blackbox-batcher-policy-test branch from 3e74c4f to 35ca9b5 Compare June 3, 2022 09:42
@samugi samugi force-pushed the blackbox-batcher-policy-test branch from 35ca9b5 to 04a3054 Compare June 3, 2022 09:43
@samugi samugi merged commit 249b0ef into tests-conversion-to-blackbox Jun 5, 2022
@samugi samugi deleted the blackbox-batcher-policy-test branch June 5, 2022 17:04
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.

2 participants