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

Add AttestationTestRunner and replace AttestationController #18076

Merged
merged 2 commits into from
May 10, 2022

Conversation

v-yuzhichen
Copy link
Contributor

Description

Checklist

  • I have read the Submitting Changes section of CONTRIBUTING.md
  • The title of the PR is clear and informative
  • The appropriate ChangeLog.md file(s) has been updated:
    • For any service, the ChangeLog.md file can be found at src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
    • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header -- no new version header should be added
  • The PR does not introduce breaking changes
  • If applicable, the changes made in the PR have proper test coverage
  • For public API changes to cmdlets:
    • a cmdlet design review was approved for the changes in this repository (Microsoft internal only)
      • {Please put the link here}
    • the markdown help files have been regenerated using the commands listed here

@v-yuzhichen v-yuzhichen added the Test Infra Test framework label May 9, 2022
@v-yuzhichen v-yuzhichen requested a review from ziyuezh576 May 9, 2022 12:08
Copy link
Contributor

@vidai-msft vidai-msft left a comment

Choose a reason for hiding this comment

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

Please change the code as per the comments below and then re-run all the tests.

{"Microsoft.Authorization", null}
}
).WithManagementClients(
GetResourceManagementClient,
Copy link
Contributor

Choose a reason for hiding this comment

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

This method invocation is not necessary. Please remove it

}
).WithManagementClients(
GetResourceManagementClient,
GetAttestationManagementClient,
Copy link
Contributor

Choose a reason for hiding this comment

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

This method invocation is not necessary. Please remove it

Copy link
Contributor

@ziyuezh576 ziyuezh576 May 10, 2022

Choose a reason for hiding this comment

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

Not all tests can pass after removed any of them. Message is:

Exception calling "Invoke" with "2" argument(s): "TestManagementClientHelper class wasn't initialized with the ResourceManagementClient client."
---> System.ArgumentException : TestManagementClientHelper class wasn't initialized with the ResourceManagementClient client.

.Build();
}

private static ResourceManagementClient GetResourceManagementClient(MockContext context)
Copy link
Contributor

Choose a reason for hiding this comment

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

This method definition is not necessary. Please remove it

return context.GetServiceClient<ResourceManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
}

private static AttestationManagementClient GetAttestationManagementClient(MockContext context)
Copy link
Contributor

Choose a reason for hiding this comment

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

This method definition is not necessary. Please remove it

Copy link
Contributor

@vidai-msft vidai-msft left a comment

Choose a reason for hiding this comment

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

Without WithManagementClients will set TestClientFactory instead of the MockClientFactory which resulted the issue. May need to remove this line of code after rolling out the new testfx code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Test Infra Test framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants