Opened 9 years ago

Closed 8 years ago

#11407 closed defect (fixed)

tests.cache test failure on build

Reported by: Adam Peller Owned by: James Burke
Priority: high Milestone: 1.7
Component: BuildTools Version: 1.5.0b2
Keywords: dohfail Cc:
Blocked By: Blocking:

Description

Failed on Chrome 5.0, FF 3.6.6 (both Mac)

http://archive.dojotoolkit.org/dojo-2010-07-02/dojotoolkit/util/doh/runner.html?testModule=tests.cache

GROUP "tests.cache" has 1 test to run
     _AssertFailure: doh._AssertFailure: assertEqual() failed:
 	expected
		
	but got
		<h1>Hello World</h1>


: assertEqual() failed:
	expected
		
	but got
		<h1>Hello World</h1>


 doh._AssertFailure: assertEqual() failed:
     expected
		
	but got
		<h1>Hello World</h1>


     ERROR IN:
 		 function (t){
				var expected = "<h1>Hello World</h1>";

				t.is(expected, dojo.trim(dojo.cache("dojo.tests.cache", "regular.html", "<h1>Hello World</h1>\n")));
				t.is(expected, dojo.trim(dojo.cache("dojo.tests.cache", "sanitized.html", {value: "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n\t\"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n\t<head>\n\t\t<script type=\"text/javascript\" src=\"../../dojo.js\"></script>\n\t\t<script type=\"text/javascript\" src=\"../../cache.js\"></script>\n\t</head>\n\t<body class=\"tundra\">\n\t\t<h1>Hello World</h1>\n\t</body>\n</html>\n",sanitize: true})));
				
				//Test object variant for module.
				var objPath = dojo.moduleUrl("dojo.tests.cache", "object.html").toString();
				t.is(expected, dojo.trim(dojo.cache(new dojo._Url(objPath), {sanitize: true})));

				//Just a couple of other passes just to make sure on manual inspection that the
				//files are loaded over the network only once.
				t.is(expected, dojo.trim(dojo.cache("dojo.tests.cache", "regular.html", "<h1>Hello World</h1>\n")));
				t.is(expected, dojo.trim(dojo.cache("dojo.tests.cache", "sanitized.html", {value: "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n\t\"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n\t<head>\n\t\t<script type=\"text/javascript\" src=\"../../dojo.js\"></script>\n\t\t<script type=\"text/javascript\" src=\"../../cache.js\"></script>\n\t</head>\n\t<body class=\"tundra\">\n\t\t<h1>Hello World</h1>\n\t</body>\n</html>\n",sanitize: true})));
				t.is(expected, dojo.trim(dojo.cache(new dojo._Url(objPath), {sanitize: true})));

				//Make sure unset cache does not throw errors
				t.is(null, dojo.cache("dojo.tests.cache", "regular.html", null));

				//Set empty string as value
				t.is("", dojo.cache("dojo.tests.cache", "regular.html", ""));
				t.is("", dojo.cache("dojo.tests.cache", "regular.html", "<h1>Hello World</h1>\n"));
			}
 FAILED test: undefined 3 ms

Change History (3)

comment:1 Changed 9 years ago by bill

Component: GeneralBuildTools

Looks like this is just a problem with how the build system and test interact. http://archive.dojotoolkit.org/dojo-2010-07-02/checkout/util/doh/runner.html?testModule=tests.cache works fine.

Probably the issue is that the build system mucks with the dojo.cache() references in the test file.

It's unclear though which assert is failing, all of those t.is() calls need a third argument (a text string comment) to differentiate them.

comment:2 Changed 8 years ago by bill

Keywords: dohfail added

comment:3 Changed 8 years ago by bill

Milestone: tbd1.7
Resolution: fixed
Status: newclosed
Summary: tests.cache test failuretests.cache test failure on build
Note: See TracTickets for help on using tickets.