-
Notifications
You must be signed in to change notification settings - Fork 93
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
User facing output to file diff #2749
Conversation
|
||
foreach (string key in keys) | ||
{ | ||
string actualSarifText = actualSarifTextDictionary[key]; | ||
SarifLog actualSarifLog = JsonConvert.DeserializeObject<SarifLog>(actualSarifText); | ||
if (actualSarifLog.Runs?[0].TryGetProperty("consoleOut", out string userFacingText) == true) |
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.
So here's the trick upstream users of this base class can do. If they'd like, they can populate the run with consoleOut
to capture user-facing strings. We can (and should) build this deeper into the test infra but it will break everyone's tests (which will require baselining). So we're taking this spotfix for now.
Will the generated .txt file same when running on different machines, does it contains the part that is the absolute path of the file that is having problem which will be different on the machine |
The non-deterministic repo root is normalized to a variable, e.g.: $(SRC_ROOT)\src\Plugins\Tests\TestData\Example\Inputs\TST101_001.TestRule.ps1(4,43-69): warning STST101/001: '…111111' was flagged as a potential problem. In reply to: 1867931239 |
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.
This change retrieves and persists user-facing output generated by functional tests. These strings are to be persisted alongside the generated
.sarif
files in theExpected
directory inTestData
. We are experimenting with this capability in one SARIF Driver framework use case. Once it's proven/refined, we should push that code deeper into the test API.