You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Testing PoC: Modules should be more self-contained for testing #329
Modues are currently dependent on pre-deployed dependencies to work (e.g. VNETs, MSIs, etc.).
It would be better if we'd have a universal logic that allows modules to deploy their own dependencies instead. Ideally even in their own resource group (for Rg-Level resources) so that we can just remove the resource group instead of individual resources from it.
Update # 1:
It was decided to have a single dependency file per module and deploy it before the parameter file deployments - and remove the dependency resources afterwards again.
Current pipeline
The current pipeline looks like
There are different variants we could implement, as documented in the following:
Variant 1
There is one simply approach (which we discarded):
The following two pipeline variants will be implemented as part of a PoC:
Variant 2
Variant 3
Other options:
Update # 2:
Variant 4
Variant 5
Analysis Services Example
It was further decided to use plain resources (not our own modules) in the dependency file(s).
Note: Regardless of the implemented approach we should add features such as the Parameter-Matrix & Stage-template for Azure DevOps.
Also rename the resourceGroupName: 'validation-rg' variable to something like defaultResourceGroupName: 'validation-rg'
The stages template should use the default rg-name as a default for its input parameter moduleResourceGroupName: '$(defaultResourceGroupName)'. This helps us deal with pipelines that don't have dependencies implemented yet - though we still need to add some logic in the deploy step to skip itself it no template is found in the given/expected path (e.g. the dependency)
Regarding dependencies.bicep (file(s))
Leaning towards the PGs main.test.bicep - using raw resources instead (aside from centralized concepts like diagnostics)
This would however render most of our pipeline 'unnecessay'. (which can of course be a good thing).
Some 'challenges' of that approach
We need to figure out how best to pull in tokens into the deployment file (e.g. what about deploymentSPID). Ideally it's not a new parameter for each token but e.g. a map/hashtable/object
One big bang failure if one of the test cases fails (may require us to add some code to drill into the issues and return the results to the user)
Resources are removed only after ALL resources were deployed (instead of e.g. min be removed directly after being done, without waiting for max)
References that required nested deployments may be tricky. For example a kv.getSecret() invocation on a just created key vault may not work but require a nested deployment. Similar to key-versions.
Some additional considerations valid for all the approaches:
Coexistence between old and new approach: Converting all modules to the new approach will take quite some effort and we cannot commit to do it in one PR or in a short maintenance window. Thus we must ensure the new dependencies approach is able to run in parallel with the old one. For this reason we should introduce a check to verify if the module is using the new dependencies approach or not. Pipelines code should ideally work in both cases, possibly skip unnecessary steps (e.g. dependencies deployment) when not useful
Ensure new approach is valid at all scopes: this should already be the case after an update to the deployment validation job that will be presented together with the new approach, but it won't hurt to test this more thoroughly
Keep current dependencies pipeline for edge cases: we should discuss if keeping the current dependencies pipeline for edge cases that wouldn't be covered by the new approach, which are:
Modules requiring dependencies taking a long time to be deployed: e.g. the ones requiring a .vhd file which deployment takes about 2h
Module for which dependencies require a pipeline orchestrated approach to be deployed (e.g. the ones requiring kv secrets)
random names: we must ensure them to be predictable to ensure idempotency
readme files: let's discuss if removing examples from the readme since they would be included in the tests OR if we want to extract the specific module snippet only (remove dependencies)
should we still commit to support arm/json until Bicep GA?
The team will go forward with Variant 5. To this end I created the issue #1583 which should be followed up by subsequent issues to implement the test files.
changed the title [-]Testing: Modules should be more self-contained for testing[/-][+]Testing PoC: Modules should be more self-contained for testing[/+]on Jul 14, 2022
Activity
AlexanderSehr commentedon May 19, 2022
Some notes for the idea in general:
Pro
Con
AlexanderSehr commentedon Jun 10, 2022
Suggested changes (in discussion with Ahmad Abdalla (@ahmadabdalla))
customResourceGroupName: 'test-ms.analysisservices-servers-rg'->moduleResourceGroupName: 'module-ms.analysisservices-servers-rg'resourceGroupName: 'validation-rg'variable to something likedefaultResourceGroupName: 'validation-rg'moduleResourceGroupName: '$(defaultResourceGroupName)'. This helps us deal with pipelines that don't have dependencies implemented yet - though we still need to add some logic in the deploy step to skip itself it no template is found in the given/expected path (e.g. the dependency)Regarding dependencies.bicep (file(s))
main.test.bicep- using rawresourcesinstead (aside from centralized concepts like diagnostics)kv.getSecret()invocation on a just created key vault may not work but require a nested deployment. Similar to key-versions.MariusStorhaug commentedon Jun 10, 2022
eriqua commentedon Jun 14, 2022
Some additional considerations valid for all the approaches:
AlexanderSehr commentedon Jun 16, 2022
In a first step we decided to Implement variant 4 if we go with dedicated parameter files
eriqua commentedon Jun 17, 2022
Variant 5
Some food for thoughts to discuss
AlexanderSehr commentedon Jun 23, 2022
The team will go forward with Variant 5. To this end I created the issue #1583 which should be followed up by subsequent issues to implement the test files.
[-]Testing: Modules should be more self-contained for testing[/-][+]Testing PoC: Modules should be more self-contained for testing[/+]