-
Notifications
You must be signed in to change notification settings - Fork 835
/
test_notebooks.py
152 lines (115 loc) · 4.25 KB
/
test_notebooks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
from subprocess import CalledProcessError, run
import pytest
from seldon_e2e_utils import create_and_run_script
@pytest.mark.flaky(max_runs=2)
@pytest.mark.notebooks
class TestNotebooks(object):
#
# Core notebooks
#
def test_helm_examples(self):
create_and_run_script("../../notebooks", "helm_examples")
def test_istio_examples(self):
create_and_run_script("../../notebooks", "istio_example")
def test_max_grpc_msg_size(self):
create_and_run_script("../../notebooks", "max_grpc_msg_size")
def test_multiple_operators(self):
create_and_run_script("../../notebooks", "multiple_operators")
def test_protocol_examples(self):
create_and_run_script("../../notebooks", "protocol_examples")
def test_server_examples(self):
create_and_run_script("../../notebooks", "server_examples")
def test_rolling_updates(self):
create_and_run_script("../../notebooks", "rolling_updates")
#
# Ambassador
#
def test_ambassador_canary(self):
create_and_run_script("../../examples/ambassador/canary", "ambassador_canary")
def test_ambassador_headers(self):
create_and_run_script("../../examples/ambassador/headers", "ambassador_headers")
def test_ambassador_shadow(self):
create_and_run_script("../../examples/ambassador/shadow", "ambassador_shadow")
#
# KEDA Examples
#
def test_keda_prom_auto_scale(self):
try:
create_and_run_script("../../examples/keda", "keda_prom_auto_scale")
except CalledProcessError as e:
run(
"helm delete seldon-core-analytics --namespace seldon-system",
shell=True,
check=False,
)
raise e
#
# Misc
#
# Commenting out as seems to be flaky and blocks forever sometimes
# def test_tracing(self):
# create_and_run_script("../../examples/models/tracing", "tracing")
# Disabling prometheus tests temporarily as they seem to be flaky
# def test_metrics(self):
# try:
# create_and_run_script("../../examples/models/metrics", "metrics")
# except CalledProcessError as e:
# run(
# "helm uninstall -n seldon-system prometheus",
# shell=True,
# check=False,
# )
# raise e
def test_metadata(self):
create_and_run_script("../../examples/models/metadata", "metadata")
def test_graph_metadata(self):
create_and_run_script("../../examples/models/metadata", "graph_metadata")
def test_grpc_metadata(self):
create_and_run_script("../../examples/models/metadata", "metadata_grpc")
def test_autoscaling(self):
try:
create_and_run_script(
"../../examples/models/autoscaling", "autoscaling_example"
)
except CalledProcessError as e:
run("helm delete loadtester --namespace seldon", shell=True, check=False)
raise e
def test_scaling(self):
create_and_run_script("../../notebooks", "scale")
#
# Payloads
#
def test_jsondata(self):
create_and_run_script(
"../../examples/models/sklearn_iris_jsondata", "sklearn_iris_jsondata"
)
#
# SKLearn
#
def test_sklearn_iris(self):
create_and_run_script("../../examples/models/sklearn_iris", "sklearn_iris")
#
# OpenVino
#
# def test_openvino_squeezenet(self):
# create_and_run_script("../../examples/models/openvino", "openvino-squeezenet")
# def test_openvino_imagenet_ensemble(self):
# create_and_run_script(
# "../../examples/models/openvino_imagenet_ensemble",
# "openvino_imagenet_ensemble",
# )
def test_custom_metrics_server(self):
create_and_run_script("../../examples/feedback/metrics-server", "README")
#
# Upgrade
#
def test_upgrade(self):
try:
create_and_run_script("../../notebooks", "operator_upgrade")
except:
run("make install_seldon", shell=True, check=False)
raise
def test_disruption_budgets(self):
create_and_run_script(
"../../examples/models/disruption_budgets", "pdbs_example"
)