diff --git a/src/main/resources/wfc/schemas/report.yaml b/src/main/resources/wfc/schemas/report.yaml index 588a7a8..acdf4b3 100644 --- a/src/main/resources/wfc/schemas/report.yaml +++ b/src/main/resources/wfc/schemas/report.yaml @@ -58,6 +58,14 @@ properties: type: [array, "null"] items: $ref: "#/$defs/Coverage" + warnings: + description: "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." + type: [array, "null"] + items: + $ref: "#/$defs/Warning" required: - "schemaVersion" @@ -189,6 +197,13 @@ $defs: description: "The line number in the generated test suite file where the code of this test case ends." type: integer minimum: 0 + namedExamples: + description: "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." + type: [array, "null"] + items: + type: string + uniqueItems: true Faults: type: object @@ -232,4 +247,20 @@ $defs: description: "Optional number of all testing targets for this criterion. For some criteria, this number can be unknown." type: [integer, "null"] minimum: 0 - required: ["name","covered"] \ No newline at end of file + required: ["name","covered"] + Warning: + type: object + properties: + message: + description: "The textual content of the warning message." + type: string + category: + description: "Label to specify the type of warning, e.g., if related to the schema or + fuzzer misconfiguration." + type: string + displayPriority: + description: "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." + type: integer + minimum: 0 diff --git a/web-report/src/types/GeneratedTypes.tsx b/web-report/src/types/GeneratedTypes.tsx index d93f2e0..8cbc562 100644 --- a/web-report/src/types/GeneratedTypes.tsx +++ b/web-report/src/types/GeneratedTypes.tsx @@ -64,6 +64,10 @@ export interface WebFuzzingCommonsReport { * Extra, optional coverage information, collected by different tools. */ extra?: Coverage[] | null; + /** + * 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. + */ + warnings?: Warning[] | null; [k: string]: unknown; } export interface Faults { @@ -151,6 +155,10 @@ export interface TestCase { * The line number in the generated test suite file where the code of this test case ends. */ endLine?: number; + /** + * 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. + */ + namedExamples?: string[] | null; [k: string]: unknown; } export interface Coverage { @@ -176,3 +184,18 @@ export interface CoverageCriterion { total?: number | null; [k: string]: unknown; } +export interface Warning { + /** + * The textual content of the warning message. + */ + message?: string; + /** + * Label to specify the type of warning, e.g., if related to the schema or fuzzer misconfiguration. + */ + category?: string; + /** + * 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. + */ + displayPriority?: number; + [k: string]: unknown; +} diff --git a/web-report/src/types/GeneratedTypesZod.ts b/web-report/src/types/GeneratedTypesZod.ts index b068ea5..56677e8 100644 --- a/web-report/src/types/GeneratedTypesZod.ts +++ b/web-report/src/types/GeneratedTypesZod.ts @@ -16,6 +16,15 @@ export const testCaseSchema = z.record(z.unknown()).and( name: z.string().optional(), startLine: z.number().optional(), endLine: z.number().optional(), + namedExamples: z.array(z.string()).optional().nullable(), + }), +); + +export const warningSchema = z.record(z.unknown()).and( + z.object({ + message: z.string().optional(), + category: z.string().optional(), + displayPriority: z.number().optional(), }), ); @@ -92,5 +101,6 @@ export const webFuzzingCommonsReportSchema = z.record(z.unknown()).and( testCases: z.array(testCaseSchema), executionTimeInSeconds: z.number(), extra: z.array(coverageSchema).optional().nullable(), + warnings: z.array(warningSchema).optional().nullable(), }), );