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

Fix flaky recipe parameter test by removing constant resource name #4995

Merged
merged 6 commits into from
Jan 23, 2023

Conversation

mishrapratikshya
Copy link
Contributor

@mishrapratikshya mishrapratikshya commented Jan 21, 2023

Description

Fix flaky recipe parameter test by removing constant resource name
Added resourceGroup name to the account and mongodb name.

Issue reference

Fixes: radius-project/core-team#1083

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Adds necessary unit tests for change
  • Adds necessary E2E tests for change
  • Unit tests passing
  • Extended the documentation / Created issue for it

documentdbName: 'account-developer-parameters'
mongodbName: 'mongodb-developer-parameters'
documentdbName: 'acnt-developer-${rg}'
mongodbName: 'mdb-developer-${rg}'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

renamed it as the length of the account should be less than 3 characters or more than 44 characters long.

@mishrapratikshya mishrapratikshya marked this pull request as ready for review January 23, 2023 16:27
@mishrapratikshya mishrapratikshya requested a review from a team as a code owner January 23, 2023 16:27
@mishrapratikshya mishrapratikshya merged commit b373d93 into main Jan 23, 2023
@mishrapratikshya mishrapratikshya deleted the pratmishra/fixFlakyRecipeParameterTest branch January 23, 2023 18:19
documentdbName: 'account-developer-parameters'
mongodbName: 'mongodb-developer-parameters'
documentdbName: 'acnt-developer-${rg}'
mongodbName: 'mdb-developer-${rg}'
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to use env variable instead of resourceGroup() function?

Copy link
Contributor Author

@mishrapratikshya mishrapratikshya Jan 23, 2023

Choose a reason for hiding this comment

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

Comment on lines +224 to +228
// skip the test if INTEGRATION_TEST_RESOURCE_GROUP_NAME is not set
// for running locally set the INTEGRATION_TEST_RESOURCE_GROUP_NAME with the test resourceGroup
if rg == "" {
t.Skip("This test needs the env variable INTEGRATION_TEST_RESOURCE_GROUP_NAME to be set")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason we need to add this check? How would we know if the test is just silently being skipped?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this check for local testing. If some one runs the test without setting INTEGRATION_TEST_RESOURCE_GROUP_NAME then it will skip.

Comment on lines +257 to +262
Identity: "acnt-developer-" + rg,
},
{
Provider: resourcemodel.ProviderAzure,
LocalID: outputresource.LocalIDAzureCosmosDBMongo,
Identity: "mongodb-developer-parameters",
Identity: "mdb-developer-" + rg,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are these name validations needed for this particular test? Is there anything special being done on the server side for this scenario that we are trying to validate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The mongo resources in the recipe are getting deployed with these names. This is what the developer sets while creating mongo link.

anamikapan pushed a commit that referenced this pull request Jan 23, 2023
…4995)

# Description

Fix flaky recipe parameter test by removing constant resource name
Added resourceGroup name to the account and mongodb name.

## Issue reference

<!--
We strive to have all PR being opened based on an issue, where the
problem or feature have been discussed prior to implementation.
-->

Fixes: #4992 

## Checklist

Please make sure you've completed the relevant tasks for this PR, out of
the following list:

* [x] Code compiles correctly
* [ ] Adds necessary unit tests for change
* [ ] Adds necessary E2E tests for change
* [x] Unit tests passing
* [ ] Extended the documentation / Created issue for it
@@ -77,8 +77,8 @@ resource recipedb 'Applications.Link/mongoDatabases@2022-03-15-privatepreview' =
recipe: {
name: 'mongodb'
parameters: {
documentdbName: 'account-developer-parameters'
mongodbName: 'mongodb-developer-parameters'
documentdbName: 'acnt-developer-${rg}'
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use a dynamically generated name for account to avoid name collisions in tests? You can either validate by matching prefix or remove account name from parameters and rely just on the database name.

mishrapratikshya added a commit that referenced this pull request Feb 2, 2023
…4995)

# Description

Fix flaky recipe parameter test by removing constant resource name
Added resourceGroup name to the account and mongodb name.

## Issue reference

<!--
We strive to have all PR being opened based on an issue, where the
problem or feature have been discussed prior to implementation.
-->

Fixes: #4992 

## Checklist

Please make sure you've completed the relevant tasks for this PR, out of
the following list:

* [x] Code compiles correctly
* [ ] Adds necessary unit tests for change
* [ ] Adds necessary E2E tests for change
* [x] Unit tests passing
* [ ] Extended the documentation / Created issue for it
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.

4 participants