@@ -9,6 +9,7 @@ Runbook Reference
99 - `Use variable and secrets <#use-variable-and-secrets >`__
1010 - `Use partial runbook <#use-partial-runbook >`__
1111 - `Use extensions <#use-extensions >`__
12+ - `Conditionally enable/disable environments or nodes <#conditionally-enable-disable-environments-or-nodes >`__
1213
1314- `Reference <#reference >`__
1415
@@ -89,6 +90,7 @@ Runbook Reference
8990 - `environments <#environments >`__
9091
9192 - `name <#name-4 >`__
93+ - `enabled <#enabled >`__
9294 - `topology <#topology >`__
9395 - `nodes <#nodes >`__
9496 - `nodes_requirement <#nodes-requirement >`__
@@ -153,8 +155,8 @@ name ``hello``.
153155
154156 Below section demonstrates how to configure test cases with retry, repetition,
155157and timeout settings. The first test case will automatically retry up to 2 times
156- if it fails, redeploying the environment for each retry attempt. The second test
157- case demonstrates stress testing by running 3 times unconditionally (regardless
158+ if it fails, redeploying the environment for each retry attempt. The second test
159+ case demonstrates stress testing by running 3 times unconditionally (regardless
158160of pass/fail) with a custom timeout of 1 hour.
159161
160162.. code :: yaml
@@ -257,6 +259,59 @@ modules for test cases or extended features.
257259 path : ../../extensions
258260 - ../../lisa/microsoft/testsuites/core
259261
262+ Conditionally enable/disable environments or nodes
263+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
264+
265+ You can use the ``enabled `` field to conditionally enable or disable entire
266+ environments or individual nodes within an environment. This is particularly
267+ useful when combined with variables for dynamic configuration.
268+
269+ Below example shows how to enable/disable environments based on a variable:
270+
271+ .. code :: yaml
272+
273+ variable :
274+ - name : use_prod
275+ value : true
276+ - name : use_dev
277+ value : false
278+
279+ environment :
280+ environments :
281+ - name : production_env
282+ enabled : $(use_prod) # Controlled by variable
283+ nodes :
284+ - type : local
285+ - name : dev_env
286+ enabled : $(use_dev) # This environment will be skipped
287+ nodes :
288+ - type : local
289+
290+ Below example shows how to selectively disable specific nodes within an environment:
291+
292+ .. code :: yaml
293+
294+ environment :
295+ environments :
296+ - name : multi_node_env
297+ nodes :
298+ - name : primary_node
299+ type : local
300+ enabled : true # Always enabled
301+ - name : secondary_node
302+ type : local
303+ enabled : false # Temporarily disabled
304+ - name : optional_node
305+ type : remote
306+ address : 192.168.1.100
307+ enabled : $(include_remote_node) # Variable-controlled
308+
309+ This allows you to:
310+
311+ - Temporarily disable environments or nodes without deleting their configuration
312+ - Use variables to control which environments/nodes are active
313+ - Maintain multiple environment configurations and switch between them dynamically
314+
260315Use transformers
261316~~~~~~~~~~~~~~~~
262317
@@ -794,7 +849,7 @@ test execution logs and code context from the LISA framework.
794849The log_agent notifier uses a multi-agent AI system that combines:
795850
796851- **LogSearchAgent **: Specialized in searching and analyzing log files for error patterns
797- - **CodeSearchAgent **: Examines source code files and analyzes implementations related to errors
852+ - **CodeSearchAgent **: Examines source code files and analyzes implementations related to errors
798853- **Magentic Orchestration **: Coordinates the agents to provide comprehensive analysis
799854
800855The analysis results are attached to test result messages and made available to
@@ -809,7 +864,7 @@ downstream notifiers and reporting systems.
809864
8108652. **Required Python packages ** (automatically included with LISA):
811866 - python-dotenv
812- - semantic-kernel
867+ - semantic-kernel
813868 - azure-ai-inference
814869 - retry
815870
@@ -827,7 +882,7 @@ azure_openai_api_key
827882
828883type: str, optional, default: ""
829884
830- Azure OpenAI API key for authentication. If not set, the notifier will use
885+ Azure OpenAI API key for authentication. If not set, the notifier will use
831886default authentication methods available in the environment.
832887
833888Note: This value is automatically marked as secret and will be masked in logs.
@@ -897,7 +952,7 @@ Example of log_agent notifier:
8979525. **Evidence Gathering **: Searches for supporting evidence in logs
8989536. **Root Cause Analysis **: Provides comprehensive analysis with actionable insights
899954
900- The AI analysis results are stored in the test result message's ``analysis["AI"] ``
955+ The AI analysis results are stored in the test result message's ``analysis["AI"] ``
901956field and can be consumed by other notifiers like HTML or custom reporting systems.
902957
903958environment
@@ -925,6 +980,30 @@ type: str, optional, default is empty
925980
926981The name of the environment.
927982
983+ enabled
984+ '''''''
985+
986+ type: bool, optional, default is true
987+
988+ Controls whether the environment is loaded and used during test execution. When
989+ set to ``false ``, the environment will be skipped during initialization. This is
990+ useful for definining multiple similar environments in the same runbook.
991+
992+ Example:
993+
994+ .. code :: yaml
995+
996+ environment :
997+ environments :
998+ - name : prod_env
999+ enabled : true # This environment will be loaded
1000+ nodes :
1001+ - type : local
1002+ - name : dev_env
1003+ enabled : $(use_dev_env) # Variable-controlled
1004+ nodes :
1005+ - type : local
1006+
9281007 topology
9291008''''''''
9301009
@@ -939,6 +1018,32 @@ List of node, it can be a virtual machine on Azure or Hyper-V, bare metal or
9391018others. For more information, refer to :ref: `write_test/concepts:node and
9401019environment`.
9411020
1021+ Each node supports an ``enabled `` field:
1022+
1023+ **enabled ** (bool, optional, default is true): Controls whether the node is
1024+ loaded during environment initialization. When set to ``false ``, the node will
1025+ be skipped. This is useful for selecting specific nodes from the same
1026+ environment configuration.
1027+
1028+ Example:
1029+
1030+ .. code :: yaml
1031+
1032+ environment :
1033+ environments :
1034+ - name : test_env
1035+ nodes :
1036+ - name : node1
1037+ type : local
1038+ enabled : true # This node will be loaded
1039+ - name : node2
1040+ type : local
1041+ enabled : false # This node will be skipped
1042+ - name : node3
1043+ type : remote
1044+ address : 192.168.1.100
1045+ enabled : $(enable_node3) # Variable-controlled
1046+
9421047 nodes_requirement
9431048'''''''''''''''''
9441049
@@ -1038,15 +1143,15 @@ timeout
10381143
10391144type: int, optional, default is 0
10401145
1041- Timeout in seconds for each test case. When a test case runs, LISA uses the
1042- maximum value between the timeout specified in the runbook and the test case's
1043- own metadata timeout. If this field is set to 0 (default) or not specified, only
1044- the test case's metadata timeout is used (which defaults to 3600 seconds / 1 hour
1045- if not explicitly set in the test case). This allows you to extend timeouts for
1146+ Timeout in seconds for each test case. When a test case runs, LISA uses the
1147+ maximum value between the timeout specified in the runbook and the test case's
1148+ own metadata timeout. If this field is set to 0 (default) or not specified, only
1149+ the test case's metadata timeout is used (which defaults to 3600 seconds / 1 hour
1150+ if not explicitly set in the test case). This allows you to extend timeouts for
10461151specific test runs without modifying the test case code.
10471152
1048- Note that this timeout applies to the overall test case execution. Any additional
1049- command-level timeouts set within the test case code itself will not be affected
1153+ Note that this timeout applies to the overall test case execution. Any additional
1154+ command-level timeouts set within the test case code itself will not be affected
10501155by this setting.
10511156
10521157.. code :: yaml
0 commit comments