yixianOu commented on PR #12794:
URL: https://github.com/apache/apisix/pull/12794#issuecomment-3654406655
During the last CI test run, I noticed that the `jwe-decrypt.t` test failed.
The reason was that the `Authorization` field in the response headers had a
value of `"Authorization": ["hello"]`.
```
# Failed test 't/plugin/jwe-decrypt.t TEST 26: verify in upstream header
- response_body_like - response is expected ({
# "headers": { "Authorization": [ "hello" ], "Host": [ "localhost"
# ], "X-Forwarded-For": [ "127.0.0.1" ], "X-Forwarded-Host": [
# "localhost" ], "X-Forwarded-Port": [ "1984" ],
# "X-Forwarded-Proto": [ "http" ], "X-Real-Ip": [ "127.0.0.1" ] }
# })'
# at /usr/local/share/perl/5.38.2/Test/Nginx/Socket.pm line 1706.
# '{
# "headers": {
# "Authorization": [
# "hello"
# ],
# "Host": [
# "localhost"
# ],
# "X-Forwarded-For": [
# "127.0.0.1"
# ],
# "X-Forwarded-Host": [
# "localhost"
# ],
# "X-Forwarded-Port": [
# "1984"
# ],
# "X-Forwarded-Proto": [
# "http"
# ],
# "X-Real-Ip": [
# "127.0.0.1"
# ]
# }
# }
# '
# doesn't match '(?^s:.*"Authorization": "hello".*
# )'
# Looks like you failed 2 tests of 154.
# [08:26:06] t/plugin/jwe-decrypt.t ..
# Dubious, test returned 2 (wstat 512, 0x200)
# Failed 2/154 subtests
```
Therefore, I modified the expected response in `jwe-decrypt.t` to
`.*"Authorization":\s*\[\s*"hello"\s*\].*`.
This change allowed the test to pass successfully on my local machine:
```
╭───────────────────────────────────────────────────────────────────────────────────╮
│ [08:16:40] t/plugin/jwe-decrypt.t .. ok 12507 ms ( 0.03 usr 0.00 sys +
1.91 │
│ cusr 0.63 csys = 2.57 CPU)
│
│ [08:16:40]
│
│ All tests successful.
│
│ Files=1, Tests=154, 13 wallclock secs ( 0.06 usr 0.01 sys + 1.91 cusr
0.63 │
│ csys = 2.61 CPU)
│
│ Result: PASS
│
│ <exited with exit code 0>
│
╰───────────────────────────────────────────────────────────────────────────────────╯
```
However, in today's CI test run, `jwe-decrypt.t` failed again. This time,
the `Authorization` field in the response headers was `"Authorization":
"hello"`.
Should we revert the expected response back to `.*"Authorization":
"hello".*`?
@Baoyuantop
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]