tcunit / TcUnit-Runner

Program that makes it possible to automate runs of TcUnit unit tests
Other
34 stars 17 forks source link

Check if TwinCAT project is pinned #9

Closed Beidendorfer closed 3 years ago

Beidendorfer commented 3 years ago

If it is a pinned version, check if this Version is available otherwise close the solution

Bug fixed: First set the SilentMode and then try to open the Remote Manager otherwise the remoteManger can show a MessageBox

Beidendorfer commented 3 years ago

In this test the project is pinned and a version 4022.29is not available The programme is aborted.

2020-10-02 07:31:46 - TcUnit-Runner build: 0.9.2.0 2020-10-02 07:31:46 - TcUnit-Runner build date: 25/10/2020 2020-10-02 07:31:46 - Visual Studio solution path: C:\Git_Repos\Unit Test\CM_CylinderModul_UnitTest.sln 2020-10-02 07:31:46 - 2020-10-02 07:31:46 - In TwinCAT project file, found TwinCAT version 3.1.4022.29 2020-10-02 07:31:46 - In Visual Studio solution file, found visual studio version 15.0 2020-10-02 07:31:46 - Version is pinned: True 2020-10-02 07:31:46 - Trying to load the Visual Studio Development Tools Environment (DTE) version 'TcXaeShell.DTE.15.0' ... 2020-10-02 07:32:06 - ...SUCCESSFUL! 2020-10-02 07:32:21 - Using the TwinCAT remote manager to load TwinCAT version '3.1.4022.29'... 2020-10-02 07:32:22 - Project has a pinned Version : 3.1.4022.29 2020-10-02 07:32:23 - the pinned TC Version is not available 2020-10-02 07:32:23 - ERROR: Error loading VS DTE. Is the correct version of Visual Studio and TwinCAT installed? Is the TcUnit-Runner running with administrator privileges? 2020-10-02 07:32:23 - Exiting application...<

In this test the project is pinned and a version 4022.30 is available The programme runs correct

2020-10-02 07:33:57 - TcUnit-Runner build: 0.9.2.0 2020-10-02 07:33:57 - TcUnit-Runner build date: 25/10/2020 2020-10-02 07:33:57 - Visual Studio solution path: C:\Git_Repos\Unit Test\CM_CylinderModul_UnitTest.sln 2020-10-02 07:33:57 - 2020-10-02 07:33:57 - In TwinCAT project file, found TwinCAT version 3.1.4022.30 2020-10-02 07:33:57 - In Visual Studio solution file, found visual studio version 15.0 2020-10-02 07:33:57 - Version is pinned: True 2020-10-02 07:33:57 - Trying to load the Visual Studio Development Tools Environment (DTE) version 'TcXaeShell.DTE.15.0' ... 2020-10-02 07:34:17 - ...SUCCESSFUL! 2020-10-02 07:34:35 - Using the TwinCAT remote manager to load TwinCAT version '3.1.4022.30'... 2020-10-02 07:34:35 - Project has a pinned Version : 3.1.4022.30 2020-10-02 07:34:36 - the pinned TC Version is available 2020-10-02 07:34:57 - load TwinCAT version 2020-10-02 07:36:24 - No task name provided. Assuming only one task exists 2020-10-02 07:36:25 - Found task with name 'PlcTask' 2020-10-02 07:37:22 - Setting target NetId to '127.0.0.1.1.1' 2020-10-02 07:37:22 - Enabling boot project and setting BootProjectAutostart on 127.0.0.1.1.1 2020-10-02 07:38:16 - Waiting for results from TcUnit... 2020-10-02 07:38:26 - ... got 1 report lines so far. 2020-10-02 07:38:37 - ... got 178 report lines so far. 2020-10-02 07:38:48 - ... got 456 report lines so far. 2020-10-02 07:38:49 - All results from TcUnit obtained 2020-10-02 07:39:00 - Done collecting TC results 2020-10-02 07:39:00 - Writing xUnit XML file to C:\Git_Repos\Unit Test\TcUnit_xUnit_results.xml 2020-10-02 07:39:00 - Closing the Visual Studio Development Tools Environment (DTE)... 2020-10-02 07:39:20 - Exiting application... <

In this test the project is not pinned and a version 4022.29 is not available The programme runs correct with Version 4022.32

