Measure overall, testsuite and test duration#159
Conversation
|
Hi! Sorry for late reply. Thanks for looking into this. I really like this function. Is it possible that you could use the latest TwinCAT 3.1.4022.x to do the changes though? (according to https://github.com/tcunit/TcUnit/blob/master/CONTRIBUTING.md). What is the duration measured in? MS? Did you try to run the TcUnit-Verifier with the new version of TcUnit, just to check that no functionality has been broken? Edit: Cool initiative with struckig! I might use this myself. |
6902555 to
8c0589b
Compare
|
so, half a year later ... :-)
done, tested it on 4022.29
it was in microseconds before, but I changed to seconds, which is according to junit's specification or at least how the Jenkins plugins interprets it
Well, I would have prefered to only consider the duration in the xml output of TcUnit, but anyway ... I am on it, I will make a pull request in TcUnit-Runner as well
I ran TcUnit-Verifier, but I had to modify some stuff to get it working (change IDE and Twincat Version that is verified with), would you run it on your setup as well please? |
8c0589b to
2c5a5ff
Compare
|
Sorry for late response, been really busy lately... |
…e twincat errorlist
|
I added and changed some tests for the durations functionality |
TcUnit-Verifier/TcUnit-Verifier_DotNet/TcUnit-Verifier/FB_ExtendedTestInformation.cs
Show resolved
Hide resolved
TcUnit-Verifier/TcUnit-Verifier_DotNet/TcUnit-Verifier/TestFunctionBlockAssert.cs
Show resolved
Hide resolved
sagatowski
left a comment
There was a problem hiding this comment.
First of all, sorry for the long delay of reviewing this PR (as you may know, I'm spending all my spare-time on the TwinCAT YouTube course). Thanks for this awesome PR. I've added some review comments. Could you also look into the comment of @Navid-Mashayekh?
TcUnit-Verifier/TcUnit-Verifier_DotNet/TcUnit-Verifier/FB_ExtendedTestInformation.cs
Show resolved
Hide resolved
… times does not work
feat: use getcpucounter instead of getcpuaccount refactor: use a function for getting the cpucounter instead of directly calling the function block
Corrected parsing from/to float<->string so that Culture.InvariantCulture is used (Swedish for example uses "," instead of "." as comma-delimiter).
|
Better late than never. I did some minor corrections to your PR. Thank you so much for your contribution @stefanbesler. |
|
@stefanbesler Note that this new feature doesn't work with sequenced tests. Check this issue: #210. |
|
@stefanbesler I've also found a second issue with this PR. See #211. |
|
@stefanbesler |
This PR extends to code in a way to fill the "time" attribute of the junit xml specification. I haven't tested this extensively, but just want to let you know that I am on this and maybe you have some opinions and could do a code review on it? I am not completely fluent with TcUnit's structure and maybe there are better ways to include time measurements.
I am not sure if I have enough time at the moment for this as a side project, but in the end I want to extend TcUnit with benchmark capabilities. At the moment, one of my hobby projects is porting a trajectory generator to TwinCAT ( github project: struckig ) and I am using TcUnit for Unittesting . I think it would make sense to use it in a benchmark context as well by including test iterations and stuff like that (similar to what I have done without a library here (https://github.com/stefanbesler/struckig/tree/main/benchmark) ). My goal is to see potential regressions by utilizing a benchmark github action.