Build: better handling of bad test cases

Previously the lucee build would just skip any invalid test cases, silently skipping tests with syntax errors, so if you make a syntax error, the build would just ignore the bad test, which was kinda frustrating

I have extended the test filtering process to manually sniff any bad test cases for skip="true"
if skip=true isn’t set, it then throws out a nice fatal error

long story short, writing and debugging test cases for Lucee 6.0 just got a lot easier

     [java]    [script] -------------- Start Tests -----------
     [java]    [script] ERROR:
     [java]    [script]         failure in C:\work\lucee6\test\tickets\LDEV1813.cfc;Syntax Error, Invalid Construct
     [java]    [script]         at line: 7, column: 45
     [java]    [script] 5:                              var a = [1,2,3,4,5,6,7,8];
     [java]    [script] 6:                              var arr = ["Aa","Bb","Cc","Dd","Ee"];
     [java]    [script] 7:                              assertEquals([1, 2, 3, 4, 5, 6,7, 8], a[:]);//return entire Array
     [java]    [script] 8:                              assertEquals([1, 2, 3, 4, 5, 6], a[1:6]); //starts from 1 to 6 index
     [java]    [script] 9:                              assertEquals([1, 3, 5], a[1:6:2]);// "Increase step by 2"
     [java]    [script]
     [java]    [script] lucee.runtime.exp.Abort: Page request is aborted
     [java]    [script]         at lucee.runtime.tag.Abort.doStartTag(
     [java]    [script]         at _testrunner_cfc$cf.udfCall1(/test/_testRunner.cfc:131)
     [java]    [script]         at _testrunner_cfc$cf.udfCall(/test/_testRunner.cfc)

this fails because Lucee doesn’t support the range syntax yet a[:]

1 Like

think this is all finally working as you’d expect.

what I’m doing now is parsing out the component header when a test suite’s cfc won’t compile and calling getComponentMetaData on this stub cfc, with a manual fall back to just try and parse out the raw cfml for skip=true

why do we need all this?, well for our Lucee extensions, when we run CI, we use the full test suite, filtered by labels, with Lucee light (i.e. without extensions, only the extension being tested), so any tests which use functions or tags from extensions won’t compile.