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

test: unit test provisioning in non-zonal regions #58

Merged
merged 9 commits into from
Dec 15, 2023

Conversation

tallaxes
Copy link
Collaborator

@tallaxes tallaxes commented Dec 12, 2023

Description

Update unit test environment to support testing zonal and non-zonal regions. Capture and use test SKU data from eastus and westcentralus (non-zonal). Adapt existing zonal tests to run for both zonal and non-zonal environments. Add unit test of provisioning in non-zonal region.

Details

  • Refactor pre-generated SKU data to support multiple regions

    • Uses map with region -> SKUs
    • Expect file per-region, with map entry populated via init()
    • Update resource SKU API fake to be region-aware and use the above
  • Update the SKU generation code for the above

    • Add support for generating SKU restriction data
    • Reduce auth configuration needs (use NewDefaultAzureCredential, docs), only SUBSCRIPTION_ID is required
    • Minor fixes
  • Update codegen (skugen) scripts to generate the above,

    • Generate for both eastus and westcentralus (non-zonal)
    • Remove the unnecessary auth
    • Check that subscription used is not too restrictive
  • Update unit test environment and test for non-zonal

    • Add support for non-zonal test environment
    • Adapt existing zone-aware tests to run for both zonal and non-zonal regions/environments
    • Add non-zonal provisioning test

How was this change tested?

  • make presubmit

Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: #
  • No

Release Note


@tallaxes tallaxes changed the title test: support unit-testing provisioning in non-zonal regions test: unit test provisioning in non-zonal regions Dec 12, 2023
@tallaxes tallaxes marked this pull request as ready for review December 12, 2023 04:26
rakechill
rakechill previously approved these changes Dec 14, 2023
Copy link
Contributor

@rakechill rakechill left a comment

Choose a reason for hiding this comment

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

Basically just had some questions sprawled throughout for my own understanding. One real suggestion is to add a fake.NonZonalRegion. Overall looks good, so I'll approve

hack/code/instancetype_testdata_gen.go Show resolved Hide resolved
hack/codegen.sh Show resolved Hide resolved
pkg/test/environment.go Outdated Show resolved Hide resolved
pkg/providers/instance/suite_test.go Show resolved Hide resolved
pkg/providers/instancetype/suite_test.go Show resolved Hide resolved
@tallaxes tallaxes merged commit 76a3b5a into main Dec 15, 2023
10 checks passed
@tallaxes tallaxes deleted the tallaxes/nonzonal-testing branch December 15, 2023 18:47
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.

2 participants