Skip to content

Show colors in AzDo and GH actions #5535

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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Conversation

nohwnd
Copy link
Member

@nohwnd nohwnd commented Apr 28, 2025

image

@@ -83,7 +84,7 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.
using Microsoft.Testing.Platform.Extensions.Messages;
using Microsoft.Testing.Platform.Extensions.TestFramework;

if (args.Length == 0)
if (!args.Contains("--exit-on-process-exit"))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test assumed no args, but we now set --no-progress --no-ansi, so it never got setup, and was just sitting there stuck.

@@ -93,7 +94,7 @@ public sealed class TestAssetFixture() : TestAssetFixtureBase(AcceptanceFixture.
Environment.SetEnvironmentVariable("WaitTestHost", mutexName);
ProcessStartInfo processStartInfo = new();
processStartInfo.FileName = currentEntryPoint;
processStartInfo.Arguments = $"--exit-on-process-exit {currentPid}";
processStartInfo.Arguments = $"--exit-on-process-exit {currentPid} --no-progress --no-ansi";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the parameters here so we don't end up writing into the output.

@@ -48,7 +48,8 @@ public void ExitOnProcessExit_Succeed(string tfm)
startTime = Stopwatch.StartNew();
while (!process.HasExited)
{
if (startTime.Elapsed.TotalSeconds > 55)
Thread.Sleep(1000);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid the tight loop that checks for process exit to save cpu.

@nohwnd
Copy link
Member Author

nohwnd commented Apr 28, 2025

So far I am only butchering the ansi output, I will need to:

  • extract the progress rendering from non-ansi output
  • extract progress rendering from ansi ouitput
  • add parameter to ansi output to use appropriate progress renderer
  • add test for the output
  • add some test to write the output to azdo for quicker development and visual check
  • do this also to dotnet test implementation in sdk so we can consume it here

@nohwnd nohwnd self-assigned this Apr 28, 2025
@nohwnd
Copy link
Member Author

nohwnd commented Apr 28, 2025

image
The colors render which is good.

@nohwnd nohwnd marked this pull request as ready for review April 30, 2025 10:04
@codecov-commenter
Copy link

codecov-commenter commented Apr 30, 2025

Codecov Report

Attention: Patch coverage is 55.11364% with 79 lines in your changes missing coverage. Please review.

Project coverage is 73.94%. Comparing base (d1c3780) to head (56783dc).

Files with missing lines Patch % Lines
...atform/OutputDevice/Terminal/SimpleTerminalBase.cs 26.47% 75 Missing ⚠️
...form/OutputDevice/Terminal/TerminalTestReporter.cs 85.18% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5535      +/-   ##
==========================================
- Coverage   76.49%   73.94%   -2.56%     
==========================================
  Files         602      604       +2     
  Lines       36472    36516      +44     
==========================================
- Hits        27901    27000     -901     
- Misses       8571     9516     +945     
Flag Coverage Δ
Debug 73.94% <55.11%> (-2.56%) ⬇️
integration 73.94% <55.11%> (-2.56%) ⬇️
production 73.94% <55.11%> (-2.56%) ⬇️
unit 73.94% <55.11%> (-2.56%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...utDevice/Terminal/AnsiTerminalTestProgressFrame.cs 83.69% <100.00%> (ø)
....Platform/OutputDevice/Terminal/NonAnsiTerminal.cs 58.13% <100.00%> (-24.96%) ⬇️
...atform/OutputDevice/Terminal/SimpleAnsiTerminal.cs 100.00% <100.00%> (ø)
...tputDevice/Terminal/TerminalTestReporterOptions.cs 100.00% <100.00%> (ø)
...ting.Platform/OutputDevice/TerminalOutputDevice.cs 80.77% <100.00%> (-2.25%) ⬇️
...form/OutputDevice/Terminal/TerminalTestReporter.cs 78.91% <85.18%> (-1.30%) ⬇️
...atform/OutputDevice/Terminal/SimpleTerminalBase.cs 26.47% <26.47%> (ø)

... and 63 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nohwnd
Copy link
Member Author

nohwnd commented Apr 30, 2025

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nohwnd nohwnd changed the title Try using ansi in azdo, it should accept 4bit colors. Show colors in AzDo and GH actions Apr 30, 2025
@nohwnd nohwnd enabled auto-merge (squash) April 30, 2025 14:44
Copy link
Member Author

@nohwnd nohwnd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge after snap to 3.9

@nohwnd
Copy link
Member Author

nohwnd commented May 16, 2025

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants