-
Notifications
You must be signed in to change notification settings - Fork 632
[CI] Post test summaries to GitHub Checks #9587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: radical <[email protected]>
… show successful tests Co-authored-by: radical <[email protected]>
Introduce the artificial test failures again, so I can manually confirm the Github Checks output. |
Co-authored-by: radical <[email protected]>
I've reintroduced the artificial test failures in both test projects to allow manual validation of the GitHub Checks integration. The failing tests are now present in Aspire.Seq.Tests and Aspire.StackExchange.Redis.Tests projects. Commit: 2445da9 Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:If you need me to access, download, or install something from one of these locations, you can either:
|
@@ -0,0 +1,19 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this new tool use the gh api
command to create the Check. Here is an example:
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/OWNER/REPO/check-runs \
-f "name=mighty_readme" -f "head_sha=ce587453ced02b1526dfb4cb910479d431683101" -f "status=in_progress" -f "external_id=42" -f "started_at=2018-05-04T01:14:52Z" -f "output[title]=Mighty Readme report" -f "output[summary]=" -f "output[text]="
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, run the command with verbose logging. And use a prefix of CHECKTEST
for the checkname
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've replaced the custom PostTestSummaryToCheck tool with gh api
commands as requested. The workflow now uses the GitHub CLI directly to create checks with verbose logging and the "CHECKTEST" prefix. Commit: 95b8c17
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added verbose logging with --verbose
flag and implemented "CHECKTEST" prefix for check names. The workflow now shows detailed information including check name, repository, commit SHA, conclusion, and summary length. Commit: 95b8c17
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too much powershell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplified the implementation by replacing the 120+ line PowerShell script with a dedicated C# tool. The workflow now uses a simple shell command instead of complex PowerShell logic, reducing the workflow from 113 lines to 8 lines. Commit: e7c020d
…ose logging Co-authored-by: radical <[email protected]>
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:If you need me to access, download, or install something from one of these locations, you can either:
|
…edicated C# tool Co-authored-by: davidfowl <[email protected]>
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
@copilot You can ignore this comment. Looks like we could use https://docs.github.com/en/rest/checks/runs?apiVersion=2022-11-28#create-a-check-run or https://docs.github.com/en/rest/commits/statuses?apiVersion=2022-11-28#create-a-commit-status . But permissions for creating these are needed. IIUC, options are:
|
Understood, I'm ignoring this comment as requested. The current implementation is ready for testing the GitHub Checks integration with the artificial test failures that are currently in place. |
This PR implements a solution to make failed test summaries accessible directly from PR Checks pages, addressing the issue where test failures were only visible in workflow summaries.
Problem
PRs use the Tests workflow from
run-tests.yml
for validation. When test jobs fail, summaries are generated in the workflow Summary, but this information is not directly accessible from the PR's Checks page, making it harder for reviewers to quickly see what tests failed.Solution
1. New PostTestSummaryToCheck Tool
Created a new tool (
tools/PostTestSummaryToCheck/
) that:TestSummaryGenerator
logic to maintain consistencysuccess
/failure
) based on test results2. Enhanced Workflow Integration
Modified
run-tests.yml
to include a new step that:3. Minimal Changes Approach
TestSummaryGenerator
class public (1 line change)Example Output
When test jobs complete, GitHub Checks will show:
For Failed Tests:
For Successful Tests:
Testing
This change makes test failure information immediately accessible from PR Checks pages while maintaining all existing test summary functionality.
Fixes #9586.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.