Skip Menu |

This queue is for tickets about the HTTP-WebTest CPAN distribution.

Report information
The Basics
Id: 2175
Status: resolved
Priority: 0/
Queue: HTTP-WebTest

People
Owner: ILYAM [...] cpan.org
Requestors: khommel [...] socal.rr.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.01
Fixed in: (no value)



Subject: test in 02-generic.t incorrect?
HTTP-WebTest-2.01 fails in nmake test (Windows 2000). Test case may be incorrect. Test code is: # 5: run content size checks { my $tests = [ ( url => abs_url($URL, '/test-file1'), min_bytes => 10, max_bytes => 100 }, { url => abs_url($URL, '/test-file2'), min_bytes => 10, max_bytes => 100 }, { url => abs_url($URL, '/test-file1'), min_bytes => 100, max_bytes => 50000 }, { url => abs_url($URL, '/test-file2'), min_bytes => 100, max_bytes => 50000 } ]; check_webtest(webtest => $WEBTEST, server_url => $URL, tests => $tests, check_file => 't/test.out/size'); } According to the test results, test-file1 is 52 bytes and test-file2 is 14138. If this is correct, then the second and third parts of this test should fail (failure should be a positive result), but this is not the case. Results for parts 2 and 3: Test Name: N/A URL: http://http.web.test/test-file2 STATUS CODE CHECK Expected '200' and got: 200 OK SUCCEED CONTENT SIZE CHECK Number of returned bytes ( 14138 ) is > or = 10 ? SUCCEED Number of returned bytes ( 14138 ) is < or = 100 ? FAIL Test Name: N/A URL: http://http.web.test/test-file1 STATUS CODE CHECK Expected '200' and got: 200 OK SUCCEED CONTENT SIZE CHECK Number of returned bytes ( 52 ) is > or = 100 ? FAIL Number of returned bytes ( 52 ) is < or = 50000 ? SUCCEED Parts 1 and 4 succeed. Please let me know if I have misunderstood this test.
From: Ilya Martynov <ilya [...] martynov.org>
To: bug-HTTP-WebTest [...] rt.cpan.org
Subject: Re: [cpan #2175] test in 02-generic.t incorrect?
Date: Wed, 05 Mar 2003 03:09:17 +0300
RT-Send-Cc:
Show quoted text
>>>>> On Tue, 4 Mar 2003 09:48:13 -0500 (EST), "Guest via RT" <bug-HTTP-WebTest@rt.cpan.org> said:
Show quoted text
G> This message about HTTP-WebTest was sent to you by guest <> via rt.cpan.org G> Full context and any attached attachments can be found at: G> <URL: https://rt.cpan.org/Ticket/Display.html?id=2175 >
Show quoted text
G> HTTP-WebTest-2.01 fails in nmake test (Windows 2000). Test case may be incorrect. Test code is: G> # 5: run content size checks G> { G> my $tests = [ ( url => abs_url($URL, '/test-file1'), G> min_bytes => 10, G> max_bytes => 100 }, G> { url => abs_url($URL, '/test-file2'), G> min_bytes => 10, G> max_bytes => 100 }, G> { url => abs_url($URL, '/test-file1'), G> min_bytes => 100, G> max_bytes => 50000 }, G> { url => abs_url($URL, '/test-file2'), G> min_bytes => 100, G> max_bytes => 50000 } G> ];
Show quoted text
G> check_webtest(webtest => $WEBTEST, G> server_url => $URL, G> tests => $tests, G> check_file => 't/test.out/size'); G> }
Show quoted text
G> According to the test results, test-file1 is 52 bytes and test-file2 is 14138. If this is correct, then the second and third parts of this test should fail (failure should be a positive result), but this is not the case.
Show quoted text
G> Results for parts 2 and 3:
Show quoted text
G> Test Name: N/A G> URL: http://http.web.test/test-file2
Show quoted text
G> STATUS CODE CHECK G> Expected '200' and got: 200 OK SUCCEED G> CONTENT SIZE CHECK G> Number of returned bytes ( 14138 ) is > or = 10 ? SUCCEED G> Number of returned bytes ( 14138 ) is < or = 100 ? FAIL
Show quoted text
G> Test Name: N/A G> URL: http://http.web.test/test-file1
Show quoted text
G> STATUS CODE CHECK G> Expected '200' and got: 200 OK SUCCEED G> CONTENT SIZE CHECK G> Number of returned bytes ( 52 ) is > or = 100 ? FAIL G> Number of returned bytes ( 52 ) is < or = 50000 ? SUCCEED
Show quoted text
G> Parts 1 and 4 succeed.
Show quoted text
G> Please let me know if I have misunderstood this test.
Second and third part of this test does fail. It is expected. Results of test run are compared with a file which contains sample test report (see parameter 'check_file' in check_webtest() call). If they match then HTTP-WebTest's self-test suite count it as passed test. If you look in t/test.out/size you'll see exactly same output as you showed. -- Ilya Martynov, ilya@iponweb.net CTO IPonWEB (UK) Ltd Quality Perl Programming and Unix Support UK managed @ offshore prices - http://www.iponweb.net Personal website - http://martynov.org