#63 xml Results file not being written to file system

v1.2.0.0
open
nobody
None
2023-04-10
2023-04-08
No

I am running my tests in Win Control 64 SL with the demo, so all should be good.

The file was not writing to C:. No error was shown in the log. the log even said that it had written it.

I thought maybe it was a file system permissions issues so I created a folder called temp, sets its permission to allow everyone read/write/modify access and updated the path in the library Parameter list.

It again says it wrote the file to the location I specified but nothing is there.

Discussion

  • hermsen

    hermsen - 2023-04-09

    1) If you keep the default directory, is the file written?
    => The anwser should be YES if the unittest doesn't hang (i.e all test finish regardless outcome).

    2) If you change the Default directory, is the file written?
    => If No:
    - check your PATH notation in CODESYS(!),
    - check the file write FB error messages,
    - check if the unittest doesn't hang (i.e all test finish regardless outcome).

    The XML file is only dumped at the end of all the tests.
    If the xml file is incomplete, assign a bigger filebuffer until the file is dumped correct.

    Let me know your outcome.

     

    Last edit: hermsen 2023-04-10
  • thecolonel26 - 2023-04-10

    I am confused.

    As I said in my post
    1. using the default directory which is set to 'C:\' in the library parameter list results in all log messages to the device log showing success. there are no error messages.
    2. Changing the directory to C:\Temp\ has the same result all show sucess, and no error mesages.

    but the xml file is not there in either case.

    This is the export of the log entries runing the test using the default path

    <LoggerEntries xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Logger name="coUnit">
    <Entry severity="error" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| ======================================</Entry>
    <Entry severity="error" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Location: C:\coUnit_xunit_testresults.xml</Entry>
    <Entry severity="error" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| ==========TEST RESULTS EXPORTED===========</Entry>
    <Entry severity="error" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| ======================================</Entry>
    <Entry severity="error" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Failed tests: 0</Entry>
    <Entry severity="error" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Successful tests: 7</Entry>
    <Entry severity="error" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Tests: 7</Entry>
    <Entry severity="error" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test suites: 2</Entry>
    <Entry severity="error" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| ==========TESTS FINISHED RUNNING==========</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test class name=Tests.Application.PRG_Test.inst_Test_Scale</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test name=Test_Scale.Down_In4095_OutTwenty</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test class name=Tests.Application.PRG_Test.inst_Test_Scale</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test name=Test_Scale.Down_In2047_5_OutTwelve</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test class name=Tests.Application.PRG_Test.inst_Test_Scale</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test name=Test_Scale.Down_In0_OutFour</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test class name=Tests.Application.PRG_Test.inst_Test_Scale</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test name=Test_Scale.Up_InTwenty_Out4095</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test class name=Tests.Application.PRG_Test.inst_Test_Scale</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test name=Test_Scale.Up_InTwelve_Out2047_5</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test class name=Tests.Application.PRG_Test.inst_Test_Scale</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test name=Test_Scale.Up_InFour_Out0</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test suite ID=1 'Tests.Application.PRG_Test.inst_Test_Scale'</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test class name=Tests.Application.PRG_Test.inst_Test_Wago_750_455</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test name=Test_Wago_750_450.InputEqualsZero</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test suite ID=0 'Tests.Application.PRG_Test.inst_Test_Wago_750_455'</Entry>
    </Logger>
    </LoggerEntries>
    

    This is the export of the log entries with a differnt path (C:\Temp), set to allow full access to the directory

    <LoggerEntries xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Logger name="coUnit">
    <Entry severity="error" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| ======================================</Entry>
    <Entry severity="error" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Location: C:\coUnit_xunit_testresults.xml</Entry>
    <Entry severity="error" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| ==========TEST RESULTS EXPORTED===========</Entry>
    <Entry severity="error" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| ======================================</Entry>
    <Entry severity="error" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Failed tests: 0</Entry>
    <Entry severity="error" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Successful tests: 7</Entry>
    <Entry severity="error" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Tests: 7</Entry>
    <Entry severity="error" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test suites: 2</Entry>
    <Entry severity="error" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| ==========TESTS FINISHED RUNNING==========</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test class name=Tests.Application.PRG_Test.inst_Test_Scale</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test name=Test_Scale.Down_In4095_OutTwenty</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test class name=Tests.Application.PRG_Test.inst_Test_Scale</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test name=Test_Scale.Down_In2047_5_OutTwelve</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test class name=Tests.Application.PRG_Test.inst_Test_Scale</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test name=Test_Scale.Down_In0_OutFour</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test class name=Tests.Application.PRG_Test.inst_Test_Scale</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test name=Test_Scale.Up_InTwenty_Out4095</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test class name=Tests.Application.PRG_Test.inst_Test_Scale</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test name=Test_Scale.Up_InTwelve_Out2047_5</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test class name=Tests.Application.PRG_Test.inst_Test_Scale</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test name=Test_Scale.Up_InFour_Out0</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test suite ID=1 'Tests.Application.PRG_Test.inst_Test_Scale'</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test class name=Tests.Application.PRG_Test.inst_Test_Wago_750_455</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test name=Test_Wago_750_450.InputEqualsZero</Entry>
    <Entry severity="information" component="coUnit" user="nobody" timestamp="4/10/2023 2:16:56 PM" infoId="0">| Test suite ID=0 'Tests.Application.PRG_Test.inst_Test_Wago_750_455'</Entry>
    </Logger>
    </LoggerEntries>
    
     

    Last edit: thecolonel26 2023-04-10
  • thecolonel26 - 2023-04-10

    Wait I found it. It seems it ignores the "C:\"

    I changed the path to just the file name 'coUnit_xunit_testresults.xml' and then I found it written to

    C:\ProgramData\CODESYS\CODESYSControlWinV3x64\B4A102F1\PlcLogic

    Is is rather confusing.

    Where is it writing to if I put C:\ on it? it says it is suceeding.

     

    Last edit: thecolonel26 2023-04-10
  • hermsen

    hermsen - 2023-04-10

    you are most likely affected by this security fix: Codesys Advisory 2023-01
    get the files from Program data or change that setting (Forceiecfilepath) to zero.

    hope this gives you enough hints

     

    Last edit: hermsen 2023-04-10

Log in to post a comment.