-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support V3 SimplePollerLike in RLC LRO (#2443)
* Fix typo issues * Update the reference property * Remove the useLegacyLro options * Update the template to adopt with v3 changes * Update the lro flag and enable useLegacyV2Lro for load test * Update the changes * Update the swagger side with this options * Update the flag in smoke test * Update the integration testing in swagger repo * Adopt the option useLegacyV2Lro for swagger way * Revert change in smoke test * Update packages/autorest.typescript/test/commands/smoke-test-list.ts * Update the smoke test in typespec * Update the test case for lro rpcClient * Add test cases for lro rpc rlc * Change to lro rpc * Update the modular poller in rlc and disable legacy code in modular * Add a warning * Testing in local env * Fix the exception issue during polling initial process * regen lro code * regen smoke-test code * Update packages/typespec-ts/package.json * Update packages/typespec-ts/package.json * Update the lock file * Remove the option for useLegacyV2Lro * Revert testing changes * Regenerate rlc lro with v3 version * Update the modular test * Regenerate smoke testing in swagger * Refresh the smoke test in tsp * Update the content * regen smoke test * regen integration code * Should report the server message * Update the package.json for rlc integration * update the commands * Update the smoke git diff * update the rlc path * Add extra steps to install dependencies * Update the dependencies for browser testing * Revert changes * Update the install commands * Remove the option useLegacyV2Lro * Update the documents * Update the swagger generation * regen integration code * regen smoke test * remove the un-used command * Update the scripts to install deps * Update the RLC simplepollerlike with comments * regen smoke test and integration * regen smoke test tag rlc * Update the namings * Avoid breakings for toString * Update the integration for swagger * update changes * regen test * Update the lro template * Support abort signal for modular lro * regen integration test * regen smoke test * regen rlc swagger test * Update the node version * Update the smoke test * update the ut name * update the test cases * Regen smoke testing * update the smoke testing --------- Co-authored-by: Jiao Di (MSFT) <80496810+v-jiaodi@users.noreply.github.com> Co-authored-by: Di Jiao <v-jiaodi@microsoft.com>
- Loading branch information
1 parent
b12beae
commit efbba8d
Showing
90 changed files
with
4,262 additions
and
536 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/autorest.typescript/test/commands/browser.package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"browser": { | ||
"./utils/stream-helpers.js": "./utils/stream-helpers.browser.js", | ||
"./utils/fileSystem.js": "./utils/fileSystem.browser.js", | ||
"./utils/path.js": "./utils/path.browser.js" | ||
}, | ||
"dependencies": { | ||
"@azure/core-lro": "3.0.0-beta.1" | ||
} | ||
} |
85 changes: 85 additions & 0 deletions
85
packages/autorest.typescript/test/commands/prepare-deps.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import { spawn } from "child_process"; | ||
import { existsSync } from "fs"; | ||
import { join } from "path"; | ||
|
||
async function main() { | ||
const isBrowserTest = process.argv.includes("--browser"); | ||
const isRemoval = process.argv.includes("--removal"); | ||
if (isBrowserTest) { | ||
await copyPackageJson(); | ||
await installDependencies(join(`${__dirname}`, "..", "..", "test-browser")); | ||
} else if (isRemoval) { | ||
await removeFiles([ | ||
join(`${__dirname}`, "..", "..", "test-browser", "package.json"), | ||
join(`${__dirname}`, "..", "..", "test-browser", "node_modules") | ||
]); | ||
} else { | ||
await installDependencies( | ||
join(`${__dirname}`, "..", "..", "test", "rlcIntegration") | ||
); | ||
} | ||
} | ||
|
||
async function removeFiles(files: string[]) { | ||
const existing = files.filter((file) => existsSync(file)); | ||
if (existing.length === 0) { | ||
console.log("No dependencies to remove"); | ||
return; | ||
} | ||
runCommand("rm", ["-rf", ...existing]); | ||
console.log("Removed dependencies for hlc browser tests", existing); | ||
} | ||
|
||
async function copyPackageJson() { | ||
const srcPath = join( | ||
`${__dirname}`, | ||
"..", | ||
"..", | ||
"test", | ||
"commands", | ||
"browser.package.json" | ||
); | ||
const destPath = join( | ||
`${__dirname}`, | ||
"..", | ||
"..", | ||
"test-browser", | ||
"package.json" | ||
); | ||
await runCommand("cp", [srcPath, destPath]); | ||
} | ||
|
||
async function installDependencies(path: string) { | ||
await runCommand( | ||
`npm${/^win/.test(process.platform) ? ".cmd" : ""}`, | ||
["install"], | ||
path | ||
); | ||
console.log("Installed dependencies for rlc browser tests", path); | ||
} | ||
|
||
async function runCommand(command: string, args: string[] = [], cwd = ".") { | ||
return new Promise((resolve, reject) => { | ||
const process = spawn(command, args, { cwd, shell: true }); | ||
|
||
let stdout = ""; | ||
let stderr = ""; | ||
|
||
process.stdout.on("data", (data) => (stdout += data.toString())); | ||
process.stderr.on("data", (data) => (stderr += data.toString())); | ||
|
||
process.on("close", () => { | ||
resolve(stdout ?? stderr); | ||
}); | ||
|
||
process.on("error", (error: any) => { | ||
console.log(stdout, stderr, error); | ||
reject(new Error(error)); | ||
}); | ||
}); | ||
} | ||
|
||
main().catch((error) => { | ||
console.error(error); | ||
process.exit(-1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -185,4 +185,4 @@ export async function runAutorest( | |
console.error(error); | ||
throw error; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1290,4 +1290,4 @@ const run = async () => { | |
run().catch(error => { | ||
console.error(error); | ||
process.exit(-1000); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.