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

Update Operator Subnet tests to use mocks #1592

Merged
merged 1 commit into from May 1, 2023

Conversation

cesnietor
Copy link
Contributor

@cesnietor cesnietor commented Apr 28, 2023

Some tests were trying to make real requests which was slowing them down.

It also updated getTenantsToRegister to get all Tenant's minioClients so that we can perform the unittests much quicker. Here we'll be iterating twice but I wanted to accept that so that we could have better tests and be able to run them faster.

Before:
Screenshot 2023-04-28 at 3 29 41 PM
After:
Screenshot 2023-04-28 at 3 36 06 PM

Changes

  • Updated setTenantAdministrators to have minioClient as input.
  • Updated setTenantAdministrators tests to use mocks
  • Created tenantInterface
  • updated registerTenants to use tenantInterface
  • updated getTenantsToRegister to create tenantInterfaces per tenant including their minio Client

Test Steps

cd api && go test -v -run .

Some tests were trying to make real requests which was slowing them down
@cesnietor cesnietor self-assigned this Apr 28, 2023
@@ -617,14 +617,6 @@ func (suite *TenantTestSuite) TestSetTenantAdministratorsHandlerWithError() {
suite.assert.True(ok)
}

func (suite *TenantTestSuite) TestSetTenantAdministratorsWithAdminClientError() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed this cause it was not testing anything.

@dvaldivia dvaldivia merged commit 29e7431 into minio:master May 1, 2023
38 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants