fix report path prefix (#840)
Co-authored-by: Tianxiang Chen <tianxchen@microsoft.com>
This commit is contained in:
Родитель
1a4e303380
Коммит
f37550d3cb
|
@ -92,7 +92,6 @@ export interface NewmanReportValidatorOption extends ApiScenarioLoaderOption {
|
|||
markdown?: boolean;
|
||||
junit?: boolean;
|
||||
html?: boolean;
|
||||
specPathPrefix?: string;
|
||||
baseUrl?: string;
|
||||
runId?: string;
|
||||
validationLevel?: ValidationLevel;
|
||||
|
|
|
@ -49,7 +49,6 @@ export interface PostmanCollectionGeneratorOption
|
|||
markdown?: boolean;
|
||||
junit?: boolean;
|
||||
html?: boolean;
|
||||
specPathPrefix: string;
|
||||
runCollection: boolean;
|
||||
generateCollection: boolean;
|
||||
baseUrl: string;
|
||||
|
@ -248,7 +247,13 @@ export class PostmanCollectionGenerator {
|
|||
|
||||
const operationCoverageResult: OperationCoverageInfo[] = [];
|
||||
operationIdCoverageResult.forEach((result, key) => {
|
||||
const specPath = this.fileLoader.resolvePath(key);
|
||||
let specPath = this.fileLoader.resolvePath(key);
|
||||
if (process.env.REPORT_SPEC_PATH_PREFIX) {
|
||||
specPath = path.join(
|
||||
process.env.REPORT_SPEC_PATH_PREFIX,
|
||||
specPath.substring(specPath.indexOf("specification"))
|
||||
);
|
||||
}
|
||||
operationCoverageResult.push({
|
||||
totalOperations: result.totalOperationNumber,
|
||||
spec: specPath,
|
||||
|
@ -283,8 +288,7 @@ export class PostmanCollectionGenerator {
|
|||
|
||||
const options: TrafficValidationOptions = {
|
||||
reportPath: path.resolve(reportExportPath, "report.html"),
|
||||
overrideLinkInReport: this.opt.specPathPrefix !== undefined,
|
||||
specLinkPrefix: this.opt.specPathPrefix,
|
||||
overrideLinkInReport: false,
|
||||
sdkPackage: providerNamespace,
|
||||
};
|
||||
|
||||
|
@ -440,7 +444,6 @@ export class PostmanCollectionGenerator {
|
|||
markdown: this.opt.markdown,
|
||||
junit: this.opt.junit,
|
||||
html: this.opt.html,
|
||||
specPathPrefix: this.opt.specPathPrefix,
|
||||
baseUrl: this.opt.baseUrl,
|
||||
runId: this.opt.runId,
|
||||
validationLevel: this.opt.validationLevel,
|
||||
|
|
|
@ -55,10 +55,6 @@ export const builder: yargs.CommandBuilder = {
|
|||
describe: "Generate report type. Supported types: html, markdown, junit",
|
||||
type: "array",
|
||||
},
|
||||
specPathPrefix: {
|
||||
describe: "The prefix of spec path in reports.",
|
||||
string: true,
|
||||
},
|
||||
level: {
|
||||
describe:
|
||||
"Validation level. oav runner validate request and response with different strict level. 'validate-request' validates requests should be successful. 'validate-request-response' validate both request and response.",
|
||||
|
@ -206,7 +202,6 @@ export async function handler(argv: yargs.Arguments): Promise<void> {
|
|||
markdown: (argv.report ?? []).includes("markdown"),
|
||||
junit: (argv.report ?? []).includes("junit"),
|
||||
html: (argv.report ?? []).includes("html"),
|
||||
specPathPrefix: argv.specPathPrefix,
|
||||
eraseXmsExamples: false,
|
||||
eraseDescription: false,
|
||||
baseUrl: argv.armEndpoint,
|
||||
|
|
Загрузка…
Ссылка в новой задаче