This repository was archived by the owner on Sep 3, 2026. It is now read-only.
Sanitize test result metadata before console output - #36
Merged
Conversation
Test suite and test case metadata returned by the app under test is written directly to standard output. Values are now normalized to a single line before they are logged, so result text cannot affect the structure of the build log. Also included: - Correct the Newtonsoft.Json assembly reference. packages.config was moved to 13.0.1 but the project files still pointed at 12.0.3, so the reference did not resolve and the solution did not build. - Correct the suite summary, which reported the passed count on the "Tests Failed" line. - Add unit tests for the new helper. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Mike Hung (mikehung-ms)
approved these changes
Sep 3, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What
ReportResultsToDevOpswrites test suite and test case metadata — names, descriptions and failure messages — straight to standard output. Those values come from the app under test, so their content isn't controlled by the pipeline running them.This routes them through a helper that flattens each value to a single line before logging. Both the test case and the test suite branches are covered.
Build fix
The solution did not build from a clean clone.
packages.configwas moved to Newtonsoft.Json 13.0.1, but the three project files still referencedVersion=12.0.0.0with a HintPath intoNewtonsoft.Json.12.0.3. The reference silently failed to resolve, which surfaced asJObjectbeing reported inaccessible. Reference version and HintPath now match the restored package.Also included
Tests Failedline.Notes
Ordinary result text is unchanged; only control characters are affected. Targets C# 7.3 so the
vs2017-win2016pool image documented inSamples/azure-pipelines.ymlcontinues to build.