@@ -2,16 +2,130 @@ tests:
2
2
- name : " Model create tests"
3
3
description : " Part of model CRD tests."
4
4
scenarios :
5
- - name : " Create=InvalidInput"
6
- description : " Given one of the parameters is invalid, ko.Status shows a terminal condition"
7
- given :
8
- desired_state : " model/v1alpha1/m_invalid_before_create.yaml"
9
- svc_api :
10
- - operation : CreateModelWithContext
11
- error :
12
- code : InvalidParameterValue
13
- message : " The model name must not include a special character."
14
- invoke : Create
15
- expect :
16
- latest_state : " model/v1alpha1/m_invalid_create_attempted.yaml"
17
- error : resource is in terminal condition
5
+ - name : " Create=InvalidInput"
6
+ description : " Given one of the parameters is invalid, ko.Status shows a terminal condition"
7
+ given :
8
+ desired_state : " v1alpha1/create/desired/invalid_before_create.yaml"
9
+ svc_api :
10
+ - operation : CreateModelWithContext
11
+ error :
12
+ code : InvalidParameterValue
13
+ message : " The model name must not include a special character."
14
+ invoke : Create
15
+ expect :
16
+ latest_state : " v1alpha1/create/observed/invalid_create_attempted.yaml"
17
+ error : resource is in terminal condition
18
+ - name : " Create=Valid"
19
+ description : " Create a new model successfully (ARN in status)."
20
+ given :
21
+ desired_state : " v1alpha1/create/desired/success_before_create.yaml"
22
+ svc_api :
23
+ - operation : CreateModelWithContext
24
+ output_fixture : " sdkapi/create/success_create.json"
25
+ invoke : Create
26
+ expect :
27
+ latest_state : " v1alpha1/create/observed/success_after_create.yaml"
28
+ error : nil
29
+ - name : " Create=ValidVariation2"
30
+ description : " Create a new model successfully. This test is similar to Create=Valid with different set of inputs"
31
+ given :
32
+ desired_state : " v1alpha1/create/desired/before_create_primary_container.yaml"
33
+ svc_api :
34
+ - operation : CreateModelWithContext
35
+ output_fixture : " sdkapi/create/success_create.json"
36
+ invoke : Create
37
+ expect :
38
+ latest_state : " v1alpha1/create/observed/success_created_primary_container.yaml"
39
+ error : nil
40
+ - name : " Model readOne tests"
41
+ description : " Testing the readOne operation"
42
+ scenarios :
43
+ - name : " ReadOne=MissingRequiredField"
44
+ description : " Testing readOne when required field is missing. No API call is made and returns error."
45
+ given :
46
+ desired_state : " v1alpha1/readone/desired/missing_required_field.yaml"
47
+ invoke : ReadOne
48
+ expect :
49
+ error : " resource not found"
50
+ - name : " ReadOne=NotFound"
51
+ description : " Testing readOne when Describe fails to find the resource on SageMaker"
52
+ given :
53
+ desired_state : " v1alpha1/readone/desired/after_create.yaml"
54
+ svc_api :
55
+ - operation : DescribeModelWithContext
56
+ error :
57
+ code : ValidationException
58
+ message : " Could not find model xgboost-model"
59
+ invoke : ReadOne
60
+ expect :
61
+ error : " resource not found"
62
+ - name : " ReadOne=Fail"
63
+ description : " This test checks if the condition is updated if describe fails and readOne returns error"
64
+ given :
65
+ desired_state : " v1alpha1/readone/desired/after_create.yaml"
66
+ svc_api :
67
+ - operation : DescribeModelWithContext
68
+ error :
69
+ code : ServiceUnavailable
70
+ message : " Server is down"
71
+ invoke : ReadOne
72
+ expect :
73
+ latest_state : " v1alpha1/readone/observed/error_on_describe.yaml"
74
+ error : " ServiceUnavailable: Server is down\n\t status code: 0, request id: "
75
+ - name : " ReadOne=AfterCreate"
76
+ description : " Testing readOne right after create, the status should have ARN."
77
+ given :
78
+ desired_state : " v1alpha1/readone/desired/after_create.yaml"
79
+ svc_api :
80
+ - operation : DescribeModelWithContext
81
+ output_fixture : " sdkapi/describe/success_describe.json"
82
+ invoke : ReadOne
83
+ expect :
84
+ latest_state : " v1alpha1/readone/observed/created.yaml"
85
+ - name : " ReadOne=AfterCreateVariation2"
86
+ description : " Testing readOne right after create, the status should have ARN."
87
+ given :
88
+ desired_state : " v1alpha1/create/observed/success_created_primary_container.yaml"
89
+ svc_api :
90
+ - operation : DescribeModelWithContext
91
+ output_fixture : " sdkapi/describe/success_primary_container.json"
92
+ invoke : ReadOne
93
+ expect :
94
+ latest_state : " v1alpha1/readone/observed/created_primary_container.yaml"
95
+ - name : " Model update tests"
96
+ description : " Testing the Update operation"
97
+ scenarios :
98
+ - name : " Update=NotSupported"
99
+ description : " This test checks if the contrller throws error for update"
100
+ given :
101
+ desired_state : " v1alpha1/update/desired/updated_base.yaml"
102
+ latest_state : " v1alpha1/update/desired/latest_post_create.yaml"
103
+ invoke : Update
104
+ expect :
105
+ latest_state : " v1alpha1/update/observed/error_on_update.yaml"
106
+ error : " not implemented"
107
+ - name : " Model delete tests"
108
+ description : " Testing the delete operation"
109
+ scenarios :
110
+ - name : " Delete=Fail"
111
+ description : " This test checks if the condition is updated if delete fails and returns error"
112
+ given :
113
+ desired_state : " v1alpha1/readone/desired/after_create.yaml"
114
+ svc_api :
115
+ - operation : DeleteModelWithContext
116
+ error :
117
+ code : ServiceUnavailable
118
+ message : " Server is down"
119
+ invoke : Delete
120
+ expect :
121
+ latest_state : " v1alpha1/delete/observed/error_on_delete.yaml"
122
+ error : " ServiceUnavailable: Server is down\n\t status code: 0, request id: "
123
+ - name : " Delete=Successful"
124
+ description : " This test checks if the Model is deleted successfully"
125
+ given :
126
+ desired_state : " v1alpha1/readone/desired/after_create.yaml"
127
+ svc_api :
128
+ - operation : DeleteModelWithContext
129
+ invoke : Delete
130
+ expect :
131
+ error : nil
0 commit comments