Skip to content
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
Crash Collison (tehcrashxor) merged 1 commit into
masterfrom
sanitize-test-result-output
Sep 3, 2026
Merged

Sanitize test result metadata before console output#36
Crash Collison (tehcrashxor) merged 1 commit into
masterfrom
sanitize-test-result-output

Conversation

@tehcrashxor

Copy link
Copy Markdown
Member

What

ReportResultsToDevOps writes 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.config was moved to Newtonsoft.Json 13.0.1, but the three project files still referenced Version=12.0.0.0 with a HintPath into Newtonsoft.Json.12.0.3. The reference silently failed to resolve, which surfaced as JObject being reported inaccessible. Reference version and HintPath now match the restored package.

Also included

  • The suite summary printed the passed count on the Tests Failed line.
  • Unit tests for the new helper (13 cases).

Notes

Ordinary result text is unchanged; only control characters are affected. Targets C# 7.3 so the vs2017-win2016 pool image documented in Samples/azure-pipelines.yml continues to build.

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>
@tehcrashxor
Crash Collison (tehcrashxor) merged commit 3a861ed into master Sep 3, 2026
6 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants