-
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
[Recorder] Schema registry - migrate tests to the new recorder #19628
[Recorder] Schema registry - migrate tests to the new recorder #19628
Conversation
Thank you for your contribution harsha-nalluru! We will review the pull request and get back to you soon. |
… harshan/recorder/schema-registry
sdk/schemaregistry/schema-registry/review/schema-registry.api.md
Outdated
Show resolved
Hide resolved
...ry/recordings/node/schemaregistryclient/recording_allows_schema_names_with_dots_in_them.json
Show resolved
Hide resolved
sdk/schemaregistry/schema-registry/test/public/schemaRegistry.spec.ts
Outdated
Show resolved
Hide resolved
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 really like the new setup! I am impressed with how clean the new recordings are! I left a few comments.
Also, I am seeing this error in CI:
1) SchemaRegistryClient
"before each" hook for "sets fully qualified name space in constructor":
Error: SCHEMA_REGISTRY_ENDPOINT is not defined
at createRecordedClient (test\public\utils\recordedClient.ts:26:44)
at Context.<anonymous> (test\public\schemaRegistry.spec.ts:68:29)
at processImmediate (internal/timers.js:461:21)
Returned error code: 2
2) SchemaRegistryClient
"@azure/schema-registry" failed to build.
"after each" hook for "sets fully qualified name space in constructor":
TypeError: Cannot read property 'stop' of undefined
at Context.<anonymous> (test\public\schemaRegistry.spec.ts:94:20)
at processImmediate (internal/timers.js:461:21)
… harshan/recorder/schema-registry
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 am very excited to try this, unlike with the old recorder, I am hopeful the recording experience will be smooth sailing from here.
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.
Some thoughts. It looks good but I'm concerned about the fact that we don't expose pipeline here but have seemingly assumed in the recorder that this will always be the case.
schema = { | ||
name: "azsdk_js_test", | ||
groupName: env.SCHEMA_REGISTRY_GROUP, | ||
groupName: getEnvironmentVariable("SCHEMA_REGISTRY_GROUP"), |
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 feels like a regression to have to call a function to get an environment variable instead of being able to access it as a property of an object.
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.
Should I make env to be Record<string, string>
then?
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.
@witemple-msft you do not have to call the function, you just need to check whether the field you're accessing 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.
Should I make env to be
Record<string, string>
then?
Okay I see now that the reason the function exists is because it asserts that an environment variable is defined, but that you can still get the environment variable from env
, it just might be undefined. I would not change it to Record<string, string>.
It'd be helpful if the function name somehow conveys that it is not just getting the value of an environment variable, but will throw if it is not defined i.e. assertEnvironmentVariable
, or getEnvStrict
, etc.
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.
Updated. Calling it assertEnvironmentVariable
now.
Any objections? @deyaaeldeen @jeremymeng
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.
@harsha-nalluru Sounds good to me, thanks for iterating over this!
Co-authored-by: Will Temple <[email protected]>
… harshan/recorder/schema-registry
…/harsha-nalluru/azure-sdk-for-js into harshan/recorder/schema-registry
.../browsers/schemaregistryclient/recording_fails_to_get_schema_id_when_given_invalid_args.json
Show resolved
Hide resolved
.../browsers/schemaregistryclient/recording_fails_to_get_schema_id_when_given_invalid_args.json
Show resolved
Hide resolved
...aregistry/schema-registry/recordings/node/schemaregistryclient/recording_gets_schema_id.json
Show resolved
Hide resolved
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.
Too excited so I am approving for the second time 😅
"integration-test:browser": "karma start --single-run", | ||
"integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}*.spec.js\"", | ||
"integration-test:browser": "dev-tool run test:browser", | ||
"integration-test:node": "dev-tool run test:node-js-input -- --timeout 5000000 'dist-esm/test/**/*.spec.js'", |
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.
The {,!(browser)/**/}
part is gone?
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.
There were no browser specific tests.
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.
And I had some issue with }
in the command and I did not care to investigate further. 😋
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.
Look good!
… harshan/recorder/schema-registry
Based on the migration guide at #19210
Fixes #17999