Skip to content

Commit 6fcae4d

Browse files
author
Adrian Chang
committed
fix fixtures
1 parent 0f62d65 commit 6fcae4d

10 files changed

+16
-11
lines changed

.github/workflows/python-package-shared.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
DA_GCP_LABELBOX_API_KEY: ${{ secrets[inputs.da-test-key] }}
5353
LABELBOX_TEST_ENVIRON: ${{ inputs.test-env }}
5454
working-directory: libs/labelbox
55-
run: rye run integration
55+
run: rye run integration -n 32
5656
unit-data:
5757
runs-on: ubuntu-latest
5858
concurrency:
@@ -74,5 +74,5 @@ jobs:
7474
working-directory: libs/labelbox
7575
run: |
7676
rye sync -f --features labelbox/data
77-
rye run unit
78-
rye run data
77+
rye run unit -n 32
78+
rye run data -n 32

libs/labelbox/tests/data/annotation_import/test_bulk_import_request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
2626
"""
2727

28-
28+
@pytest.mark.order(1)
2929
def test_create_from_url(project):
3030
name = str(uuid.uuid4())
3131
url = "https://storage.googleapis.com/labelbox-public-bucket/predictions_test_v2.ndjson"

libs/labelbox/tests/data/annotation_import/test_conversation_import.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import uuid
2+
import pytest
23
from labelbox.data.annotation_types.annotation import ObjectAnnotation
34
from labelbox.data.annotation_types.label import Label
45
from labelbox.data.annotation_types.data.text import TextData
56
from labelbox.data.annotation_types.ner import ConversationEntity
67

78
from labelbox.schema.annotation_import import MALPredictionImport
89

9-
10+
@pytest.mark.order(1)
1011
def test_conversation_entity(client, configured_project_with_one_data_row,
1112
dataset_conversation_entity, rand_gen):
1213

libs/labelbox/tests/data/annotation_import/test_data_types.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def create_data_row_for_project(project, dataset, data_row_ndjson, batch_name):
144144
return data_row
145145

146146

147+
@pytest.mark.skip(reason="broken export v1 api, to be retired soon")
147148
def test_import_data_types_by_global_key(
148149
client,
149150
configured_project,
@@ -197,7 +198,7 @@ def validate_iso_format(date_string: str):
197198
assert parsed_t.minute is not None
198199
assert parsed_t.second is not None
199200

200-
201+
@pytest.mark.order(1)
201202
@pytest.mark.parametrize(
202203
"data_type_class",
203204
[

libs/labelbox/tests/data/annotation_import/test_generic_data_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def create_data_row_for_project(project, dataset, data_row_ndjson, batch_name):
7777

7878
return data_row
7979

80-
80+
@pytest.mark.order(1)
8181
def test_import_data_types_by_global_key(
8282
client,
8383
configured_project,

libs/labelbox/tests/data/annotation_import/test_mal_prediction_import.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
1010
"""
1111

12-
12+
@pytest.mark.order(1)
1313
def test_create_with_url_arg(client, configured_project_with_one_data_row,
1414
annotation_import_test_helpers):
1515
name = str(uuid.uuid4())

libs/labelbox/tests/data/annotation_import/test_mea_prediction_import.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
1313
"""
1414

15-
15+
@pytest.mark.order(1)
1616
def test_create_from_objects(model_run_with_data_rows,
1717
object_predictions_for_annotation_import,
1818
annotation_import_test_helpers):

libs/labelbox/tests/data/annotation_import/test_model_run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from labelbox import DataSplit, ModelRun
88

9-
9+
@pytest.mark.order(1)
1010
def test_model_run(client, configured_project_with_label, data_row, rand_gen):
1111
project, _, _, label = configured_project_with_label
1212
label_id = label.uid

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ dev-dependencies = [
2727
"faker>=25.5.0",
2828
"pytest-timestamper>=0.0.10",
2929
"pytest-timeout>=2.3.1",
30+
"pytest-order>=1.2.1",
3031
]
3132

3233
[tool.rye.workspace]
3334
members = ["libs/*", "examples"]
3435

3536
[tool.pytest.ini_options]
3637
# https://github.com/pytest-dev/pytest-rerunfailures/issues/99
37-
addopts = "-rP -vvv --reruns 1 --reruns-delay 5 --durations=20 -n 32 --cov=labelbox --import-mode=importlib"
38+
addopts = "-rP -vvv --reruns 1 --reruns-delay 5 --durations=20 -n auto --cov=labelbox --import-mode=importlib --order-group-scope=module"
3839
markers = """
3940
slow: marks tests as slow (deselect with '-m "not slow"')
4041
"""

requirements-dev.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,14 @@ pyproj==3.5.0
198198
# via labelbox
199199
pytest==8.2.2
200200
# via pytest-cov
201+
# via pytest-order
201202
# via pytest-rerunfailures
202203
# via pytest-snapshot
203204
# via pytest-timeout
204205
# via pytest-xdist
205206
pytest-cases==3.8.5
206207
pytest-cov==5.0.0
208+
pytest-order==1.2.1
207209
pytest-rerunfailures==14.0
208210
pytest-snapshot==0.9.0
209211
pytest-timeout==2.3.1

0 commit comments

Comments
 (0)