-
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
[Monitor-Query] Update monitor-query to use new recorder #20178
[Monitor-Query] Update monitor-query to use new recorder #20178
Conversation
…ry-to-new-recorder
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.
Thanks for doing this! Overall it's looking good, just had a couple small comments/questions :)
console.log( | ||
`TODO: live tests skipped until test-resources + data population is set up (missing ${variableName} env var).` | ||
); | ||
mochaContext.skip(); | ||
// NOTE: This function should be throwing |
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.
Just wondering, what do you mean by this? If the function should throw we can use the assertEnvironmentVariable
helper exposed by the recorder instead of defining this function.
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 was a note that came out during a sync, I forgot to update the function to add a Throw new Error(...
in case the environment variable is not defined (right now it is just skipping it).
Can you provide more info about the assertEnvironmentVariable
helper and how it could be used?
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.
We have an assertEnvironmentVariable
function exported from the recorder package which either returns the value of the environment variable or throws an error if it's not set. Maybe you could use that instead of the helper that's here at the moment (and remove old the helper entirely).
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.
Thank you for the explanation, I also think that method can replace this function. So, since CI is green for this PR already and test are working, I'm going to file an issue with this suggestion, and see if this is the case for other packages.
...onitor/monitor-query/recordings/node/metricsclient_live_tests/recording_listdefinitions.json
Show resolved
Hide resolved
} = require("@azure-tools/test-recorder"); | ||
const { relativeRecordingsPath } = require("@azure-tools/test-recorder"); | ||
|
||
process.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath(); |
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.
A passing observation: this has absolutely nothing to do with your changes and you don't need to do anything about it, but it irks me slightly that the environment variable is RECORDINGS_RELATIVE_PATH
('recordings', then 'relative'), but the function is the other way around ('relative', then 'recordings').
Co-authored-by: Timo van Veenendaal <me@timo.nz>
/azp run js - monitor-query - tests |
No pipelines are associated with this pull request. |
Azure Pipelines successfully started running 1 pipeline(s). |
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 like all the tests are not being run for @azure/monitor-query
. 😢
New
[node-tests] 9 passing (389ms)
[node-tests] 2 pending
https://dev.azure.com/azure-sdk/public/_build/results?buildId=1363590&view=results
Old
25 passing (982ms)
2 pending
https://dev.azure.com/azure-sdk/public/_build/results?buildId=1360303&view=results
Update on this: Only windows is running the 25 tests. Investigating why the other OS are not running all the tests. |
@@ -1,5 +0,0 @@ | |||
let nock = require('nock'); | |||
|
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.
Any idea why is this file deleted? This comes from one of the tests right?
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 was a generated file; it is no longer generated with the new recorder. File sdk/monitor/monitor-query/recordings/browsers/metricsclient_live_tests/recording_listnamespaces.json is being generated instead.
✅Fixed:
As you can see, the 💡To fix this, I added an extra path Kudos to @joheredi for helping with this bug.👏 CC: @HarshaNalluru |
/azp run js - monitor-query - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
LGTM!
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 great!
Packages impacted by this PR
@azure/monitor-query
Issues associated with this PR
Describe the problem that is addressed by this PR
This PR migrate monitor query to use new recorder and discard any use of the old one. It also updates the recordings. For more information check out this migration guide.
Checklists