Skip to content
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

[identity] Re-enable tests #29778

Merged
merged 4 commits into from
May 21, 2024
Merged

Conversation

maorleger
Copy link
Member

@maorleger maorleger commented May 21, 2024

Re-enabled tests in playback mode, including better filtering in live mode to skip the MI tests

@@ -23,7 +23,7 @@ describe("getBearerTokenProvider", function () {
const scope = "https://vault.azure.net/.default";

it("returns a callback that returns string tokens", async function () {
const credential = new EnvironmentCredential(recorder.configureClientOptions({}));
const credential = new DefaultAzureCredential(recorder.configureClientOptions({}));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to think through this a bit. But it's probably fine for now...

Copy link
Member

@KarishmaGhiya KarishmaGhiya May 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah how do we know which cred it picks up in the unit tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wanted to say that I agree with your question 😄 it's not clear or deterministic.

Now that CI / recorded tests are running and green again, I plan to review our tests in live mode. I'll revisit this one and choose a more specific credential as part of that. Thanks for following up with me offline!

ssh-keygen -t rsa -b 4096 -f $PSScriptRoot/sshKey -N '' -C ''
$sshKey = Get-Content $PSScriptRoot/sshKey.pub

$templateFileParameters['sshPubKey'] = $sshKey
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a required item in the template, so we should be generating it always. Otherwise, you cannot deploy test resources

@@ -121,12 +121,12 @@ export async function msalNodeTestSetup(
{
regex: true,
target: `x-client-OS=[a-zA-Z0-9]+`,
value: `x-client-OS=x-client-OS`,
value: `x-client-OS=Sanitized`,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really ended up being the only diff.., It was getting double-sanitized so replacing it with something that is not the key itself prevents it. I don't understand why or how it works, but let's get tests running again 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe double sanitized, because we might be calling the same function twice at 2 different places - one might be getting called from inside of another file?

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@maorleger maorleger marked this pull request as ready for review May 21, 2024 20:06
@maorleger maorleger enabled auto-merge (squash) May 21, 2024 20:39
@maorleger maorleger requested a review from HarshaNalluru May 21, 2024 20:39
@maorleger maorleger disabled auto-merge May 21, 2024 20:40
@maorleger maorleger merged commit 8215067 into Azure:main May 21, 2024
48 checks passed
@maorleger maorleger deleted the restore-identity-tests branch May 21, 2024 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

3 participants