Since properties are immutable, this is a little more fun.

 

<target name="codecov" depends="codecov-start" failonerror=”true”>

            <property name=”codecov” value=”true”/>

            <call target=”test”/>

            <call target=”codecov-stop”/>

</target>

 

<target name="test" depends="locate-nunit" failonerror=”true”>

            <!—do some stuff that may fail à

<target/>

 

What I need to do with the above snippet is change test’s failonerror to TRUE when not doing code coverage, but to FALSE when doing codecoverage, then pass the fail back to codecov to propogate out. Basically like catching and rethrowing an exception.

 

If “codecov-stop” is not called, then code coverage collection remains on for the machine.


The expectation is to automate this, and sometimes, the combination of the code coverage tool interferes with app timing and causes spurious failures. In that case, I need to call codecov-stop to halt all data collection, but still fail so that we realize the values we’ve collected are not the values we want to keep (and put them in an alternate bucket).

 

I’m trying to avoid just cutting <test> and pasting it to <codecov-test> with failonerror=”false”. That would be a partial workaround at best anyways (build still needs to fail in the end to satisfy the failed condition).

 

Thanks!,

Eric

Reply via email to