Implement new_files (#1794)

* Checkpoint

* Checkpoint

* More merge resolving

* Code complete

* Tested that it works

* Keep the queue name different for now

* Query was wrong, should be and

* Style

* Fix compile issue

* Change report to use string instead of SHA, fixes tests as well

* PR comments

* Comments and formatting
This commit is contained in:
Teo Voinea
2022-04-20 14:36:50 -04:00
committed by GitHub
parent 52fcd213a5
commit 16d7694852
34 changed files with 585 additions and 116 deletions

View File

@ -249,6 +249,41 @@ namespace Tests
);
}
public static Gen<Report> Report()
{
return Arb.Generate<Tuple<string, BlobRef, List<string>, Guid, int>>().Select(
arg =>
new Report(
InputUrl: arg.Item1,
InputBlob: arg.Item2,
Executable: arg.Item1,
CrashType: arg.Item1,
CrashSite: arg.Item1,
CallStack: arg.Item3,
CallStackSha256: arg.Item1,
InputSha256: arg.Item1,
AsanLog: arg.Item1,
TaskId: arg.Item4,
JobId: arg.Item4,
ScarinessScore: arg.Item5,
ScarinessDescription: arg.Item1,
MinimizedStack: arg.Item3,
MinimizedStackSha256: arg.Item1,
MinimizedStackFunctionNames: arg.Item3,
MinimizedStackFunctionNamesSha256: arg.Item1,
MinimizedStackFunctionLines: arg.Item3,
MinimizedStackFunctionLinesSha256: arg.Item1
)
);
}
public static Gen<Container> Container()
{
return Arb.Generate<Tuple<NonNull<string>>>().Select(
arg => new Container(string.Join("", arg.Item1.Get.Where(c => char.IsLetterOrDigit(c) || c == '-'))!)
);
}
}
public class OrmArb
@ -327,6 +362,16 @@ namespace Tests
{
return Arb.From(OrmGenerators.WebhookMessage());
}
public static Arbitrary<Report> Report()
{
return Arb.From(OrmGenerators.Report());
}
public static Arbitrary<Container> Container()
{
return Arb.From(OrmGenerators.Container());
}
}