From b6bea77965cc0a5f318ae60ab213c2601402d49f Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 7 Dec 2024 11:58:20 +0100 Subject: [PATCH 1/2] test cleanup, remove debug logging --- test/XmlElemNew.cfc | 2 +- test/general/ImageFormatSupport.cfc | 6 +++--- test/tickets/LDEV1718.cfc | 2 +- test/tickets/LDEV2423.cfc | 8 ++++---- test/tickets/LDEV2549/LDEV2549.cfm | 4 ++-- test/tickets/LDEV3978/LDEV3978.cfm | 2 ++ test/tickets/LDEV4334.cfc | 6 ++++-- test/tickets/LDEV4582/Application.cfc | 2 +- test/tickets/LDEV4582/index.cfm | 2 +- test/tickets/LDEV4602.cfc | 2 +- test/tickets/LDEV4670.cfc | 26 +++++++++++++------------- test/tickets/LDEV4982.cfc | 2 +- test/tickets/LDEV5184_2.cfc | 1 + 13 files changed, 35 insertions(+), 30 deletions(-) diff --git a/test/XmlElemNew.cfc b/test/XmlElemNew.cfc index 0f3bbb351d..a769c2d991 100644 --- a/test/XmlElemNew.cfc +++ b/test/XmlElemNew.cfc @@ -8,7 +8,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" { expect(IsXmlElem(xmlelem)).toBeTrue(); - SystemOutput(createObject("java","lucee.transformer.dynamic.DynamicInvoker").observeData(),1,1); + // SystemOutput(createObject("java","lucee.transformer.dynamic.DynamicInvoker").observeData(),1,1); }); }); } diff --git a/test/general/ImageFormatSupport.cfc b/test/general/ImageFormatSupport.cfc index bc085b0191..269ebbb4f8 100644 --- a/test/general/ImageFormatSupport.cfc +++ b/test/general/ImageFormatSupport.cfc @@ -23,12 +23,12 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="image" { if ( !fileExists( imagePath ) ) { // directory! } else if ( structKeyExists( readImageFormats, listLast( imagePath, "." ) ) ) { - systemOutput("ImageInfo - #imagePath# ", true); + //systemOutput("ImageInfo - #imagePath# ", true); expect ( function(){ expect( imageInfo( imagePath ) ).toBeStruct( imagePath ); }).notToThrow( message=imagePath ); } else { - systemOutput("Image format not supported - #imagePath# ", true); + //systemOutput("Image format not supported - #imagePath# ", true); } } } @@ -43,7 +43,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="image" { expect( isImage( imageRead( imagePath ) ) ).toBeTrue( imagePath ); }).notToThrow(message=imagePath ); } else { - systemOutput("Image format not supported - #imagePath# ", true); + //systemOutput("Image format not supported - #imagePath# ", true); } } } diff --git a/test/tickets/LDEV1718.cfc b/test/tickets/LDEV1718.cfc index 56e79de45e..bf1435d96d 100644 --- a/test/tickets/LDEV1718.cfc +++ b/test/tickets/LDEV1718.cfc @@ -32,7 +32,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" { function afterAll(){ application action="update" mappings=variables.oldMappings; - systemOutput(variables.oldMappings, true); + //systemOutput(variables.oldMappings, true); // delete test folder var curr=getDirectoryFromPath(getCurrentTemplatePath()); diff --git a/test/tickets/LDEV2423.cfc b/test/tickets/LDEV2423.cfc index 34acd0d8ef..67cef8c1a7 100644 --- a/test/tickets/LDEV2423.cfc +++ b/test/tickets/LDEV2423.cfc @@ -75,8 +75,8 @@ component extends = "org.lucee.cfml.test.LuceeTestCase" labels="mssql" { }, {dbtype="query", result="local.result"} ); - systemOutput( res, true ); - systemOutput( result, true); + //systemOutput( res, true ); + //systemOutput( result, true); expect( res.recordCount ).toBe( 1 ); }); @@ -93,8 +93,8 @@ component extends = "org.lucee.cfml.test.LuceeTestCase" labels="mssql" { }, {dbtype="query", result="local.result"} ); - systemOutput( res, true ); - systemOutput( result, true); + //systemOutput( res, true ); + //systemOutput( result, true); expect( res.recordCount ).toBe( 1 ); }); }); diff --git a/test/tickets/LDEV2549/LDEV2549.cfm b/test/tickets/LDEV2549/LDEV2549.cfm index 594a5a186d..efd2d6c1f5 100644 --- a/test/tickets/LDEV2549/LDEV2549.cfm +++ b/test/tickets/LDEV2549/LDEV2549.cfm @@ -5,8 +5,8 @@ - systemOutput("", true); - systemOutput("#db#, #scene# [#test1.day#]", true); + //systemOutput("", true); + //systemOutput("#db#, #scene# [#test1.day#]", true); param = { value: test1.day }; diff --git a/test/tickets/LDEV3978/LDEV3978.cfm b/test/tickets/LDEV3978/LDEV3978.cfm index 9eb985a46d..26447b5e68 100644 --- a/test/tickets/LDEV3978/LDEV3978.cfm +++ b/test/tickets/LDEV3978/LDEV3978.cfm @@ -1,5 +1,7 @@ + diff --git a/test/tickets/LDEV4334.cfc b/test/tickets/LDEV4334.cfc index e0c6610b33..409cf1927d 100644 --- a/test/tickets/LDEV4334.cfc +++ b/test/tickets/LDEV4334.cfc @@ -10,7 +10,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="mappings" { it( title="check mappings", body=function( currentSpec ) { application action="update" name="LDEV4334-#CreateUniqueID()#"; res = mappingsTest( "LDEV4334/index.cfm", "with no mapping" ); - debug(res); + //debug(res); }); it( title="check mappings", body=function( currentSpec ) localmode=true { @@ -19,7 +19,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="mappings" { mappings[ "/susi"]=curr; application action="update" mappings=mappings; res = mappingsTest( "LDEV4334/index.cfm", "with single mapping" ); - debug(res); + //debug(res); }); }); @@ -48,10 +48,12 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="mappings" { paths['contractPath( expandPath(#paths.base#) )'] = contractPath( expandPath(paths.base) ) ; paths['contractPath( expandPath( "./" & #paths.base #) )'] = contractPath( expandPath( "./" & paths.base ) ); paths['contractPath( expandPath( "/" & #paths.base# ) )'] = contractPath( expandPath( "/" & paths.base ) ); + /* systemOutput("", true); loop collection=paths key="local.key" value="local.value"{ systemOutput(key & chr(9) & value, true); } + */ return paths; } } \ No newline at end of file diff --git a/test/tickets/LDEV4582/Application.cfc b/test/tickets/LDEV4582/Application.cfc index db1aca0973..969341cdef 100644 --- a/test/tickets/LDEV4582/Application.cfc +++ b/test/tickets/LDEV4582/Application.cfc @@ -3,7 +3,7 @@ component { logDir = getDirectoryFromPath(getCurrentTemplatePath()) & "logs"; - systemOutput( "mapping: /logs : #logDir#", true); + // systemOutput( "mapping: /logs : #logDir#", true); this.mappings = { "/logs" : logDir diff --git a/test/tickets/LDEV4582/index.cfm b/test/tickets/LDEV4582/index.cfm index 1edcde1025..8d3ff63630 100644 --- a/test/tickets/LDEV4582/index.cfm +++ b/test/tickets/LDEV4582/index.cfm @@ -1,6 +1,6 @@ d = expandPath( "/logs" ); // should be a sub dir from this folder via a mapping - systemOutput( d, true ); + // systemOutput( d, true ); if ( !directoryExists( d ) ) directoryCreate( d ) echo( d ); diff --git a/test/tickets/LDEV4602.cfc b/test/tickets/LDEV4602.cfc index 3c9cdddf1b..794d8ec465 100644 --- a/test/tickets/LDEV4602.cfc +++ b/test/tickets/LDEV4602.cfc @@ -12,7 +12,7 @@ component extends = "org.lucee.cfml.test.LuceeTestCase" { var f=getTempFile(getDirectoryFromPath(getCurrentTemplatePath()), "ldev4602-stackoverflow", "cfm"); try { fileWrite( f, arrayToList(a, chr(10) ) ); // approx 1.5mb of crap cfml - systemOutput( f ); + // systemOutput( f ); silent { cfinclude( template=listlast(f,"\/") ); // errors } diff --git a/test/tickets/LDEV4670.cfc b/test/tickets/LDEV4670.cfc index c6d3b2efe9..7cc407375d 100644 --- a/test/tickets/LDEV4670.cfc +++ b/test/tickets/LDEV4670.cfc @@ -18,45 +18,45 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="session" { }); it( title='Checking datasource session expiry, timezone UTC',skip=isMySqlNotSupported(),body=function( currentSpec ) { var remainingSessions = testSessionTimezone( "UTC", "datasource" ); - dumpResult( remainingSessions, "UTC" ); + //dumpResult( remainingSessions, "UTC" ); expect( remainingSessions.recordcount ).toBe( 0 ); }); it( title='Checking datasource session expiry, timezone PDT -7',skip=isMySqlNotSupported(),body=function( currentSpec ) { var remainingSessions = testSessionTimezone( "PDT", "datasource" ); - dumpResult( remainingSessions, "PDT" ); + //dumpResult( remainingSessions, "PDT" ); expect( remainingSessions.recordcount ).toBe( 0 ); }); it( title='Checking datasource session expiry, timezone AEST +10',skip=isMySqlNotSupported(),body=function( currentSpec ) { var remainingSessions = testSessionTimezone( "AEST", "datasource" ); - dumpResult( remainingSessions, "AEST" ); + //dumpResult( remainingSessions, "AEST" ); expect( remainingSessions.recordcount ).toBe( 0 ); }); it( title='Checking memory session expiry, timezone UTC', body=function( currentSpec ) { var remainingSessions = testSessionTimezone( "UTC", "memory" ); - dumpResult( remainingSessions, "UTC" ); + //dumpResult( remainingSessions, "UTC" ); expect( remainingSessions.recordcount ).toBe( 0 ); }); it( title='Checking memory session expiry, timezone PDT -7', body=function( currentSpec ) { var remainingSessions = testSessionTimezone( "PDT", "memory" ); - dumpResult( remainingSessions, "PDT" ); + //dumpResult( remainingSessions, "PDT" ); expect( remainingSessions.recordcount ).toBe( 0 ); }); it( title='Checking memory session expiry, timezone Europe/Berlin +1', body=function( currentSpec ) { var remainingSessions = testSessionTimezone( "Europe/Berlin", "memory" ); - dumpResult( remainingSessions, "Europe/Berlin" ); + //dumpResult( remainingSessions, "Europe/Berlin" ); expect( remainingSessions.recordcount ).toBe( 0 ); }); it( title='Checking memory session expiry, timezone AEST +10', body=function( currentSpec ) { var remainingSessions = testSessionTimezone( "AEST", "memory" ); - dumpResult( remainingSessions, "AEST" ); + //dumpResult( remainingSessions, "AEST" ); expect( remainingSessions.recordcount ).toBe( 0 ); }); @@ -65,9 +65,9 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="session" { } private query function testSessionTimezone( required string timezone, required string sessionStorageType ){ - systemOutput( " ", true ); + //systemOutput( " ", true ); - systemOutput(">>>>> testSessionTimezone #arguments.timezone# / #arguments.sessionStorageType# ----- ", true); + //systemOutput(">>>>> testSessionTimezone #arguments.timezone# / #arguments.sessionStorageType# ----- ", true); if ( arguments.sessionStorageType == "datasource" ) { var result = testSession("first cleanout sessions table",{ action: "purge", @@ -76,7 +76,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="session" { sessionStorageType: arguments.sessionStorageType }); } - systemoutput("purgeExpiredSessions", true); + //systemoutput("purgeExpiredSessions", true); admin action="purgeExpiredSessions" type="server" @@ -123,7 +123,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="session" { // now let the session expire, session expiry is 1s sleep( 1001 ); - systemoutput("purgeExpiredSessions", true); + //systemoutput("purgeExpiredSessions", true); admin action="purgeExpiredSessions" type="server" @@ -166,7 +166,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="session" { } private any function testSession ( required string name, required struct args, struct session={} ){ - systemOutput( "---- #arguments.name# ----- ", true ); + //systemOutput( "---- #arguments.name# ----- ", true ); var uri = createURI("LDEV4670"); var cookies = {}; if ( structCount( arguments.session ) ){ @@ -185,7 +185,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="session" { ); //systemOutput(result, true); - systemOutput( deserializeJson( result.filecontent ), true ); + // systemOutput( deserializeJson( result.filecontent ), true ); //systemOutput(deserializeJson(result.filecontent, false), true); return result; } diff --git a/test/tickets/LDEV4982.cfc b/test/tickets/LDEV4982.cfc index dc6a2547e5..8b6da0f434 100644 --- a/test/tickets/LDEV4982.cfc +++ b/test/tickets/LDEV4982.cfc @@ -4,7 +4,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" { describe( "Test case for LDEV-4982", function() { it( title = "Checking {lucee-config-file}", body=function( currentSpec ) { var cfconfigPath = expandPath( "{lucee-config-file}" ); - systemOutput(chr(10) & cfconfigPath, true) + // systemOutput(chr(10) & cfconfigPath, true) expect( fileExists( cfconfigPath ) ).toBeTrue(); var json= fileRead( cfconfigPath ); expect( isJson( json ) ).toBeTrue(); diff --git a/test/tickets/LDEV5184_2.cfc b/test/tickets/LDEV5184_2.cfc index 1a48068f52..062e8c43c1 100644 --- a/test/tickets/LDEV5184_2.cfc +++ b/test/tickets/LDEV5184_2.cfc @@ -8,6 +8,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" { expect(request.testReq?:"undefined").toBe("test5148"); expect(result.testReq?:"undefined").toBe("test5148"); + structDelete(request, "testReq"); }); }); } From 30467d69cc8cecaddcbe0468f71fb28de18fba12 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Sat, 7 Dec 2024 15:01:46 +0100 Subject: [PATCH 2/2] resources test cleanup - refactor try finally to throw after error --- test/general/Resources.cfc | 106 +++++++++++++++++++++++++++---------- test/general/S3.cfc | 8 ++- test/tickets/LDEV3116.cfc | 2 +- test/tickets/LDEV4582.cfc | 2 +- 4 files changed, 87 insertions(+), 31 deletions(-) diff --git a/test/general/Resources.cfc b/test/general/Resources.cfc index e1b5eb639f..662e9a73b3 100755 --- a/test/general/Resources.cfc +++ b/test/general/Resources.cfc @@ -87,7 +87,9 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="s3,zip" { var sdsd=sd&"test3/"; var sdsf=sd&"test4.txt"; var sdsdsf=sdsd&"test5.txt"; + var error = {}; try{ + directory directory="#dir#" action="list" name="children" recurse="no"; assertEquals(0,children.recordcount); @@ -109,12 +111,14 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="s3,zip" { directory directory="#dir#" action="list" name="children" recurse="yes" filter="*5.txt"; assertEquals(1,children.recordcount); - } - finally { + } catch ( e ){ + error = e; + } finally { if(directoryExists(sd))directory directory="#sd#" action="delete" recurse="yes"; if(fileExists(sf))file action="delete" file="#sf#"; - } + if (structCount(error)) + throw (message="dirList failed - #label#", cause=error); } private void function dirRename(string label,string dir){ @@ -126,6 +130,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="s3,zip" { var sdsdNew=sd&"test3New/"; var sdsf=sd&"test4.txt"; var sdsdsf=sdsd&"test5.txt"; + var error = {}; try{ directory directory="#sd#" action="create"; directory directory="#sdsd#" action="create"; @@ -143,16 +148,16 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="s3,zip" { directory directory="#dir#" action="list" name="children" recurse="yes"; assertEquals("test1New,test2.txt,test3New,test4.txt,test5.txt", ListSort( valueList(children.name),'text')); - } - finally { - - - + } catch ( e ){ + error = e; + } finally { if(directoryExists(sdNew))directory directory="#sdNew#" action="delete" recurse="yes"; if(fileExists(sf)){ file action="delete" file="#sf#"; } } + if (structCount(error)) + throw (message="dirRename failed - #label#", cause=error); } private void function fileACopy(string label,string dir){ @@ -161,6 +166,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="s3,zip" { var d=arguments.dir&"copy2.txt"; var sd=arguments.dir&"test1/"; var sdsf=sd&"test4.txt"; + var error = {}; try{ directory directory="#sd#" action="create"; file action="write" file="#s#" output="aaa" addnewline="no" fixnewline="no"; @@ -170,12 +176,15 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="s3,zip" { directory directory="#dir#" action="list" name="children" recurse="yes"; assertEquals("copy1.txt,copy2.txt,test1,test4.txt", ListSort(valueList(children.name),'text')); - } - finally { + } catch ( e ){ + error = e; + } finally { if(directoryExists(sd))directory directory="#sd#" action="delete" recurse="yes"; if(fileExists(s))file action="delete" file="#s#"; if(fileExists(d))file action="delete" file="#d#"; } + if (structCount(error)) + throw (message="fileACopy failed - #label#", cause=error); } private void function fileAMove(string label,string dir){ @@ -185,6 +194,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="s3,zip" { var d=arguments.dir&"move2.txt"; var sd=arguments.dir&"test1/"; var sdsf=sd&"test4.txt"; + var error = {}; try{ directory directory="#sd#" action="create"; file action="write" file="#s#" output="" addnewline="no" fixnewline="no"; @@ -194,38 +204,48 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="s3,zip" { directory directory="#dir#" action="list" name="children" recurse="yes"; assertEquals("test1,test4.txt", valueList(children.name)); - } - finally { + } catch ( e ){ + error = e; + } finally { if(directoryExists(sd))directory directory="#sd#" action="delete" recurse="yes"; } + if (structCount(error)) + throw (message="fileAMove failed - #label#", cause=error); } private void function fileAReadAppend(string label,string dir){ var content=""; var s=arguments.dir&"read.txt"; + var error = {}; try { file action="write" file="#s#" output="Write" addnewline="no" fixnewline="no"; file action="append" addnewline="no" file="#s#" output="Append" fixnewline="no"; file action="read" file="#s#" variable="content"; assertEquals("WriteAppend",content); - } - finally { + } catch ( e ){ + error = e; + } finally { if(fileExists(s))file action="delete" file="#s#"; } + if (structCount(error)) + throw (message="fileAReadAppend failed - #label#", cause=error); } private void function fileAReadBinary(string label,string dir){ var content=""; var s=arguments.dir&"read.gif"; - + var error = {}; try { file action="write" file="#s#" output="Susi" addnewline="no" fixnewline="no"; file action="readbinary" file="#s#" variable="content"; assertEquals("U3VzaQ==",ToBase64(content)); - } - finally { + } catch ( e ){ + error = e; + } finally { if(fileExists(s))file action="delete" file="#s#"; } + if (structCount(error)) + throw (message="fileAReadBinary failed - #label#", cause=error); } @@ -420,7 +440,8 @@ private function testResourceReadWrite(res) localMode=true { private function testResourceProvider(string path) localmode=true { // first we ceate a resource object - res=createObject('java','lucee.commons.io.res.util.ResourceUtil').toResourceNotExisting(getPageContext(), path); + var res=createObject('java','lucee.commons.io.res.util.ResourceUtil').toResourceNotExisting(getPageContext(), path); + var error = {}; // delete when exists if(res.exists()) res.remove(true); @@ -436,44 +457,64 @@ private function testResourceProvider(string path) localmode=true { try { res.createDirectory(true); testResourceFileCreateDelete(res); + } catch ( e ){ + error = e; + } finally { + if(res.exists()) res.remove(true); } - finally {if(res.exists()) res.remove(true);} // test listening try { res.createDirectory(true); testResourceListening(res); + } catch ( e ){ + error = e; + } finally { + if(res.exists()) res.remove(true); } - finally {if(res.exists()) res.remove(true);} // test "is" try { res.createDirectory(true); testResourceIS(res); + } catch ( e ){ + error = e; + } finally { + if(res.exists()) res.remove(true); } - finally {if(res.exists()) res.remove(true);} // test move and copy try { res.createDirectory(true); testResourceMoveCopy(res); + } catch ( e ){ + error = e; + } finally { + if(res.exists()) res.remove(true); } - finally {if(res.exists()) res.remove(true);} // test Getter try { res.createDirectory(true); testResourceGetter(res); + } catch ( e ){ + error = e; + } finally { + if(res.exists()) res.remove(true); } - finally {if(res.exists()) res.remove(true);} // test read/write try { res.createDirectory(true); testResourceReadWrite(res); + } catch ( e ){ + error = e; + } finally { + if(res.exists()) res.remove(true); } - finally {if(res.exists()) res.remove(true);} + if (structCount(error)) + throw (message="testResourceProvider - #label#", cause=error); } @@ -495,6 +536,7 @@ private function assertEqualPaths(string path1, string path2) { directory directory="#dir#" action="delete" recurse="yes"; } directory directory="#dir#" action="create"; + var error = {}; try{ assertTrue(DirectoryExists(dir)); directoryCreateDelete(arguments.label,dir); @@ -505,13 +547,14 @@ private function assertEqualPaths(string path1, string path2) { fileAReadAppend(arguments.label,dir); fileAReadBinary(arguments.label,dir); testResourceProvider(dir&"testcaseres1"); - } catch(e) { - systemOutput(e, true); + error = e; } finally { if(directoryExists(dir)) directory directory="#dir#" action="delete" recurse="yes"; } + if (structCount(error)) + throw (message="test failed", cause=error); assertFalse(DirectoryExists(dir)); } @@ -545,6 +588,7 @@ private function assertEqualPaths(string path1, string path2) { var file=getTempFile( getTempDirectory(), "res-zip", "zip" ); //var file=getDirectoryFromPath(getCurrentTemplatePath())&"zip-"&getTickCount()&".zip"; var zipPath="zip://"&file&"!/"; + var error = {}; try { //first we create a zip we can use then as a filesystem zip action="zip" file=file { @@ -552,20 +596,24 @@ private function assertEqualPaths(string path1, string path2) { } // now we use that zip test("zip",zipPath); + } catch(e) { + error = e; } // now we delete that zip again finally { if (fileExists(file)) { try {fileDelete(file);}catch(e) {}; // locked on windows LDEV-4700 } - } + if (structCount(error)) + throw (message="testZip failed", cause=error); } public void function testZipAsMapping(){ var file=getTempFile( getTempDirectory(), "zip-as-mapping", "zip" ); //var file=getDirectoryFromPath(getCurrentTemplatePath())&"zip-"&getTickCount()&".zip"; var zipPath="zip://"&file&"!/"; + var error = {}; try { //first we create a zip we can use then as a filesystem zip action="zip" file=file { @@ -576,6 +624,8 @@ private function assertEqualPaths(string path1, string path2) { // now we use that zip //throw expandPath("/testResZip/")&":"&file; test("zip","/testreszip/"); + } catch(e) { + error = e; } // now we delete that zip again finally { @@ -583,6 +633,8 @@ private function assertEqualPaths(string path1, string path2) { try {fileDelete(file);}catch(e) {}; // locked on windows - LDEV-4700 } } + if (structCount(error)) + throw (message="testZipAsMapping failed", cause=error); } private struct function getCredentials() { diff --git a/test/general/S3.cfc b/test/general/S3.cfc index a7f0eabcca..b446d4430e 100644 --- a/test/general/S3.cfc +++ b/test/general/S3.cfc @@ -41,6 +41,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="s3" { var cred=getCredentials(); var dir="s3://#cred.ACCESS_KEY_ID#:#cred.SECRET_KEY#@/#cred.BUCKET_PREFIX#s3-#lcase( hash( CreateGUID() ) )#/"; var file=dir&"testmultithread.txt"; + var error = {}; try { if(!directoryExists(dir))directoryCreate(dir); fileWrite(file, "Susi sorglos foehnte Ihr Haar!"); @@ -54,10 +55,13 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="s3" { function(el, ix, arr) localMode=true { var res=fileRead(el); }, true, 100); - } - finally { + } catch ( e ){ + error = e; + } finally { if(directoryExists(dir))directoryDelete(dir, true); } + if (structCount(error)) + throw (message="testcase failed", cause=error); }); }); } diff --git a/test/tickets/LDEV3116.cfc b/test/tickets/LDEV3116.cfc index 965c154321..61ed0c1630 100644 --- a/test/tickets/LDEV3116.cfc +++ b/test/tickets/LDEV3116.cfc @@ -26,7 +26,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="thread" { thread.testing = 'blah'; } thread action="join" name="test_without"; - systemOutput(cfthread.test_without,1,1); + //systemOutput(cfthread.test_without,1,1); expect( cfthread.test_without ).notToHaveKey( "error", cfthread.test_without.error.stacktrace?: '???' ); expect( cfthread.test_without.testing ).toBe( "blah" ); } ); diff --git a/test/tickets/LDEV4582.cfc b/test/tickets/LDEV4582.cfc index cb4b2aad26..8833a11f44 100644 --- a/test/tickets/LDEV4582.cfc +++ b/test/tickets/LDEV4582.cfc @@ -3,7 +3,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" { function beforeAll(){ variables.uri = createURI("LDEV4582"); variables.logDir = getDirectoryFromPath(getCurrentTemplatepath()) & "LDEV4582#server.separator.file#logs"; - systemOutput( "", true); + //systemOutput( "", true); cleanup(); }