forked from microsoft/mcp
-
Notifications
You must be signed in to change notification settings - Fork 0
Migrate Appconfig
#1
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
Open
scbedd
wants to merge
13
commits into
main
Choose a base branch
from
migrate-appconfig
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+183
−30
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4179246
store progress before submitting matcher pr
scbedd 04bf1a9
pull across the matcher changes
scbedd b93ca9d
Merge branch 'main' into proxy-integration-tests-and-matcher
scbedd 98745a4
we now support global and per-test override of sanitizers
scbedd 904b1a5
commit stable. still need to do a BUNCH of cleanup of these tests, bu…
scbedd eb609d9
dotnet format. tests now passing. lets see how they handle CI
scbedd 5fb5aba
add HttpClientService, use within GetConfigurationClient() in AppConf…
scbedd e33688d
adding copilot instructions to have it drive record/playback scenario
scbedd 031154e
populating initial copilot instrutions + migrating appconfig tests. w…
scbedd e458e15
correcting indentation
scbedd d39858a
Merge branch 'enable-recorded-stage' into migrate-appconfig
scbedd d7a943f
naive injection of httpclientservice so we can properly record
scbedd eb377a9
Merge branch 'main' into migrate-appconfig
scbedd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
6 changes: 6 additions & 0 deletions
6
...seLifecycleTests.ApplyAttributeMatcherSettings_UsesCustomMatcherWhenAttributePresent.json
This file contains hidden or 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,6 @@ | ||
| { | ||
| "Entries": [], | ||
| "Variables": { | ||
| "attrKey": "attrValue" | ||
| } | ||
| } |
4 changes: 4 additions & 0 deletions
4
...edCommandTestsBaseLifecycleTests.GlobalMatcherAndSanitizerConfiguration_DoesNotThrow.json
This file contains hidden or 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,4 @@ | ||
| { | ||
| "Entries": [], | ||
| "Variables": {} | ||
| } |
6 changes: 6 additions & 0 deletions
6
...seLifecycleTests.ApplyAttributeMatcherSettings_UsesCustomMatcherWhenAttributePresent.json
This file contains hidden or 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,6 @@ | ||
| { | ||
| "Entries": [], | ||
| "Variables": { | ||
| "attrKey": "attrValue" | ||
| } | ||
| } |
4 changes: 4 additions & 0 deletions
4
...k.RecordedCommandTestsBaseLifecycleTests.GlobalMatcherAndSanitizerAppliesWhenPresent.json
This file contains hidden or 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,4 @@ | ||
| { | ||
| "Entries": [], | ||
| "Variables": {} | ||
| } |
4 changes: 4 additions & 0 deletions
4
...edCommandTestsBaseLifecycleTests.GlobalMatcherAndSanitizerConfiguration_DoesNotThrow.json
This file contains hidden or 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,4 @@ | ||
| { | ||
| "Entries": [], | ||
| "Variables": {} | ||
| } |
This file contains hidden or 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,35 @@ | ||
| # Recorded Testing in `microsoft/mcp` | ||
|
|
||
| ## Context | ||
|
|
||
| This repository ships CLI tools. Specifically, multiple combinations of `tools` assembled into `mcp servers` that are effectively standalone CLI tools themselves. | ||
|
|
||
| This complicates the record/playback story somewhat, as the process code itself is running _separately_ during our livetesting. If your tool's livetests are based upon `CommandTestsBase` from `Azure.Mcp.Tests`, then you'll be familiar with this process: | ||
|
|
||
| On each live test: | ||
| - New up test class, instantiate `Settings` from a locally found `.livetestsettings.json` (created by `./eng/scripts/Deploy-TestResources.ps1`). | ||
| - Set appropriate `environment` variable settings to match needs of livetest, ensuring that environment is primed to use the logged in powershell credential automatically. | ||
| - Call an `mcp server` as a CLI command, passing it specific instructions formatted within the test. | ||
| - `mcp server` uses prepared local env for auth, completes the task, and returns output to the test | ||
| - Test asserts on output of tool | ||
|
|
||
| Notably, in the above process, the call of the tool is calling into a prebuilt EXE, there is no opportunity for httpclient injection or the like that would allow recordings to be made from tool calls. This was solved for this repo by the following. | ||
|
|
||
| - During **only** `debug` builds `HttpClientService` has been enhanced to support `redirect` automagically based upon the presence of `TEST_PROXY_URL` variable. | ||
|
|
||
| ## Converting a `LiveTest` to a `Recorded` test | ||
|
|
||
|
|
||
| ## The sanitization/playback loop | ||
|
|
||
| - If a `.livesettings` file exists at root of your `tool`, continue. | ||
| - Update the `TestMode` setting within the `.livesettings.json` alongside each livetests csproj to `Record`. | ||
| - Invoke the livetests. | ||
| - Use `.proxy/Azure.Sdk.Tools.TestProxy(.exe) config locate -a path/to/assets.json` to locate the recordings directory | ||
| - Review recordings for secrets. | ||
| - Temporarily rename the `livesettings.json` to a different name to force `playback` mode. I use `DISABLED.livesettings.json`. | ||
| - Invoke the livetests again. If they all pass, and secret review was clean, push. | ||
| - `.proxy/Azure.Sdk.Tools.TestPRoxy(.exe) push -a path/to/assets.json` | ||
| - If they _do not_ pass, examine each individual test error. There should be some sort of mismatch or the like in the test-proxy error. | ||
| - Commit the `assets.json` updated with the new tag. | ||
|
|
This file contains hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think you'll want to consume this on line 548 in
Get-BuildMatricesWe should start setting an additional RunRecordedTests based on any
$pathsToTesthavinghasRecordedTests.You'll have to start passing
$pathsToTesttoGet-BuildMatricesas it corrently only depends on$serverDetailsThere 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.
ty for the heads up. Workin it