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

chore: Enables tests in CI for mongodbatlas_privatelink_endpoint_service_data_federation_online_archive resource #2001

Conversation

lantoli
Copy link
Member

@lantoli lantoli commented Mar 8, 2024

Description

Enables skipped tests in CI for mongodbatlas_privatelink_endpoint_service_data_federation_online_archive resource.

  • Works in dev and qa using the same project name
  • 6 skipped tests enabled

Link to any related issue(s): CLOUDP-236603

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contribution guidelines
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • If changes include deprecations or removals, I defined an isolated PR with a relevant title as it will be used in the auto-generated changelog.
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Further comments

@lantoli lantoli marked this pull request as ready for review March 11, 2024 06:49
@lantoli lantoli requested a review from a team as a code owner March 11, 2024 06:49
// Skip because private endpoints are deleted daily from dev environment
acc.SkipTestForCI(t)
var (
projectID = acc.ProjectIDGlobal(t)
Copy link
Collaborator

Choose a reason for hiding this comment

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

unrelated to this PR: are we planning to document and explain how to re-use the different level of projects?

Copy link
Member Author

Choose a reason for hiding this comment

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

at least i was planning to describe the list of shared projects and what they're used for, but yeah we can add more help about how to decide what level of reuse to do, let me think more about how to document that


func projectID(tb testing.TB, name string) string {
tb.Helper()
SkipInUnitTest(tb)
Copy link
Collaborator

Choose a reason for hiding this comment

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

curious: why we do this? should we also document it?

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've added more documentation to SkipInUnitTest, let me know if it helps

// TF skipping test when TF_ACC=1 is not set is implemented inside resource.Test / ParallelTest functions.
// SkipInUnitTest allows to call functions in the test body that must not run in unit test mode, only in acc/mig mode.
// As an example it is used in ProjectIDGlobal so it can be called from the test methdod,
// or in TestAccConfigDSAtlasUser_ByUserID so it can call fetchUser.
Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines +57 to +58
mongodb_atlas_private_endpoint_id: ${{ secrets.MONGODB_ATLAS_PRIVATE_ENDPOINT_ID }}
mongodb_atlas_private_endpoint_dns_name: ${{ secrets.MONGODB_ATLAS_PRIVATE_ENDPOINT_DNS_NAME }}
Copy link
Member

Choose a reason for hiding this comment

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

in the case of QA are the endpoint_id and endpoint_dns_name the same value?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, i checked and it worked, they are AWS values.

in fact that's why any project can be used for these tests, not special config needed

Copy link
Collaborator

@EspenAlbert EspenAlbert left a comment

Choose a reason for hiding this comment

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

LGTM.
One question, how is the test-acc-tf-p-keep-global project created in dev/qa?

@lantoli
Copy link
Member Author

lantoli commented Mar 11, 2024

@EspenAlbert i created test-acc-tf-p-keep-global manually as it won't be deleted, i'll document all common projects and what config they need. this particular project doesn't need any extra config, just to be created with that name

@lantoli lantoli merged commit 7f8a674 into master Mar 11, 2024
45 checks passed
@lantoli lantoli deleted the CLOUDP-236603_privatelinkendpointservicedatafederationonlinearchive branch March 11, 2024 11:14
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.

5 participants