Skip to content

Commit 1f825a2

Browse files
brandon-wadaAuto-format Bot
andauthored
Skips some tests that are currently causing problems for internal users (#266)
Co-authored-by: Auto-format Bot <[email protected]>
1 parent b6923ee commit 1f825a2

File tree

4 files changed

+22
-5
lines changed

4 files changed

+22
-5
lines changed

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,16 @@ TEST_ARGS=
3737
CLOUD_FILTERS = -m "not run_only_for_edge_endpoint"
3838
EDGE_FILTERS = -m "not skip_for_edge_endpoint"
3939

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+
4045
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
4247

4348
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
4550

4651
test-local: install ## Run tests against a localhost API (needs GROUNDLIGHT_API_TOKEN and a local API server)
4752
GROUNDLIGHT_ENDPOINT="http://localhost:8000/" ${PYTEST} ${TEST_ARGS} ${CLOUD_FILTERS} test

test/unit/test_actions.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ def test_create_action(gl_experimental: ExperimentalApi):
1313
rule = gl_experimental.create_rule(det, f"test_rule_{name}", "EMAIL", "[email protected]")
1414
rule2 = gl_experimental.get_rule(rule.id)
1515
assert rule == rule2
16-
gl_experimental.delete_rule(rule.id)
17-
with pytest.raises(NotFoundException) as _:
18-
gl_experimental.get_rule(rule.id)
1916

2017

2118
@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):
4542
)
4643
rule2 = gl_experimental.get_rule(rule.id)
4744
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]")
4852
gl_experimental.delete_rule(rule.id)
4953
with pytest.raises(NotFoundException) as _:
5054
gl_experimental.get_rule(rule.id)

test/unit/test_detector_reset.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from groundlight_openapi_client.exceptions import NotFoundException
77

88

9+
@pytest.mark.skip(reason="This is an expensive test, reset may take some time")
910
def test_reset_retry(gl_experimental: ExperimentalApi):
1011
# Reset the detector, retrying in case the reset is still ongoing
1112
det = gl_experimental.create_detector(f"Test {datetime.utcnow()}", "test_query")
@@ -25,6 +26,7 @@ def test_reset_retry(gl_experimental: ExperimentalApi):
2526
raise Exception("Failed to reset detector")
2627

2728

29+
@pytest.mark.skip(reason="This test does not work with strong 0 shot models, enabled by default based on your account")
2830
def test_reset_training(gl_experimental: ExperimentalApi):
2931
# If we reset a detector, we should have low confidence after the reset
3032
low_confidence_threshold = 0.6

test/unit/test_experimental.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ def test_counting_detector(gl_experimental: ExperimentalApi):
5656
assert count_iq.result.count is not None
5757

5858

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+
)
5965
def test_multiclass_detector(gl_experimental: ExperimentalApi):
6066
"""
6167
verify that we can create and submit to a multi-class detector

0 commit comments

Comments
 (0)