Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Commit

Permalink
fix e2e test (#673)
Browse files Browse the repository at this point in the history
* fix path

* sdk-flatten

* check simple array example value lenght

* set sdk-flatten by RP
  • Loading branch information
changlong-liu authored Dec 9, 2020
1 parent a237977 commit b4d0837
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/plugins/azgenerator/CodeModelAzImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1992,11 +1992,13 @@ export class CodeModelCliImpl implements CodeModelAz {
example_param.push(new ExampleParam(name, ret, false, KeyValueType.ShorthandSyntax, keys, defaultName, realParam, ancestors, value));
}
else if (this.Parameter_IsSimpleArray(realParam.value)) {
for (let i=0; i<value.length; i++) {
ret += ToJsonString(value[i]) + " ";
if (value.length>0) { // use value only when it's lenght > 0
for (let i=0; i<value.length; i++) {
ret += ToJsonString(value[i]) + " ";
}
ret = ret.trim();
example_param.push(new ExampleParam(name, ret, false, KeyValueType.SimpleArray, [], defaultName, realParam, ancestors, value));
}
ret = ret.trim();
example_param.push(new ExampleParam(name, ret, false, KeyValueType.SimpleArray, [], defaultName, realParam, ancestors, value));
}
else {
for (let i=0; i<value.length; i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/azgenerator/azgenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export async function processRequest(host: Host) {
let azextpath = path.join(model.azOutputFolder, model.AzextFolder);
session.protectFiles(path.join(azextpath, "manual"));
session.protectFiles(path.join(azextpath, "tests/latest/recordings"));
session.protectFiles(path.join(azextpath, "README.md"));
session.protectFiles(path.join(model.azOutputFolder, "README.md"));
} while (model.SelectNextExtension());
}
// Read existing file generation-mode
Expand Down
1 change: 1 addition & 0 deletions src/test/scenarios/testserver/configuration/readme.az.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ az:
client-authentication-policy: SansIOHTTPPolicy
az-output-folder: $(azure-cli-extension-folder)/src/testserver
python-sdk-output-folder: "$(az-output-folder)/azext_testserver/vendored_sdks/testserver"
sdk-flatten: true

#cli:
# cli-directive:
Expand Down

0 comments on commit b4d0837

Please sign in to comment.