Closed MartinSalinas98 closed 3 weeks ago
tee command does not seem to be properly creating the file then running ctest (works with other commands). Will have to replicate this locally
This already works, what do you think @oierlauzi, would it be useful to have this logs shown dynamically in case of memory leaks & stop the pipeline to make sure no new leaks enter the main branch?
When you have checked this is correct, I will, locally, reset all changes to reflect main, and then add only the changes in the pipeline, leaving out all the leaky code and removing a lot of commits to leave the history clean
What do you mean with "stop the pipeline". I would not merge any code that is leaking.
Stop the pipeline means to cause the pipeline to throw an error, therefore returning "red", and not passing the status checks (exit code != 0).
By default ctest with valgrind lets you know that there are memory leaks, but still returns 0, so if you don't enter the log specifically looking for it, you will miss it and merge it.
What my PR does (the part that modifies github action files) is that, if there are any memleaks shown by ctest, it will open the log of each affected test in a separate step (Show test with memory leaks), and do exit false
(somewhat like return 1
) so the pipeline stops with an erro an does not allow to merge.
Great! In this way its almost impossible to merge leaky code
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Maybe could we simplify code instructing valgrind to return a non-zero return code on failure? https://stackoverflow.com/questions/55321934/how-to-let-cmake-ctest-memcheck-exit-with-status-code-1-on-failure
Maybe could we simplify code instructing valgrind to return a non-zero return code on failure? https://stackoverflow.com/questions/55321934/how-to-let-cmake-ctest-memcheck-exit-with-status-code-1-on-failure
There are two issues with that.
Maybe could we simplify code instructing valgrind to return a non-zero return code on failure? https://stackoverflow.com/questions/55321934/how-to-let-cmake-ctest-memcheck-exit-with-status-code-1-on-failure
There are two issues with that.
1. It's not on valgrind, [it's on ctest](https://stackoverflow.com/questions/55321934/how-to-let-cmake-ctest-memcheck-exit-with-status-code-1-on-failure#comment97378412_55324752). 2. Even if it worked as intended, it would not show the logs of the affected tests, which means the developer would need to reproduce it locally.
I would merge this code and see later if it can be simplified
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
@oierlauzi could you add the code causing the memleak? (so i can try to detect it and print the logs). I was planning to revert to a commit before it got fixed, but the squash merge denied my plans.