Commit 224256c
Use simctl --json-output flag to avoid stdout pollution (#170)
* Initial plan
* fix: route ConsoleLogger Info/Warning/Debug to stderr instead of stdout
LogInfo, LogWarning, and LogDebug in ConsoleLogger now use
Console.Error.WriteLine (stderr) instead of Console.WriteLine (stdout).
This prevents log messages from polluting structured output (e.g. JSON)
for consumers that capture stdout.
Fixes #2
Agent-Logs-Url: https://github.com/dotnet/macios-devtools/sessions/005240a3-2797-4f5f-865c-c920f0723994
Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
* final progress update
Agent-Logs-Url: https://github.com/dotnet/macios-devtools/sessions/005240a3-2797-4f5f-865c-c920f0723994
Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
* remove accidentally committed .nuget/nuget.exe and add .nuget/ to .gitignore
Agent-Logs-Url: https://github.com/dotnet/macios-devtools/sessions/005240a3-2797-4f5f-865c-c920f0723994
Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
* revert ConsoleLogger stderr changes; add SimCtl.RunToFile for file-based output
Per reviewer feedback: writing to stderr breaks MSBuild tasks. Instead,
add SimCtl.RunToFile() so consumers can capture structured output (JSON)
to a file, isolating it from any stdout noise.
Agent-Logs-Url: https://github.com/dotnet/macios-devtools/sessions/2bbfd1eb-7c88-49ed-8bb9-6e335c369cee
Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
* address code review: use IsNullOrWhiteSpace and handle file write exceptions
Agent-Logs-Url: https://github.com/dotnet/macios-devtools/sessions/2bbfd1eb-7c88-49ed-8bb9-6e335c369cee
Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
* remove .nuget/nuget.exe and add .nuget/ to .gitignore
Agent-Logs-Url: https://github.com/dotnet/macios-devtools/sessions/2bbfd1eb-7c88-49ed-8bb9-6e335c369cee
Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
* Use simctl --json-output flag instead of capturing stdout
Per reviewer feedback, use xcrun simctl's native --json-output=<file>
flag to write structured JSON output directly to a temp file, instead
of capturing stdout and writing it ourselves.
- Revert RunToFile/RunCore approach back to original Run() method
- Add RunJson() that passes --json --json-output=<tempPath> to simctl
and reads the result from the temp file
- Update SimulatorService, RuntimeService, and tests to use RunJson()
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix test runner: add Microsoft.NET.Test.Sdk, downgrade NUnit3TestAdapter to 4.6.0
NUnit3TestAdapter 5.0.0 pulled in Microsoft.Testing.Platform which brought
a broken transitive dependency chain (ApplicationInsights, Telemetry DLLs
not copied to output). Downgrade to 4.6.0 to avoid the Testing Platform
migration issues.
Add Microsoft.NET.Test.Sdk (implicitly referenced by .NET SDK) and
CopyLocalLockFileAssemblies to ensure all test dependencies are resolved
at runtime. Remove NUnit.ConsoleRunner (unused with dotnet test).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address review: use GetTempFileName and check Run() result in RunJson
- Use Path.GetTempFileName() instead of GetRandomFileName() to
atomically reserve the temp file path (avoids race condition).
- Check Run() return value before reading the file, so simctl
failures surface the correct error instead of a misleading
'no JSON output file' message.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix TestHelper.ProjectDir to find source tests dir, not build output
The walk-up logic stopped at artifacts/bin/tests/ (first dir named
'tests') instead of the source tests/ directory. Fix by requiring
tests.csproj to exist as a sentinel, disambiguating the source
directory from the Arcade SDK output layout.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix CI: suppress NETSDK1023/NU1504 for Microsoft.NET.Test.Sdk
The explicit PackageReference is needed for testhost.runtimeconfig.json,
but .NET SDK 10.0+ implicitly references it causing duplicate errors.
Suppress NETSDK1023 and NU1504 in the test project.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Restore NUnit3TestAdapter to 5.0.0; no downgrade needed with explicit Microsoft.NET.Test.Sdk
Tested: build succeeds and 118/119 tests pass (1 skipped) with NUnit3TestAdapter
5.0.0 + Microsoft.NET.Test.Sdk 17.12.0.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
Co-authored-by: Rui Marinho <me@ruimarinho.net>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 0c544e8 commit 224256c
7 files changed
Lines changed: 46 additions & 4 deletions
File tree
- Xamarin.MacDev
- eng
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
60 | 96 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
382 | | - | |
| 382 | + | |
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
| 17 | + | |
13 | 18 | | |
14 | 19 | | |
15 | 20 | | |
16 | 21 | | |
17 | 22 | | |
18 | | - | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
0 commit comments