File tree Expand file tree Collapse file tree 4 files changed +22
-5
lines changed Expand file tree Collapse file tree 4 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -37,11 +37,16 @@ TEST_ARGS=
37
37
CLOUD_FILTERS = -m "not run_only_for_edge_endpoint"
38
38
EDGE_FILTERS = -m "not skip_for_edge_endpoint"
39
39
40
+ # Record information about the slowest 25 tests (but don't show anything slower than 0.1 seconds)
41
+ PROFILING_ARGS = \
42
+ --durations 25 \
43
+ --durations-min 0.1
44
+
40
45
test : install # # Run tests against the prod API (needs GROUNDLIGHT_API_TOKEN)
41
- ${PYTEST} ${TEST_ARGS} ${CLOUD_FILTERS} test
46
+ ${PYTEST} ${PROFILING_ARGS} ${ TEST_ARGS} ${CLOUD_FILTERS} test
42
47
43
48
test-4edge : install # # Run tests against the prod API via the edge-endpoint (needs GROUNDLIGHT_API_TOKEN)
44
- ${PYTEST} ${TEST_ARGS} ${EDGE_FILTERS} test
49
+ ${PYTEST} ${PROFILING_ARGS} ${ TEST_ARGS} ${EDGE_FILTERS} test
45
50
46
51
test-local : install # # Run tests against a localhost API (needs GROUNDLIGHT_API_TOKEN and a local API server)
47
52
GROUNDLIGHT_ENDPOINT=" http://localhost:8000/" ${PYTEST} ${TEST_ARGS} ${CLOUD_FILTERS} test
Original file line number Diff line number Diff line change @@ -13,9 +13,6 @@ def test_create_action(gl_experimental: ExperimentalApi):
13
13
rule = gl_experimental .
create_rule (
det ,
f"test_rule_{ name } " ,
"EMAIL" ,
"[email protected] " )
14
14
rule2 = gl_experimental .get_rule (rule .id )
15
15
assert rule == rule2
16
- gl_experimental .delete_rule (rule .id )
17
- with pytest .raises (NotFoundException ) as _ :
18
- gl_experimental .get_rule (rule .id )
19
16
20
17
21
18
@pytest .mark .skip (reason = "actions are global on account, the test matrix collides with itself" ) # type: ignore
@@ -45,6 +42,13 @@ def test_create_action_with_human_review(gl_experimental: ExperimentalApi):
45
42
)
46
43
rule2 = gl_experimental .get_rule (rule .id )
47
44
assert rule == rule2
45
+
46
+
47
+ @pytest .mark .skip (reason = "actions are global on account, the test matrix collides with itself" ) # type: ignore
48
+ def test_delete_action (gl_experimental : ExperimentalApi ):
49
+ name = f"Test { datetime .utcnow ()} "
50
+ det = gl_experimental .get_or_create_detector (name , "test_query" )
51
+ rule = gl_experimental .
create_rule (
det ,
f"test_rule_{ name } " ,
"EMAIL" ,
"[email protected] " )
48
52
gl_experimental .delete_rule (rule .id )
49
53
with pytest .raises (NotFoundException ) as _ :
50
54
gl_experimental .get_rule (rule .id )
Original file line number Diff line number Diff line change 6
6
from groundlight_openapi_client .exceptions import NotFoundException
7
7
8
8
9
+ @pytest .mark .skip (reason = "This is an expensive test, reset may take some time" )
9
10
def test_reset_retry (gl_experimental : ExperimentalApi ):
10
11
# Reset the detector, retrying in case the reset is still ongoing
11
12
det = gl_experimental .create_detector (f"Test { datetime .utcnow ()} " , "test_query" )
@@ -25,6 +26,7 @@ def test_reset_retry(gl_experimental: ExperimentalApi):
25
26
raise Exception ("Failed to reset detector" )
26
27
27
28
29
+ @pytest .mark .skip (reason = "This test does not work with strong 0 shot models, enabled by default based on your account" )
28
30
def test_reset_training (gl_experimental : ExperimentalApi ):
29
31
# If we reset a detector, we should have low confidence after the reset
30
32
low_confidence_threshold = 0.6
Original file line number Diff line number Diff line change @@ -56,6 +56,12 @@ def test_counting_detector(gl_experimental: ExperimentalApi):
56
56
assert count_iq .result .count is not None
57
57
58
58
59
+ @pytest .mark .skip (
60
+ reason = (
61
+ "General users currently currently can't use multiclass detectors. If you have questions, reach out"
62
+ " to Groundlight support, or upgrade your plan."
63
+ )
64
+ )
59
65
def test_multiclass_detector (gl_experimental : ExperimentalApi ):
60
66
"""
61
67
verify that we can create and submit to a multi-class detector
You can’t perform that action at this time.
0 commit comments