Skip to content

[Static Validation] Updated tests to better handle resources that don't have standard outputs + updated 'skip' behavior + fixed Pester test result reference + fixed readme param name#1482

Merged
AlexanderSehr merged 35 commits intomainfrom
users/alsehr/1473_securityCenter
Jun 7, 2022

Conversation

@AlexanderSehr
Copy link
Copy Markdown
Contributor

@AlexanderSehr AlexanderSehr commented Jun 4, 2022

Description

  • Fixed incorrect header test (fails all child modules)
  • Updated the tests to check if a primary resource exists in the module and only then test for standard outputs. A primary resource is defined by a resource that matches the module path. For example: The SecurityCenter module is in a path Microsoft.Security\azureSecurityCenter even though this resource type does not exist in the module. Instead the module is a collection of other resource type deployments and as a result it does not make sense to test for e.g. a Microsoft.Security\azureSecurityCenter resource ID
  • Fixed the reference of Pester test results. Currently shows 0 tests in the pipeline. With the change it shows:
    image
  • Also, I updated how tests are skipped using the Pester specific 'Skip' function. This allows us to be more specific in our test outputs and tests won't just show 'green' even though they didn't actually run if skipped. The result looks like this:
    image

Pipeline references

For module/pipeline changes, please create and attach the status badge of your successful run.

Pipeline
AnalysisServices: Servers
Security: AzureSecurityCenter
Authorization: PolicySetDefinitions

Type of Change

Please delete options that are not relevant.

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Update to documentation

@AlexanderSehr AlexanderSehr linked an issue Jun 4, 2022 that may be closed by this pull request
@AlexanderSehr AlexanderSehr self-assigned this Jun 4, 2022
@AlexanderSehr AlexanderSehr added bug Something isn't working [cat] testing category: testing enhancement New feature or request labels Jun 4, 2022
@AlexanderSehr AlexanderSehr changed the title [Testing] Updated tests to better handle resources that don't have standard outputs [Testing] Updated tests to better handle resources that don't have standard outputs + updated 'skip' behavior Jun 4, 2022
@AlexanderSehr AlexanderSehr enabled auto-merge (squash) June 4, 2022 17:15
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 4, 2022

Unit Test Results

    2 files  +    1      1 suites  +1   25s ⏱️ +25s
120 tests +120  112 ✔️ +112  8 💤 +8  0 ±0 
123 runs  +123  115 ✔️ +115  8 💤 +8  0 ±0 

Results for commit 8d13d84. ± Comparison against base commit 01caf8f.

♻️ This comment has been updated with latest results.

@AlexanderSehr AlexanderSehr changed the title [Testing] Updated tests to better handle resources that don't have standard outputs + updated 'skip' behavior [Testing] Updated tests to better handle resources that don't have standard outputs + updated 'skip' behavior + fixed Pester test result reference Jun 4, 2022
@AlexanderSehr AlexanderSehr changed the title [Testing] Updated tests to better handle resources that don't have standard outputs + updated 'skip' behavior + fixed Pester test result reference [Testing] Updated tests to better handle resources that don't have standard outputs + updated 'skip' behavior + fixed Pester test result reference + fixed readme param name Jun 7, 2022
Copy link
Copy Markdown
Contributor

@eriqua eriqua left a comment

Choose a reason for hiding this comment

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

🆗

@AlexanderSehr AlexanderSehr merged commit 86d5d35 into main Jun 7, 2022
@AlexanderSehr AlexanderSehr deleted the users/alsehr/1473_securityCenter branch June 7, 2022 17:46
@AlexanderSehr AlexanderSehr changed the title [Testing] Updated tests to better handle resources that don't have standard outputs + updated 'skip' behavior + fixed Pester test result reference + fixed readme param name [Static Validation] Updated tests to better handle resources that don't have standard outputs + updated 'skip' behavior + fixed Pester test result reference + fixed readme param name Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working [cat] testing category: testing enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report]: SecurityCenter module

2 participants