#3303 Lux unit test fails when checking property values set using a type 51 custom action

v4.0
migrated
nobody
Lux (2)
2015-01-08
2013-05-29
icnocop
No

Hi.

Lux unit test fails when checking property values set using a type 51 custom action.

Windows 7 Enterprise 64-bit SP1

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:lux="http://schemas.microsoft.com/wix/2009/Lux">
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir" />
<CustomAction Id="SetProperty" Property="PropertyName" Value="PropertyValue" Execute="immediate" />
<lux:UnitTest CustomAction="SetProperty" Property="PropertyName" Value="PropertyValue" Operator="equal" />
</Fragment>
</Wix>

Running with 3.5.2430.0 and 3.6.3303.0:

nit.exe : error NIT8103 : Test luxFE00466110E1E8399A3E9EFEE8EC845E failed: Property 'PropertyName' expected value 'PropertyValue' but actual value was ''.
nit.exe : error NIT8102 : 1 tests failed. 0 tests passed.

Running with 3.8.520.0:

nit.exe : error NIT8104 : Package failed: Fatal error during installation.
nit.exe : error NIT8102 : 1 tests failed. 0 tests passed.

In all instances, nit.exe exited with return code 8102.

I tried explicitly defining the property as follows:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:lux="http://schemas.microsoft.com/wix/2009/Lux">
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir" />
<Property Id="PropertyName" Value="PropertyValueToReplace" />
<CustomAction Id="SetProperty" Property="PropertyName" Value="PropertyValue" Execute="immediate" />
<lux:UnitTest CustomAction="SetProperty" Property="PropertyName" Value="PropertyValue" Operator="equal" />
</Fragment>
</Wix>

Running with 3.5.2430.0 and 3.6.3303.0:

nit.exe : error NIT8103 : Test luxFE00466110E1E8399A3E9EFEE8EC845E failed: Property 'PropertyName' expected value 'PropertyValue' but actual value was 'PropertyValueToReplace'.
nit.exe : error NIT8102 : 1 tests failed. 0 tests passed.

Running with 3.8.520.0:

nit.exe : error NIT8104 : Package failed: Fatal error during installation.
nit.exe : error NIT8102 : 1 tests failed. 0 tests passed.

Discussion

  • icnocop

    icnocop - 2013-05-29

    Sorry, I had a little misunderstanding on using the Lux unit test framework.

    I didn't schedule the custom action in the InstallExecuteSequence and so that's why the property was not set.

    However, I got confused from this requirement because of some other (now realized unexpected) behavior.

    Here is some example code that illustrates the unexpected behavior:

    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:lux="http://schemas.microsoft.com/wix/2009/Lux">
    <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir" />
    <CustomAction Id="CustomAction1" Property="Property1" Value="Value1" Execute="immediate" />
    <CustomAction Id="CustomAction2" Property="Property2" Value="Value2" Execute="immediate" />
    <Property Id="Property1" Value="[Property2]" />
    <Property Id="Property2" Value="_Value2" />
    <lux:UnitTest CustomAction="CustomAction1" Property="Property1" Value="[Property2]" Operator="equal" />
    <lux:UnitTest CustomAction="CustomAction2" Property="Property1" Value="_Value2" Operator="equal" />
    </Fragment>
    </Wix>
    

    Test lux43546C624A69F85AB7AC8BDD9409CE61 passed: Property 'Property1' matched expected value '[Property2]'.
    Test lux6F15CE0ABF7C9B6EA43A2C41FFC35C86 passed: Property 'Property1' matched expected value '_Value2'.
    All 2 tests passed.

    So it seems that the <lux:UnitTest/> element behaves like a type 51 custom action; it will set the value of Property1 to the value of Property2.

    I did not expect that to be the case; the element should just check the value for equality and not behave like a type 51 custom action.

    Thank you.

     
  • Rob Mensching

    Rob Mensching - 2013-08-21
    • Status: open --> migrated