[FIX]: correct GitHub commit status when test output files are missing#1091
Open
x15sr71 wants to merge 2 commits intoCCExtractor:masterfrom
Open
[FIX]: correct GitHub commit status when test output files are missing#1091x15sr71 wants to merge 2 commits intoCCExtractor:masterfrom
x15sr71 wants to merge 2 commits intoCCExtractor:masterfrom
Conversation
329f2bd to
edeeee7
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Problem
progress_type_request()determined pass/fail for the GitHub commit status check using two raw SQL queries — one counting exit code mismatches, one counting non-nullTestResultFile.gotvalues. If the VM never wrote aTestResultFilerow at all (missing output, failed mid-run), both counts return 0 and the platform posts a fake ✅ SUCCESS to GitHub even though no output was ever compared.Fix
Replace the dual-query block with
get_test_results(test)— already used by the test detail page,update_build_badge, andget_info_for_pr_comment. It correctly treats a missing row as an error:The result is also passed into
update_build_badge()to avoid a redundant second call.Changes —
mod_ci/controllers.pyonly, no schema change:from sqlalchemy.sql.functions import countupdate_build_badge(status, test)→update_build_badge(status, test, test_results=None)— existing callers unaffectedget_test_results+any(category['error'] for category in test_results)Bot PR comments and test detail UI were already using
get_test_results— both unaffected.