Skip to content

Commit caf873f

Browse files
author
Aravindhan Palanisamy
committed
add implemetation
1 parent 9b13e70 commit caf873f

File tree

8 files changed

+77
-63
lines changed

8 files changed

+77
-63
lines changed

examples/test_plan/test_plan_templates.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
test_program="TP-INT-002",
3030
estimated_duration_in_seconds=86400,
3131
system_filter="os:linux AND arch:x64",
32+
dut_Filter="modelName = 'cRIO-9045' AND serialNumber = '01E82ED0'",
3233
execution_actions=[
3334
ManualExecution(action="boot", type="MANUAL"),
3435
JobExecution(

examples/test_plan/test_plans.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@
3232
properties={"env": "staging", "priority": "high"},
3333
part_number="px40482",
3434
dut_id="Sample-Dut_Id",
35+
dut_serial_number="serial_number_123",
3536
test_program="TP-Integration-001",
3637
system_filter="os:linux AND arch:x64",
38+
dut_Filter="modelName = 'cRIO-9045' AND serialNumber = '01E82ED0'",
3739
workspace="your_workspace_id",
3840
file_ids_from_template=["file1", "file2"],
3941
dashboard=Dashboard(

nisystemlink/clients/test_plan/models/_create_test_plan_request.py

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,47 +12,53 @@ class CreateTestPlanRequest(JsonModel):
1212
name: Optional[str] = None
1313
"""The name of the test plan."""
1414

15-
template_id: Optional[str] = None
16-
"""The ID of the template to use for the test plan."""
17-
1815
state: Optional[str] = None
1916
"""The state of the test plan."""
2017

18+
template_id: Optional[str] = None
19+
"""The ID of the template to use for the test plan."""
20+
2121
description: Optional[str] = None
2222
"""A description of the test plan."""
2323

2424
assigned_to: Optional[str] = None
2525
"""The user or group assigned to the test plan."""
2626

27-
work_order_id: Optional[str] = None
28-
"""The work order ID associated with the test plan."""
29-
30-
estimated_duration_in_seconds: Optional[int] = None
31-
"""The estimated duration of the test plan in seconds."""
32-
33-
properties: Optional[Dict[str, str]] = None
34-
"""Additional properties for the test plan."""
35-
3627
part_number: Optional[str] = None
3728
"""The part number associated with the test plan."""
3829

3930
dut_id: Optional[str] = None
4031
"""The Device Under Test (DUT) ID."""
4132

33+
dut_serial_number: Optional[str] = None
34+
"""The Device Under Test (DUT) serial number."""
35+
4236
test_program: Optional[str] = None
4337
"""The test program associated with the test plan."""
4438

39+
work_order_id: Optional[str] = None
40+
"""The work order ID associated with the test plan."""
41+
42+
estimated_duration_in_seconds: Optional[int] = None
43+
"""The estimated duration of the test plan in seconds."""
44+
4545
system_filter: Optional[str] = None
4646
"""The system filter to apply."""
4747

48-
workspace: Optional[str] = None
49-
"""The workspace associated with the test plan."""
48+
dut_filter: Optional[str] = None
49+
"""The DUT filter to apply."""
50+
51+
execution_actions: Optional[List[ExecutionDefinition]] = None
52+
"""List of execution actions for the test plan."""
5053

5154
file_ids_from_template: Optional[List[str]] = None
5255
"""List of file IDs from the template."""
5356

57+
workspace: Optional[str] = None
58+
"""The workspace associated with the test plan."""
59+
60+
properties: Optional[Dict[str, str]] = None
61+
"""Additional properties for the test plan."""
62+
5463
dashboard: Optional[Dashboard] = None
5564
"""The dashboard associated with the test plan."""
56-
57-
execution_actions: Optional[List[ExecutionDefinition]] = None
58-
"""List of execution actions for the test plan."""

nisystemlink/clients/test_plan/models/_query_test_plan_templates_request.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class TestPlanTemplateField(str, Enum):
2929
TEST_PROGRAM = "TEST_PROGRAM"
3030
ESTIMATED_DURATION_IN_SECONDS = "ESTIMATED_DURATION_IN_SECONDS"
3131
SYSTEM_FILTER = "SYSTEM_FILTER"
32+
DUT_FILTER = "DUT_FILTER"
3233
EXECUTION_ACTIONS = "EXECUTION_ACTIONS"
3334
FILE_IDS = "FILE_IDS"
3435
WORKSPACE = "WORKSPACE"
@@ -60,6 +61,7 @@ class QueryTestPlanTemplatesRequest(WithPaging):
6061
`testProgram`: String representing the test program name of the test plan created from this
6162
template.
6263
`systemFilter`: String representing the LINQ filter used to filter the potential list of systems
64+
`dutFilter`: String representing the LINQ filter used to filter the potential list of DUTs
6365
capable of executing test plans created from this template.
6466
`workspace`: String representing the workspace where the test plan template belongs.
6567
`createdBy`: String representing the user who created the test plan template.

nisystemlink/clients/test_plan/models/_query_test_plans_request.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,26 @@ class TestPlanField(enum.Enum):
1919
DESCRIPTION = "DESCRIPTION"
2020
ASSIGNED_TO = "ASSIGNED_TO"
2121
WORK_ORDER_ID = "WORK_ORDER_ID"
22-
WORK_ORDER_NAME = "WORK_ORDER_NAME"
23-
WORKSPACE = "WORKSPACE"
24-
CREATED_BY = "CREATED_BY"
25-
UPDATED_BY = "UPDATED_BY"
26-
CREATED_AT = "CREATED_AT"
27-
UPDATED_AT = "UPDATED_AT"
28-
PROPERTIES = "PROPERTIES"
2922
PART_NUMBER = "PART_NUMBER"
3023
DUT_ID = "DUT_ID"
24+
DUT_SERIAL_NUMBER = "DUT_SERIAL_NUMBER"
3125
TEST_PROGRAM = "TEST_PROGRAM"
26+
WORKSPACE = "WORKSPACE"
27+
CREATED_BY = "CREATED_BY"
28+
UPDATED_BY = "UPDATED_BY"
3229
SYSTEM_ID = "SYSTEM_ID"
3330
FIXTURE_IDS = "FIXTURE_IDS"
34-
SYSTEM_FILTER = "SYSTEM_FILTER"
3531
PLANNED_START_DATE_TIME = "PLANNED_START_DATE_TIME"
3632
ESTIMATED_END_DATE_TIME = "ESTIMATED_END_DATE_TIME"
3733
ESTIMATED_DURATION_IN_SECONDS = "ESTIMATED_DURATION_IN_SECONDS"
34+
SYSTEM_FILTER = "SYSTEM_FILTER"
35+
DUT_FILTER = "DUT_FILTER"
36+
CREATED_AT = "CREATED_AT"
37+
UPDATED_AT = "UPDATED_AT"
38+
PROPERTIES = "PROPERTIES"
3839
FILE_IDS_FROM_TEMPLATE = "FILE_IDS_FROM_TEMPLATE"
39-
EXECUTION_ACTIONS = "EXECUTION_ACTIONS"
40-
EXECUTION_HISTORY = "EXECUTION_HISTORY"
41-
DASHBOARD_URL = "DASHBOARD_URL"
4240
DASHBOARD = "DASHBOARD"
41+
EXECUTION_ACTIONS = "EXECUTION_ACTIONS"
4342
WORKFLOW = "WORKFLOW"
4443

4544

nisystemlink/clients/test_plan/models/_test_plan.py

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from ._dashboard import DashboardUrl
77
from ._execution_definition import ExecutionDefinition
8-
from ._execution_event import ExecutionEvent
98
from ._state import State
109

1110

@@ -38,8 +37,17 @@ class TestPlan(JsonModel):
3837
work_order_id: Optional[str] = None
3938
"""The identifier of the associated work order."""
4039

41-
work_order_name: Optional[str] = None
42-
"""The name of the associated work order."""
40+
part_number: Optional[str] = None
41+
"""The part number associated with the test plan."""
42+
43+
dut_id: Optional[str] = None
44+
"""The identifier of the device under test (DUT)."""
45+
46+
dut_serial_number: Optional[str] = None
47+
"""The serial number of the device under test (DUT)."""
48+
49+
test_program: Optional[str] = None
50+
"""The test program associated with the test plan."""
4351

4452
workspace: Optional[str] = None
4553
"""The workspace to which the test plan belongs."""
@@ -50,33 +58,12 @@ class TestPlan(JsonModel):
5058
updated_by: Optional[str] = None
5159
"""The user who last updated the test plan."""
5260

53-
created_At: Optional[datetime] = None
54-
"""The date and time when the test plan was created."""
55-
56-
updated_at: Optional[datetime] = None
57-
"""The date and time when the test plan was last updated."""
58-
59-
properties: Optional[Dict[str, str]] = None
60-
"""Additional properties associated with the test plan."""
61-
62-
part_number: Optional[str] = None
63-
"""The part number associated with the test plan."""
64-
65-
dut_id: Optional[str] = None
66-
"""The identifier of the device under test (DUT)."""
67-
68-
test_program: Optional[str] = None
69-
"""The test program associated with the test plan."""
70-
7161
system_id: Optional[str] = None
7262
"""The identifier of the system used for the test plan."""
7363

7464
fixture_ids: Optional[List[str]] = None
7565
"""The list of fixture identifiers associated with the test plan."""
7666

77-
system_filter: Optional[str] = None
78-
"""The filter used to select systems for the test plan."""
79-
8067
planned_start_date_time: Optional[datetime] = None
8168
"""The planned start date and time for the test plan."""
8269

@@ -86,17 +73,26 @@ class TestPlan(JsonModel):
8673
estimated_duration_in_seconds: Optional[float] = None
8774
"""The estimated duration of the test plan in seconds."""
8875

89-
file_ids_from_template: Optional[List[str]] = None
90-
"""The list of file identifiers inherited from the template."""
76+
system_filter: Optional[str] = None
77+
"""The filter used to select systems for the test plan."""
9178

92-
execution_actions: Optional[List[ExecutionDefinition]] = None
93-
"""The execution actions defined for the test plan."""
79+
dut_filter: Optional[str] = None
80+
"""The filter used to select DUTs for the test plan."""
81+
82+
created_At: Optional[datetime] = None
83+
"""The date and time when the test plan was created."""
84+
85+
updated_at: Optional[datetime] = None
86+
"""The date and time when the test plan was last updated."""
9487

95-
execution_history: Optional[List[ExecutionEvent]] = None
96-
"""The execution history of the test plan."""
88+
properties: Optional[Dict[str, str]] = None
89+
"""Additional properties associated with the test plan."""
9790

98-
dashboard_url: Optional[Dict[str, str]] = None
99-
"""The URLs for dashboards related to the test plan."""
91+
file_ids_from_template: Optional[List[str]] = None
92+
"""The list of file identifiers inherited from the template."""
10093

10194
dashboard: Optional[DashboardUrl] = None
10295
"""The dashboard data related to the test plan."""
96+
97+
execution_actions: Optional[List[ExecutionDefinition]] = None
98+
"""The execution actions defined for the test plan."""

nisystemlink/clients/test_plan/models/_test_plan_templates.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ class TestPlanTemplateBase(JsonModel):
3939
systems capable of executing test plans created from this template.
4040
"""
4141

42+
dut_filter: Optional[str] = None
43+
"""The LINQ filter string is used to filter the potential list of
44+
DUTs capable of executing test plans created from this template.
45+
"""
46+
4247
execution_actions: Optional[List[ExecutionDefinition]] = None
4348
"""Defines the executions that will be used for test plan actions
4449
created from this template.

tests/integration/test_plan/test_test_plan_client.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,10 @@ class TestTestPlanClient:
131131
properties={"env": "staging", "priority": "high"},
132132
part_number="px40482",
133133
dut_id="Sample-Dut_Id",
134+
dut_serial_number="Sample-Dut_serial_number",
134135
test_program="TP-Integration-001",
135136
system_filter="os:linux AND arch:x64",
137+
dut_Filter="modelName = 'cRIO-9045' AND serialNumber = '01E82ED0'",
136138
workspace=_workspace,
137139
file_ids_from_template=["file1", "file2"],
138140
dashboard=_dashboard,
@@ -152,6 +154,7 @@ class TestTestPlanClient:
152154
test_program="TP-INT-002",
153155
estimated_duration_in_seconds=86400,
154156
system_filter="os:linux AND arch:x64",
157+
dut_Filter="modelName = 'cRIO-9045' AND serialNumber = '01E82ED0'",
155158
execution_actions=_execution_actions,
156159
file_ids=["file1", "file2"],
157160
workspace=_workspace,
@@ -326,7 +329,6 @@ def test__query_test_plans_with_projections__returns_the_test_plans_with_project
326329
and test_plan.description is None
327330
and test_plan.assigned_to is None
328331
and test_plan.work_order_id is None
329-
and test_plan.work_order_name is None
330332
and test_plan.workspace is None
331333
and test_plan.created_by is None
332334
and test_plan.updated_at is None
@@ -335,17 +337,17 @@ def test__query_test_plans_with_projections__returns_the_test_plans_with_project
335337
and test_plan.properties is None
336338
and test_plan.part_number is None
337339
and test_plan.dut_id is None
340+
and test_plan.dut_serial_number is None
338341
and test_plan.test_program is None
339342
and test_plan.system_filter is None
343+
and test_plan.dut_filter is None
340344
and test_plan.fixture_ids is None
341345
and test_plan.system_id is None
342346
and test_plan.planned_start_date_time is None
343347
and test_plan.estimated_duration_in_seconds is None
344348
and test_plan.estimated_end_date_time is None
345349
and test_plan.file_ids_from_template is None
346350
and test_plan.execution_actions is None
347-
and test_plan.execution_history is None
348-
and test_plan.dashboard_url is None
349351
and test_plan.dashboard is None
350352
)
351353

@@ -459,6 +461,7 @@ def test__query_test_plan_templates_with_projections__returns_test_plan_template
459461
and test_plan_template.test_program is None
460462
and test_plan_template.estimated_duration_in_seconds is None
461463
and test_plan_template.system_filter is None
464+
and test_plan_template.dut_filter is None
462465
and test_plan_template.execution_actions is None
463466
and test_plan_template.file_ids is None
464467
and test_plan_template.workspace is None

0 commit comments

Comments
 (0)