openresty / openresty/test-nginx

[question]running tests fail

Open
#89 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Perl
Stars
456
Forks
112
PR merge metrics
No merged PRs in 30d

Description

hi,
I run the example in https://openresty.gitbooks.io/programming-openresty/content/testing/running-tests.html, then get this failed result:

t/foo.t .. 
ok 1 - TEST 1: hello, world - status code ok
not ok 2 - TEST 1: hello, world - response_body - response is expected (repeated req 0, req 0)

#   Failed test 'TEST 1: hello, world - response_body - response is expected (repeated req 0, req 0)'
#   at /Library/Perl/5.18/Test/Nginx/Socket.pm line 1387.
#          got: "hello, world!\x{0a}"
#       length: 14
#     expected: "hello, world!\x{0a}--- error_code: 200"
#       length: 33
#     strings begin to differ at char 15 (line 2 column 1)
1..2
# Looks like you failed 1 test of 2.
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/2 subtests 

Test Summary Report
-------------------
t/foo.t (Wstat: 256 Tests: 2 Failed: 1)
  Failed test:  2
  Non-zero exit status: 1
Files=1, Tests=2,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.12 cusr  0.04 csys =  0.18 CPU)
Result: FAIL

I don't know what's the reason, please help me fix it.
Thank you!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the running-tests example linked in the issue and inspect t/foo.t alongside the failure at Test::Nginx::Socket.pm line 1387. Compare the expected response with the actual output and verify the local test setup; done means the example completes without the failed response_body assertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
nginx, perl
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.