-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Looks like the problem is that the different github runners all reached for the same detector at the same time * Make it easier to debug this next time by triggering the full tests manually through github * Automatically reformatting code --------- Co-authored-by: Auto-format Bot <[email protected]>
- Loading branch information
1 parent
61c43ad
commit ac1c114
Showing
3 changed files
with
18 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
from datetime import datetime | ||
|
||
import pytest | ||
from groundlight import ExperimentalApi | ||
from openapi_client.exceptions import NotFoundException | ||
|
||
|
||
def test_create_action(gl: ExperimentalApi): | ||
det = gl.get_or_create_detector("testing_detector", "test_query") | ||
name = f"Test {datetime.utcnow()}" | ||
det = gl.get_or_create_detector(name, "test_query") | ||
rule = gl.create_rule(det, "test_rule", "EMAIL", "[email protected]") | ||
rule2 = gl.get_rule(rule.id) | ||
assert rule == rule2 | ||
|
@@ -15,10 +18,11 @@ def test_create_action(gl: ExperimentalApi): | |
|
||
@pytest.mark.skip(reason="actions are global on account, the test matrix collides with itself") # type: ignore | ||
def test_get_all_actions(gl: ExperimentalApi): | ||
name = f"Test {datetime.utcnow()}" | ||
num_test_rules = 13 # needs to be larger than the default page size | ||
gl.ITEMS_PER_PAGE = 10 | ||
assert gl.ITEMS_PER_PAGE < num_test_rules | ||
det = gl.get_or_create_detector("test_detector", "test_query") | ||
det = gl.get_or_create_detector(name, "test_query") | ||
gl.delete_all_rules() | ||
for i in range(num_test_rules): | ||
_ = gl.create_rule(det, f"test_rule_{i}", "EMAIL", "[email protected]") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
from datetime import datetime | ||
|
||
import PIL | ||
from groundlight import ExperimentalApi | ||
|
||
|
||
def test_get_image(gl: ExperimentalApi): | ||
det = gl.get_or_create_detector("test_detector", "test_query") | ||
name = f"Test {datetime.utcnow()}" | ||
det = gl.get_or_create_detector(name, "test_query") | ||
iq = gl.submit_image_query(det, image="test/assets/dog.jpeg", wait=10) | ||
gl.get_image(iq.id) | ||
assert isinstance(PIL.Image.open(gl.get_image(iq.id)), PIL.Image.Image) |