2020-10-02 07:47:45 - TcUnit-Runner build: 0.9.2.0 2020-10-02 07:47:45 - TcUnit-Runner build date: 25/10/2020 2020-10-02 07:47:45 - Visual Studio solution path: C:\Git_Repos\Unit Test\CM_CylinderModul_UnitTest.sln 2020-10-02 07:47:45 - 2020-10-02 07:47:45 - In TwinCAT project file, found TwinCAT version 3.1.4022.29 2020-10-02 07:47:45 - In Visual Studio solution file, found visual studio version 15.0 2020-10-02 07:47:45 - Version is pinned: False 2020-10-02 07:47:45 - Trying to load the Visual Studio Development Tools Environment (DTE) version 'TcXaeShell.DTE.15.0' ... 2020-10-02 07:48:08 - ...SUCCESSFUL! 2020-10-02 07:48:21 - Using the TwinCAT remote manager to load TwinCAT version '3.1.4022.29'... 2020-10-02 07:48:35 - Load TwinCAT version: 3.1.4022.32 2020-10-02 07:49:55 - No task name provided. Assuming only one task exists 2020-10-02 07:49:56 - Found task with name 'PlcTask' 2020-10-02 07:50:46 - Setting target NetId to '127.0.0.1.1.1' 2020-10-02 07:50:46 - Enabling boot project and setting BootProjectAutostart on 127.0.0.1.1.1 2020-10-02 07:51:37 - Waiting for results from TcUnit... 2020-10-02 07:51:47 - ... got 1 report lines so far. 2020-10-02 07:51:57 - ... got 198 report lines so far. 2020-10-02 07:52:08 - ... got 456 report lines so far. 2020-10-02 07:52:09 - All results from TcUnit obtained 2020-10-02 07:52:20 - Done collecting TC results 2020-10-02 07:52:20 - Writing xUnit XML file to C:\Git_Repos\Unit Test\TcUnit_xUnit_results.xml 2020-10-02 07:52:20 - Closing the Visual Studio Development Tools Environment (DTE)... 2020-10-02 07:52:40 - Exiting application... <

Beidendorfer commented 3 years ago

What is the best way to continue? @sagatowski What is your recommendation.

sagatowski commented 3 years ago

In this test the project is pinned and a version 4022.29is not available The programme is aborted.

2020-10-02 07:31:46 - TcUnit-Runner build: 0.9.2.0 2020-10-02 07:31:46 - TcUnit-Runner build date: 25/10/2020 2020-10-02 07:31:46 - Visual Studio solution path: C:\Git_Repos\Unit Test\CM_CylinderModul_UnitTest.sln 2020-10-02 07:31:46 - 2020-10-02 07:31:46 - In TwinCAT project file, found TwinCAT version 3.1.4022.29 2020-10-02 07:31:46 - In Visual Studio solution file, found visual studio version 15.0 2020-10-02 07:31:46 - Version is pinned: True 2020-10-02 07:31:46 - Trying to load the Visual Studio Development Tools Environment (DTE) version 'TcXaeShell.DTE.15.0' ... 2020-10-02 07:32:06 - ...SUCCESSFUL! 2020-10-02 07:32:21 - Using the TwinCAT remote manager to load TwinCAT version '3.1.4022.29'... 2020-10-02 07:32:22 - Project has a pinned Version : 3.1.4022.29 2020-10-02 07:32:23 - the pinned TC Version is not available 2020-10-02 07:32:23 - ERROR: Error loading VS DTE. Is the correct version of Visual Studio and TwinCAT installed? Is the TcUnit-Runner running with administrator privileges? 2020-10-02 07:32:23 - Exiting application...<

In this test the project is pinned and a version 4022.30 is available The programme runs correct

