Skip to content

Commit ecbab9b

Browse files
authored
Update safe-upgrades-helm-test.md
1 parent f4218a4 commit ecbab9b

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

articles/operator-service-manager/safe-upgrades-helm-test.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@ ms.service: azure-operator-service-manager
99
---
1010

1111
# Run tests after install or upgrade
12-
This article describes how Azure Operator Service Manager (AOSM) can run tests on deployed network functions (NFs) as part install or upgrade operations. When enabled, each network function application (nfApp) will be tested after install or upgrade completion. A successful result across all nfApp tests is required for the NF operation status to complete successfully.
12+
This article describes how Azure Operator Service Manager (AOSM) can run tests on network functions (NFs) as part of install or upgrade operations. When enabled, each network function application (nfApp) is tested after component install or upgrade completion. A successful result across all nfApp tests is required for the NF operation status to complete successfully.
1313

1414
## Overview
15-
This feature's scope is to run helm tests as part of the network function install or upgrade operations.
15+
As part of the safe upgrade program, AOSM supports the use of helm tests as a gating step during network function install or upgrade operations. The following workflow describes the logic used by AOSM when including this extra layer of validation:
1616
* Users author their own tests and include them within the helm package during NF onboarding.
1717
* Only where enabled, AOSM executes these helm tests on each nfApp.
1818
* Upon test success, AOSM proceeds to the next nfApp.
19-
* Upon test failure, AOSM honors `RollbackOnTestFail` flag to determine if the nfApp is rolled back.
19+
* Upon test failure, AOSM honors `rollbackOnTestFail` to determine if the nfApp is rolled back.
2020
* The parent NF operation terminates with failure if any nfApp fails a configured test.
2121
* Upon parent failure, AOSM honors the configured method of NF failure control, either `pause-on-failure` or `rollback-on-failure`.
2222

2323
> [!NOTE]
24-
> * Helm Test is only supported as part of the install or upgrade operation and can't be run separately.
24+
> Helm test is only supported as part of the install or upgrade operation and can't be run standalone.
2525
2626
## Authoring helm tests
2727
The publisher is responsible for authoring the helm tests during construction of the helm charts. The helm tests are defined in the helm chart under the folder: `<ChartName>/Templates/`. Each test includes a job definition that specifies a container environment and command to run. The container environment should exit successfully for a test to be considered a success. The job definition must include the helm test hook annotation `(helm.sh/hook: test)` to be recognized as a test by helm.
2828

2929
## Enable helm tests during operations
30-
AOSM provides a set of configurable install and upgrade options for each component under an NF. These existing options are extended with a new `testOptions` parameter. This parameter gives the user the ability to specify `testOptions` per nfApp and as per the type of operation. The `testOptions` feature supports the following parameters:
30+
AOSM provides a set of configurable install and upgrade options for each nfApp. These existing options are extended with a new `testOptions` parameter. With this parameter the user can specify `testOptions` settings per nfApp and per type of operation. The `testOptions` parameter supports the following parameters:
3131

3232
* enable
3333
* Enables or disables the helm test on a nfApp after install or upgrade completes.
@@ -36,25 +36,26 @@ AOSM provides a set of configurable install and upgrade options for each compone
3636
* Takes a value that represents the test time-out in minutes.
3737
* Default value is 20 minutes.
3838
* rollbackOnTestFailure
39-
* Enables or disables component rollback on helm test failure.
39+
* Enables or disables rollback on nfApp helm test failure.
4040
* Default value is true.
4141
* filter
42-
* Allows for a method to run only a subset of chart tests. Accepts a list of strings where each string in the list represents a test name to include.
43-
* Default value is no filter.
42+
* Allows for a method to run only a subset of tests. Accepts a list of strings, where each string in the list represents a test to execute.
43+
* Default value is no filter and all tests are run.
4444

4545
## Exposing helm test control via parameters
46-
Users already can use the NF payload parameter `roleOverrideValues` to specify settings for `installOptions` and `upgradeOptions`. These fields are now extended to include settings for `testOptions` which can be specified for each nfApplication and each operation method. See the following example of `roleOverrideValues` usage where the NF Payload defines `installOptions` and `upgradeOptions` including `testOptions` for a component named `application1`.
46+
AOSM already supports the NF payload parameters `installOptions` and `upgradeOptions` for each nfApp under `roleOverrideValues`. These parameters are extended to include new `testOptions` settings. Exposing these new parameter settings allows the Operator to control the upgrade behavior at run-time. See the three following examples demonstrating usage of `testOptions`.
4747

