Skip to content

Commit 09ade8c

Browse files
authored
Merge pull request #33 from WebFuzzing/report-warnings-examples
adding entry for Warnings
2 parents bd40943 + fc18415 commit 09ade8c

3 files changed

Lines changed: 65 additions & 1 deletion

File tree

src/main/resources/wfc/schemas/report.yaml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ properties:
5858
type: [array, "null"]
5959
items:
6060
$ref: "#/$defs/Coverage"
61+
warnings:
62+
description: "Optional list of general 'warnings' regarding the fuzzing process.
63+
These are general, and not specific to any generated test case.
64+
For example, problems in the schema would be reported here, as well as
65+
possible misconfigurations of the fuzzer."
66+
type: [array, "null"]
67+
items:
68+
$ref: "#/$defs/Warning"
6169

6270
required:
6371
- "schemaVersion"
@@ -189,6 +197,13 @@ $defs:
189197
description: "The line number in the generated test suite file where the code of this test case ends."
190198
type: integer
191199
minimum: 0
200+
namedExamples:
201+
description: "Optional list of 'named examples' used in the test cases. These typically represent
202+
user test data that need to be tracked in the generated test suite."
203+
type: [array, "null"]
204+
items:
205+
type: string
206+
uniqueItems: true
192207

193208
Faults:
194209
type: object
@@ -232,4 +247,20 @@ $defs:
232247
description: "Optional number of all testing targets for this criterion. For some criteria, this number can be unknown."
233248
type: [integer, "null"]
234249
minimum: 0
235-
required: ["name","covered"]
250+
required: ["name","covered"]
251+
Warning:
252+
type: object
253+
properties:
254+
message:
255+
description: "The textual content of the warning message."
256+
type: string
257+
category:
258+
description: "Label to specify the type of warning, e.g., if related to the schema or
259+
fuzzer misconfiguration."
260+
type: string
261+
displayPriority:
262+
description: "Hint on the priority of this warning message, where lowest (eg, 1) values mean
263+
more important. This is ONLY meant to be used for display purposes, e.g., when
264+
sorting the list of warnings to show to user."
265+
type: integer
266+
minimum: 0

web-report/src/types/GeneratedTypes.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ export interface WebFuzzingCommonsReport {
6464
* Extra, optional coverage information, collected by different tools.
6565
*/
6666
extra?: Coverage[] | null;
67+
/**
68+
* Optional list of general 'warnings' regarding the fuzzing process. These are general, and not specific to any generated test case. For example, problems in the schema would be reported here, as well as possible misconfigurations of the fuzzer.
69+
*/
70+
warnings?: Warning[] | null;
6771
[k: string]: unknown;
6872
}
6973
export interface Faults {
@@ -151,6 +155,10 @@ export interface TestCase {
151155
* The line number in the generated test suite file where the code of this test case ends.
152156
*/
153157
endLine?: number;
158+
/**
159+
* Optional list of 'named examples' used in the test cases. These typically represent user test data that need to be tracked in the generated test suite.
160+
*/
161+
namedExamples?: string[] | null;
154162
[k: string]: unknown;
155163
}
156164
export interface Coverage {
@@ -176,3 +184,18 @@ export interface CoverageCriterion {
176184
total?: number | null;
177185
[k: string]: unknown;
178186
}
187+
export interface Warning {
188+
/**
189+
* The textual content of the warning message.
190+
*/
191+
message?: string;
192+
/**
193+
* Label to specify the type of warning, e.g., if related to the schema or fuzzer misconfiguration.
194+
*/
195+
category?: string;
196+
/**
197+
* Hint on the priority of this warning message, where lowest (eg, 1) values mean more important. This is ONLY meant to be used for display purposes, e.g., when sorting the list of warnings to show to user.
198+
*/
199+
displayPriority?: number;
200+
[k: string]: unknown;
201+
}

web-report/src/types/GeneratedTypesZod.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ export const testCaseSchema = z.record(z.unknown()).and(
1616
name: z.string().optional(),
1717
startLine: z.number().optional(),
1818
endLine: z.number().optional(),
19+
namedExamples: z.array(z.string()).optional().nullable(),
20+
}),
21+
);
22+
23+
export const warningSchema = z.record(z.unknown()).and(
24+
z.object({
25+
message: z.string().optional(),
26+
category: z.string().optional(),
27+
displayPriority: z.number().optional(),
1928
}),
2029
);
2130

@@ -92,5 +101,6 @@ export const webFuzzingCommonsReportSchema = z.record(z.unknown()).and(
92101
testCases: z.array(testCaseSchema),
93102
executionTimeInSeconds: z.number(),
94103
extra: z.array(coverageSchema).optional().nullable(),
104+
warnings: z.array(warningSchema).optional().nullable(),
95105
}),
96106
);

0 commit comments

Comments
 (0)