minor improvement for api scenario runner (#692)
* minor improvement for api scenario runner * fix typo * remove cloudName default value to support customized armEndpoint * remove cloudName support to add its support in wrapper * update snapshot
This commit is contained in:
Родитель
15bc328187
Коммит
9a2b04e9c2
|
@ -7,6 +7,10 @@ import { ResponseDiffItem, RuntimeError, StepResult, TestScenarioResult } from "
|
|||
|
||||
const spaceReg = /(\n|\t|\r)/gi;
|
||||
|
||||
const getErrorCodeDocLink = (code: string): string => {
|
||||
return `https://github.com/Azure/azure-rest-api-specs/blob/main/documentation/api-scenario/references/ErrorCodeReference.md#${code}`;
|
||||
};
|
||||
|
||||
const commonHelper = (opts: HelperOpts) => ({
|
||||
renderPlain: (s: string) => s,
|
||||
renderWhitespace: (n: number) => " ".repeat(n),
|
||||
|
@ -56,9 +60,9 @@ const commonHelper = (opts: HelperOpts) => ({
|
|||
`${hd.default(moment.duration(moment(end).diff(moment(start))).asMilliseconds())}`,
|
||||
shouldReportError: (sr: TestScenarioMarkdownStepResult) =>
|
||||
sr.failedErrorsCount + sr.fatalErrorsCount > 0,
|
||||
renderFatalErrorCode: (e: RuntimeError) => `[${e.code}]()`,
|
||||
renderFatalErrorCode: (e: RuntimeError) => `[${e.code}](${getErrorCodeDocLink(e.code)})`,
|
||||
renderFatalErrorDetail: (e: RuntimeError) => `${e.message.replace(spaceReg, " ")}`,
|
||||
renderDiffErrorCode: (e: ResponseDiffItem) => `[${e.code}]()`,
|
||||
renderDiffErrorCode: (e: ResponseDiffItem) => `[${e.code}](${getErrorCodeDocLink(e.code)})`,
|
||||
renderDiffErrorDetail: (e: ResponseDiffItem) => `${e.message.replace(spaceReg, " ")}`,
|
||||
});
|
||||
|
||||
|
|
|
@ -4,6 +4,6 @@ exports[`junitTestReport Should generate junit case report 1`] = `
|
|||
"###Create or update a simple gallery with sharing profile.: 1 Fatal Error(s)
|
||||
| Rule | Message |
|
||||
|------|---------|
|
||||
|<code>❌</code>[RUNTIME_ERROR_400]()|code: BadRequest, message: Subscription 'db5eb68e-73e2-4fa8-b18a-46cd1be4cce5' is not registered with the feature Microsoft.Compute/SIGSharing. Please register the subscription before retrying the call.|
|
||||
|<code>❌</code>[RUNTIME_ERROR_400](https://github.com/Azure/azure-rest-api-specs/blob/main/documentation/api-scenario/references/ErrorCodeReference.md#RUNTIME_ERROR_400)|code: BadRequest, message: Subscription 'db5eb68e-73e2-4fa8-b18a-46cd1be4cce5' is not registered with the feature Microsoft.Compute/SIGSharing. Please register the subscription before retrying the call.|
|
||||
"
|
||||
`;
|
||||
|
|
|
@ -62,7 +62,7 @@ exports[`markdownReport Should generate markdown report: body 1`] = `
|
|||
|
||||
| Rule | Message |
|
||||
|------|---------|
|
||||
| <code> ❌ </code> [RUNTIME_ERROR_400]() | code: BadRequest, message: Subscription 'db5eb68e-73e2-4fa8-b18a-46cd1be4cce5' is not registered with the feature Microsoft.Compute/SIGSharing. Please register the subscription before retrying the call. |
|
||||
| <code> ❌ </code> [RUNTIME_ERROR_400](https://github.com/Azure/azure-rest-api-specs/blob/main/documentation/api-scenario/references/ErrorCodeReference.md#RUNTIME_ERROR_400) | code: BadRequest, message: Subscription 'db5eb68e-73e2-4fa8-b18a-46cd1be4cce5' is not registered with the feature Microsoft.Compute/SIGSharing. Please register the subscription before retrying the call. |
|
||||
<br />
|
||||
<li>
|
||||
<code>
|
||||
|
|
Загрузка…
Ссылка в новой задаче