48-
## roleOverrideValues escaped example:
49-
Following is an escaped example `roleOverrideValues` with `testOptions` under `installOptions` and `upgradeOptions` for a component named `application1`. This example uses a `filter` to execute only tests which match the string provided.
48+
## roleOverrideValues escaped example
49+
Following is an escaped example `roleOverrideValues` with `testOptions` under `installOptions` and `upgradeOptions` for a component named `application1`. This example uses a `filter`, to execute only tests which match the string provided, uses a custom time-out and enables `rollbackOnTestFailures`.
5050

5151
```
5252
"roleOverrideValues": [
5353
"{\"name\":\"application1\",\"deployParametersMappingRuleProfile\":{\"helmMappingRuleProfile\":{\"helmPackageVersion\":\"2.1.3\",\"values\":\"{\\\"roleOneParam\\\":\\\"roleOneOverrideValue\\\"}\",\"options\":{\"installOptions\":{\"atomic\":\”true\”,\"wait\":\"true\",\"timeout\":\"30m\",\”testOptions\”:{\”enable\”:\”true\”,\”timeout\”:\”15\”,\”rollbackOnTestFailure\”:\”true\”,\”filter\”:[\”test1\”,\”test2\”,\”test3\”]}},\"upgradeOptions\":{\"atomic\": \”true\”,\"wait\":\"true\",\"timeout\":\"30\", \”testOptions\”:{\”enable ”:\”true\”,\”timeout\”:\”15\”,\”rollbackOnTestFailure\”:\”true\”,\” filter \”:[\”test1\”,\”test2\”,\”test3\”]}}}}}}"]
5454
```
5555

56-
## roleOverrideValues unescaped example:
57-
Following is an unescaped example `roleOverrideValues` NF Payload with `testOptions` under `installOptions` and `upgradeOptions` for a component named `hellotest`. This example uses a `filter` to execute only those test which match the string provided.
56+
## roleOverrideValues unescaped example
57+
Following is an unescaped example `roleOverrideValues` NF Payload with `testOptions` under `installOptions` and `upgradeOptions` for a component named `hellotest`. This example uses a `filter` to execute only tests which match the string provided, uses a custom time-out and enables `rollbackOnTestFailures`.
58+
5859
```
5960
"roleOverrideValues": ["{
6061
"name":"hellotest",
@@ -65,25 +66,25 @@ Following is an unescaped example `roleOverrideValues` NF Payload with `testOpti
6566
"atomic":"true",
6667
"wait":"true",
6768
"timeout":"1"
68-
“testOptions”: {
69-
“enable”: “true”,
70-
“timeout”: “10”,
71-
“rollbackOnTestFailure”: “true”,
72-
"filter”: [“test1”, “test2”] } },
69+
“testOptions”: {
70+
“enable”: “true”,
71+
“timeout”: “10”,
72+
“rollbackOnTestFailure”: “true”,
73+
"filter”: [“test1”, “test2”] } },
7374
"upgradeOptions": {
7475
"atomic":"true",
7576
"wait":"true",
7677
"timeout":"2",
77-
“testOptions”: {
78-
“enable”: “true”,
79-
“timeout”: “10”,
80-
“rollbackOnTestFailure”: “true”,
81-
"filter”: [“test1”, “test2”] } } } } } }"
78+
“testOptions”: {
79+
“enable”: “true”,
80+
“timeout”: “10”,
81+
“rollbackOnTestFailure”: “true”,
82+
"filter”: [“test1”, “test2”] } } } } } }"
8283
]
8384
```
8485

8586
## NF payload example
86-
Following is an example NF Payload with `testOptions` under `installOptions` and `upgradeOptions` for a component named `application1`. This example uses a `filter` to execute only those test which match the string provided.
87+
Following is an example NF Payload with `testOptions` under `installOptions` and `upgradeOptions` for a component named `application1`. This example uses a `filter` to execute only tests which match the string provided, uses a custom time-out and enables `rollbackOnTestFailures`.
8788

8889
```
8990
{

0 commit comments

Comments
 (0)