tests fixes
This commit is contained in:
@@ -771,13 +771,15 @@ internal static partial class CommandHandlers
|
||||
runs.Count > 0 &&
|
||||
runs[0] is System.Text.Json.Nodes.JsonObject runNode)
|
||||
{
|
||||
var properties = runNode["properties"] as System.Text.Json.Nodes.JsonObject ?? new System.Text.Json.Nodes.JsonObject();
|
||||
// Get or create properties object
|
||||
if (runNode["properties"] is not System.Text.Json.Nodes.JsonObject properties)
|
||||
{
|
||||
properties = new System.Text.Json.Nodes.JsonObject();
|
||||
runNode["properties"] = properties;
|
||||
}
|
||||
properties["digest"] = scanId;
|
||||
properties["scanTimestamp"] = "unknown";
|
||||
properties["policyProfileId"] = "unknown";
|
||||
runNode["properties"] = properties;
|
||||
runs[0] = runNode;
|
||||
rootNode["runs"] = runs;
|
||||
|
||||
sarifContent = rootNode.ToJsonString(new System.Text.Json.JsonSerializerOptions
|
||||
{
|
||||
|
||||
@@ -550,8 +550,13 @@ public static class DbCommandGroup
|
||||
var loggerFactory = services.GetService<ILoggerFactory>();
|
||||
var logger = loggerFactory?.CreateLogger(typeof(DbCommandGroup));
|
||||
|
||||
Console.WriteLine($"Testing connector: {connectorName}");
|
||||
Console.WriteLine();
|
||||
var isJsonFormat = format.Equals("json", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
if (!isJsonFormat)
|
||||
{
|
||||
Console.WriteLine($"Testing connector: {connectorName}");
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
var stopwatch = System.Diagnostics.Stopwatch.StartNew();
|
||||
using var timeoutCts = CancellationTokenSource.CreateLinkedTokenSource(ct);
|
||||
|
||||
@@ -23,12 +23,12 @@ internal static class PolicyCommandGroup
|
||||
policyCommand.Add(BuildValidateCommand(verboseOption, cancellationToken));
|
||||
policyCommand.Add(BuildInstallCommand(verboseOption, cancellationToken));
|
||||
policyCommand.Add(BuildListPacksCommand(verboseOption, cancellationToken));
|
||||
policyCommand.Add(BuildSimulateCommand(verboseOption, cancellationToken));
|
||||
// Note: simulate command is already added by CommandFactory.BuildPolicyCommand
|
||||
}
|
||||
|
||||
private static Command BuildValidateCommand(Option<bool> verboseOption, CancellationToken cancellationToken)
|
||||
{
|
||||
var command = new Command("validate", "Validate a policy pack YAML file against schema");
|
||||
var command = new Command("validate-yaml", "Validate a policy pack YAML file against schema");
|
||||
|
||||
var pathArgument = new Argument<string>("path")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user