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
[BEEEP][SM-893] Add the ability to run SM integration tests as a service account #3187
Conversation
New Issues
Fixed Issues
|
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.
Awesome, glad we are adding this, thanks Thomas!
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3187 +/- ##
==========================================
+ Coverage 36.58% 36.73% +0.15%
==========================================
Files 1174 1174
Lines 56627 56627
Branches 5425 5425
==========================================
+ Hits 20716 20803 +87
+ Misses 34944 34859 -85
+ Partials 967 965 -2 ☔ View full report in Codecov by Sentry. |
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 good, I like the addition of LoginHelper
. Thanks!
…ice account (#3187) * Add the ability to run SM integration tests as a service account
Type of change
Objective
The purpose of this PR is to add the ability to run SM integration tests as a service account.
Introducing a
LoginHelper
to house the duplicate logic in the integration tests that were setting client authorization headers.Code changes
test/Api.IntegrationTest/Factories/ApiApplicationFactory.cs:
Added a method to login via client secret (API key) that returns the authentication access token.
test/Api.IntegrationTest/SecretsManager/Helpers/LoginHelper.cs:
Adding a helper that provides methods to login via email and Api key which will:
test/Api.IntegrationTest/SecretsManager/Controllers/AccessPoliciesControllerTests.cs:
Migrate to using the
LoginHelper
test/Api.IntegrationTest/SecretsManager/Controllers/ProjectsControllerTests.cs:
Migrate to using the
LoginHelper
test/Api.IntegrationTest/SecretsManager/Controllers/SecretsControllerTests.cs:
Migrate to using the
LoginHelper
.Demonstrate using the new service account login method.
test/Api.IntegrationTest/SecretsManager/Controllers/SecretsManagerPortingControllerTests.cs:
Migrate to using the
LoginHelper
test/Api.IntegrationTest/SecretsManager/Controllers/SecretsTrashControllerTests.cs:
Migrate to using the
LoginHelper
test/Api.IntegrationTest/SecretsManager/Controllers/ServiceAccountsControllerTests.cs:
Migrate to using the
LoginHelper
test/Api.IntegrationTest/SecretsManager/Enums/PermissionType.cs:
Add running as a service account with permission into the testing enum.
test/Api.IntegrationTest/SecretsManager/SecretsManagerOrganizationHelper.cs:
Add a helper method for creating a service account and API key/access token for the service account.
test/IntegrationTestCommon/Factories/IdentityApplicationFactory.cs:
Add a method for logging in with a service account access token (API key).
Before you submit
dotnet format --verify-no-changes
) (required)