Programming exercises: C/C++ build failures are not detected correctly
#12026
+17
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
General
Changes affecting Programming Exercises
Motivation and Context
Fixes #11776. The build failure detection does not work for C/C++ code, as it assumes that the static code analysis fails. However, this does not cover all build failure cases.
Is this expected behaviour?
Is there any reason why this was not introduced previously? Did I miss something?
Description
Currently, there is almost no way to trigger the build failed state when grading C/C++ exercises. As a consequence, the build output is almost never shown to the user.
The ProgrammingExerciseGradingService only checks if there are static code analysis errors or no test cases have been run at all. For C/C++ exercises, as soon as CMake is successful, the TestConfigure test case (see Python C build pipeline) is automatically succesfull, therefore not triggering the ProgrammingExerciseGradingService build failed check.
In addition to the static code analysis, a regex checks the result submission feedback list for any build or make failure entries. If it finds any, the build is marked as failed. This works for C and C++ programming exercises and shows the compilation error to the user.
Steps for Testing
Prerequisites:
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.