2020-10-02 07:33:57 - TcUnit-Runner build: 0.9.2.0 2020-10-02 07:33:57 - TcUnit-Runner build date: 25/10/2020 2020-10-02 07:33:57 - Visual Studio solution path: C:\Git_Repos\Unit Test\CM_CylinderModul_UnitTest.sln 2020-10-02 07:33:57 - 2020-10-02 07:33:57 - In TwinCAT project file, found TwinCAT version 3.1.4022.30 2020-10-02 07:33:57 - In Visual Studio solution file, found visual studio version 15.0 2020-10-02 07:33:57 - Version is pinned: True 2020-10-02 07:33:57 - Trying to load the Visual Studio Development Tools Environment (DTE) version 'TcXaeShell.DTE.15.0' ... 2020-10-02 07:34:17 - ...SUCCESSFUL! 2020-10-02 07:34:35 - Using the TwinCAT remote manager to load TwinCAT version '3.1.4022.30'... 2020-10-02 07:34:35 - Project has a pinned Version : 3.1.4022.30 2020-10-02 07:34:36 - the pinned TC Version is available 2020-10-02 07:34:57 - load TwinCAT version 2020-10-02 07:36:24 - No task name provided. Assuming only one task exists 2020-10-02 07:36:25 - Found task with name 'PlcTask' 2020-10-02 07:37:22 - Setting target NetId to '127.0.0.1.1.1' 2020-10-02 07:37:22 - Enabling boot project and setting BootProjectAutostart on 127.0.0.1.1.1 2020-10-02 07:38:16 - Waiting for results from TcUnit... 2020-10-02 07:38:26 - ... got 1 report lines so far. 2020-10-02 07:38:37 - ... got 178 report lines so far. 2020-10-02 07:38:48 - ... got 456 report lines so far. 2020-10-02 07:38:49 - All results from TcUnit obtained 2020-10-02 07:39:00 - Done collecting TC results 2020-10-02 07:39:00 - Writing xUnit XML file to C:\Git_Repos\Unit Test\TcUnit_xUnit_results.xml 2020-10-02 07:39:00 - Closing the Visual Studio Development Tools Environment (DTE)... 2020-10-02 07:39:20 - Exiting application... <

In this test the project is not pinned and a version 4022.29 is not available The programme runs correct with Version 4022.32

2020-10-02 07:47:45 - TcUnit-Runner build: 0.9.2.0 2020-10-02 07:47:45 - TcUnit-Runner build date: 25/10/2020 2020-10-02 07:47:45 - Visual Studio solution path: C:\Git_Repos\Unit Test\CM_CylinderModul_UnitTest.sln 2020-10-02 07:47:45 - 2020-10-02 07:47:45 - In TwinCAT project file, found TwinCAT version 3.1.4022.29 2020-10-02 07:47:45 - In Visual Studio solution file, found visual studio version 15.0 2020-10-02 07:47:45 - Version is pinned: False 2020-10-02 07:47:45 - Trying to load the Visual Studio Development Tools Environment (DTE) version 'TcXaeShell.DTE.15.0' ... 2020-10-02 07:48:08 - ...SUCCESSFUL! 2020-10-02 07:48:21 - Using the TwinCAT remote manager to load TwinCAT version '3.1.4022.29'... 2020-10-02 07:48:35 - Load TwinCAT version: 3.1.4022.32 2020-10-02 07:49:55 - No task name provided. Assuming only one task exists 2020-10-02 07:49:56 - Found task with name 'PlcTask' 2020-10-02 07:50:46 - Setting target NetId to '127.0.0.1.1.1' 2020-10-02 07:50:46 - Enabling boot project and setting BootProjectAutostart on 127.0.0.1.1.1 2020-10-02 07:51:37 - Waiting for results from TcUnit... 2020-10-02 07:51:47 - ... got 1 report lines so far. 2020-10-02 07:51:57 - ... got 198 report lines so far. 2020-10-02 07:52:08 - ... got 456 report lines so far. 2020-10-02 07:52:09 - All results from TcUnit obtained 2020-10-02 07:52:20 - Done collecting TC results 2020-10-02 07:52:20 - Writing xUnit XML file to C:\Git_Repos\Unit Test\TcUnit_xUnit_results.xml 2020-10-02 07:52:20 - Closing the Visual Studio Development Tools Environment (DTE)... 2020-10-02 07:52:40 - Exiting application... <

Looks good @Beidendorfer !

sagatowski commented 3 years ago

What is the best way to continue? @sagatowski What is your recommendation.

@Beidendorfer Just update the code according to the comments above! I will do some internal testing and then I will merge your changes to the main. Thanks a lot!

sagatowski commented 3 years ago

Hi @Beidendorfer, impressive work! I'll look at this now.

sagatowski commented 3 years ago

@Beidendorfer, I tried to compile the program but I get several compile-errors. Did you forget to push some changes? image

sagatowski commented 3 years ago

@Beidendorfer It seems there was just one questionmark too much in the code. I've removed it and now it compiles.

sagatowski commented 3 years ago

@Beidendorfer Thanks for your contribution!