[bugfix] playload uncorrect path (#958)

* stash

* fix bug by using relative path

* add changelog and bump version
This commit is contained in:
Tianen 2023-02-10 11:02:31 +08:00 коммит произвёл GitHub
Родитель a7186f1ba7
Коммит 7af1579585
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 18 добавлений и 5 удалений

Просмотреть файл

@ -7,6 +7,7 @@
- Support `--scope` option in static generator - Support `--scope` option in static generator
- API Scenario - API Scenario
- Skip create and delete resource group if specify resource group name - Skip create and delete resource group if specify resource group name
- bug fix about incorrect payload file path in html report
## 01/30/2023 3.2.4 ## 01/30/2023 3.2.4

Просмотреть файл

@ -156,7 +156,10 @@ export class CoverageView {
? `${this.specLinkPrefix}/${element.specFilePath?.substring( ? `${this.specLinkPrefix}/${element.specFilePath?.substring(
element.specFilePath?.indexOf("specification") element.specFilePath?.indexOf("specification")
)}#L${error.source.position.line}` )}#L${error.source.position.line}`
: `${element.specFilePath}#L${error.source.position.line}`, : path.relative(
__dirname,
`../../${element.specFilePath}#L${error.source.position.line}`
),
pathsInPayload: error.pathsInPayload, pathsInPayload: error.pathsInPayload,
jsonPathsInPayload: error.jsonPathsInPayload, jsonPathsInPayload: error.jsonPathsInPayload,
severity: error.severity, severity: error.severity,
@ -167,7 +170,10 @@ export class CoverageView {
: element.payloadFilePath, : element.payloadFilePath,
payloadFilePathWithPosition: this.overrideLinkInReport payloadFilePathWithPosition: this.overrideLinkInReport
? `${this.payloadLinkPrefix}/${payloadFile}#L${element.payloadFilePathPosition?.line}` ? `${this.payloadLinkPrefix}/${payloadFile}#L${element.payloadFilePathPosition?.line}`
: `${element.payloadFilePath}#L${element.payloadFilePathPosition?.line}`, : path.relative(
__dirname,
`../../${element.payloadFilePath}#L${element.payloadFilePathPosition?.line}`
),
payloadFileLinkLabel: payloadFile, payloadFileLinkLabel: payloadFile,
}); });
}); });
@ -178,7 +184,10 @@ export class CoverageView {
payloadFileLinkLabel: payloadFile, payloadFileLinkLabel: payloadFile,
payloadFilePathWithPosition: this.overrideLinkInReport payloadFilePathWithPosition: this.overrideLinkInReport
? `${this.payloadLinkPrefix}/${payloadFile}#L${element.payloadFilePathPosition?.line}` ? `${this.payloadLinkPrefix}/${payloadFile}#L${element.payloadFilePathPosition?.line}`
: `${element.payloadFilePath}#L${element.payloadFilePathPosition?.line}`, : path.relative(
__dirname,
`../../${element.payloadFilePath}#L${element.payloadFilePathPosition?.line}`
),
errors: element.errors, errors: element.errors,
specFilePath: this.overrideLinkInReport specFilePath: this.overrideLinkInReport
? `${this.specLinkPrefix}/${element.specFilePath?.substring( ? `${this.specLinkPrefix}/${element.specFilePath?.substring(
@ -196,7 +205,7 @@ export class CoverageView {
? `${this.specLinkPrefix}/${element.spec?.substring( ? `${this.specLinkPrefix}/${element.spec?.substring(
element.spec?.indexOf("specification") element.spec?.indexOf("specification")
)}` )}`
: element.spec; : path.relative(__dirname, `../../${element.spec}`);
this.coverageResultsForRendering.push({ this.coverageResultsForRendering.push({
spec: specLink, spec: specLink,
specLinkLabel: element.spec?.substring(element.spec?.lastIndexOf("/") + 1), specLinkLabel: element.spec?.substring(element.spec?.lastIndexOf("/") + 1),
@ -263,7 +272,10 @@ export class CoverageView {
? `${this.specLinkPrefix}/${element[0].specFilePath?.substring( ? `${this.specLinkPrefix}/${element[0].specFilePath?.substring(
element[0].specFilePath?.indexOf("specification") element[0].specFilePath?.indexOf("specification")
)}#L${element[0]!.operationInfo!.position!.line}` )}#L${element[0]!.operationInfo!.position!.line}`
: `${element[0].specFilePath}#L${element[0]!.operationInfo!.position!.line}`, : path.relative(
__dirname,
`../../${element[0].specFilePath}#L${element[0]!.operationInfo!.position!.line}`
),
}); });
}); });