-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Unified Recorder] Call proxy-tool
through dev-tool
#18322
Conversation
This pull request is protected by Check Enforcer. What is Check Enforcer?Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass. Why am I getting this message?You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged. What should I do now?If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows: What if I am onboarding a new service?Often, new services do not have validation pipelines associated with them, in order to bootstrap pipelines for a new service, you can issue the following command as a pull request comment: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I think this is pretty clever. The idea to just hit the /info endpoint of the proxy tool and start it when running the tests if it's not already running seems like it's going to be a nice developer experience.
I have a few broad questions:
- What do we tell developers in error messages if they don't have docker?
- Is there any setup required on the local machine for this to work?
Other than that, I have some feedback from the dev-tool perspective and some changes that we will need to make.
import { spawn } from "child_process"; | ||
import fs from "fs"; | ||
import path from "path"; | ||
import { IncomingMessage, request, RequestOptions } from "http"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm in favor of using a simpler HTTP client in dev-tool such as axios.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only HTTP request that is made in the whole of dev-tool.
I don't want to take a dependency on another package if this serves my purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very well, When/if we have more HTTP usage I'd like to replace it with axios, node-fetch, etc. (something a little bit more "batteries-included").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
core-rest-pipelines should help 🤔 at least in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That'll add circular dependencies @sadasant.
core packages depend on dev-tool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want to use core for incidental stuff in dev-tool. It's designed for the client libraries and unless we really have some kind of request pipeline in dev-tool where performance and consistent configurability with the clients is important, I think it'll be nicer to just use a simple API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That'll add circular dependencies @sadasant.
Not if you pin a version 🤔 since dev-tools is only a devDependency. But I agree with Will 👍
…u/azure-sdk-for-js into harshan/issue/17042
… harshan/issue/17042
-ArgumentList "--storage-location '${{ parameters.rootFolder }}'" ` | ||
-ArgumentList "--storage-location ${{ parameters.rootFolder }}" ` | ||
-NoNewWindow -PassThru -RedirectStandardOutput $(Build.SourcesDirectory)/test-proxy.log | ||
displayName: 'Run the testproxy - windows' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@scbedd for reference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Analyze step will be fixed once this fix goes into the tools repo. Azure/azure-sdk-tools#2290
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really clean 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking forward to enjoying all the benefits that proxy-tool brings us!
|
||
import { subCommand, makeCommandInfo } from "../../framework/command"; | ||
|
||
export const commandInfo = makeCommandInfo("run", "run scripts such as test:node"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: test:node
not accurate if the sub commands include both node and browser?
|
||
export default leafCommand(commandInfo, async (options) => { | ||
return runTestsWithProxyTool({ | ||
command: `nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace ${options.mocha}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we still have packages that bundle the nodejs tests? I hope -r esm
still work with those if any exists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, three ways of running the packages
- js rollup bundle
- js dist-esm files
- ts sources
I'll check if test:node-js-input
is working for both 1st and 2nd.
/azp run js - test-utils - ci |
Azure Pipelines successfully started running 1 pipeline(s). |
Azure Networking 2021-08-01 release of monthly branch (Azure#18440) * Adds base for updating Microsoft.Network from version stable/2021-05-01 to version 2021-08-01 * Updates readme * Updates API version in new specs and examples * Add AppGw swagger changes for L4 proxy (Azure#17561) * Add AppGw swagger changes for L4 proxy * Fix Lint Errors * fix prettier checks * HubRoutingPreference in VirtualHub (Azure#17609) * commit1 * commit2 Co-authored-by: Khushboo Baheti <khbaheti@microsoft.com> * MultipleApipa feature VpnSiteLinkConnection and VirtualNetworkGatewayConnection (Azure#17672) * VngConnection * VpnSiteLinkConnection * fixes * fixes * fix2 * fixes Co-authored-by: Khushboo Baheti <khbaheti@microsoft.com> * Virtual Wan P2S MultiPool feature swagger changes (Azure#17620) * Virtual Wan P2S MultiPool feature swagger changes * Fix Swagger LintDiff errors * Fix LintDiff errors * Fix errors * Fix spec * Fix spec * Fix spec * Fix LintDiff errors * Fix LintDiff errors * Fix SDK azure-sdk-for-net generation error * Remove suppression * Fix errors * Fix Lintdiff error * Fix PrettierCheck * changes (Azure#18002) * Revert "changes (Azure#18002)" (Azure#18014) This reverts commit 320ed6a6fc5a68e8af43da303f8e1caaacf24708. * Add nic auxiliary mode (Azure#17577) * Add nic auxiliary mode * fix spacing * Fixing prettier check * Restoring package-lock file * Restoring package json Co-authored-by: Prachi Bhavsar <prbhavsar@microsoft.com> * Connection Draining add new properties (Azure#18052) * merge * fix * fix * Adding express route port authorization apis (Azure#17582) * adding apis and updating resource to support ports auth * moving change to 2021-08-01 * minor: removing change from 2020-07-01 * lintdiff : adding type object * minor: fixing prettier * adding authorizations to ports property * fixing circuitResourceUri property name * fixing model validation * changing circuit resource uri type to string * removing authorizations child reosurce from parent property * Fix Azure Firewall Policy regressions. Back fix validation issues (Azure#18233) * Fix regressions in Firewall Policy Swagger / give firewallPolicy.json some love * Additional lint violations * remove breaking changes for next time. TO DO * Revert "remove breaking changes for next time. TO DO" This reverts commit 8f44a174c73c02d18d829f6dfb1d990488770b23. * Reintroduce api-version for idps signature based routes. Create better names for enums to be generated in SDKs * standardize enum names with FirewallPolicy prefix * Azure Firewall Support of Private IP Ranges in IDPS (Azure#18320) * Azure Firewall Support of Private IP Ranges in IDPS * make sure all arrays have x-ms-identifiers * FirewallPolicy not Firewall policy fix spellcheck validation * Ability to update tags on firewall policies (Azure#18322) * Support updating of Azure Firewall Policy Tags. Includes HTTP Patch example * Use common-types ErrorDetail * Ability to update tags for Firewall Policies * spell check fix for firewallpolicy * Use future release api-version for example * Added flush conn to nsg (Azure#18393) * Added flush conn to nsg * Updated flushConn to correct location * Updated description * Modified T/F to Enabled/Disabled * Refactoring so that null value appears first * Reverted FlushConnection to boolean value instead of string * Revert "Added flush conn to nsg (Azure#18393)" (Azure#18576) This reverts commit 6541d305880d1cf580496adc01f55197a01e992c. * Fixing typo in response of idps private ip range feature (Azure#18574) * Use common-type api version (Azure#18729) Co-authored-by: Ben Eshed <bewaters@microsoft.com> * fix (Azure#18417) Co-authored-by: Tianen <347142915@qq.com> Co-authored-by: gk-ms <97893166+gk-ms@users.noreply.github.com> Co-authored-by: Khushboo Baheti <37917868+Khushboo-Baheti@users.noreply.github.com> Co-authored-by: Khushboo Baheti <khbaheti@microsoft.com> Co-authored-by: Nilambari <nilamd@microsoft.com> Co-authored-by: nimaller <71352534+nimaller@users.noreply.github.com> Co-authored-by: pracsb <78512712+pr-work@users.noreply.github.com> Co-authored-by: Prachi Bhavsar <prbhavsar@microsoft.com> Co-authored-by: Matthew Yang <79727592+matyang22@users.noreply.github.com> Co-authored-by: utbarn-ms <66377251+utbarn-ms@users.noreply.github.com> Co-authored-by: Ben Eshed <thebenwaters@users.noreply.github.com> Co-authored-by: Satya-anshu <70507845+Satya-anshu@users.noreply.github.com> Co-authored-by: bewaterspassover <103988461+bewaterspassover@users.noreply.github.com> Co-authored-by: Ben Eshed <bewaters@microsoft.com>
Issue #17042
TODO
concurrently
and run thedocker run ..
andmocha ..
commands in parallel, there might be a case where tests start running anddocker run ..
is still setting up the test proxy. Make sure the tests only run when the test proxy is active.Future PRs
docker run ..
withconcurrently
stops gracefully when the tests end in Linux and Mac but not on windows, though the process(concurrently
) ends. Figure out a way to properly stop thedocker run ..
in windows.