Skip to content

Commit 255712b

Browse files
author
Adrian Chang
committed
add timestamps
1 parent 23cdbee commit 255712b

File tree

4 files changed

+11
-66
lines changed

4 files changed

+11
-66
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
integration:
3737
runs-on: ubuntu-latest
3838
concurrency:
39-
group: labelbox-python-${{ inputs.test-env }}-${{ inputs.python-version }}
39+
group: labelbox-python-${{ inputs.test-env }}-${{ inputs.python-version }}-integration
4040
cancel-in-progress: false
4141
steps:
4242
- uses: actions/checkout@v4
@@ -48,14 +48,16 @@ jobs:
4848
python-version: ${{ inputs.python-version }}
4949
- name: Integration Testing
5050
env:
51-
PYTEST_XDIST_AUTO_NUM_WORKERS: 20
5251
LABELBOX_TEST_API_KEY: ${{ secrets[inputs.api-key] }}
5352
DA_GCP_LABELBOX_API_KEY: ${{ secrets[inputs.da-test-key] }}
5453
LABELBOX_TEST_ENVIRON: ${{ inputs.test-env }}
5554
working-directory: libs/labelbox
5655
run: rye run integration
5756
unit-data:
5857
runs-on: ubuntu-latest
58+
concurrency:
59+
group: labelbox-python-${{ inputs.test-env }}-${{ inputs.python-version }}-unit-data
60+
cancel-in-progress: false
5961
steps:
6062
- uses: actions/checkout@v4
6163
with:
@@ -66,7 +68,6 @@ jobs:
6668
python-version: ${{ inputs.python-version }}
6769
- name: Unit && Data Testing
6870
env:
69-
PYTEST_XDIST_AUTO_NUM_WORKERS: 20
7071
LABELBOX_TEST_API_KEY: ${{ secrets[inputs.api-key] }}
7172
DA_GCP_LABELBOX_API_KEY: ${{ secrets[inputs.da-test-key] }}
7273
LABELBOX_TEST_ENVIRON: ${{ inputs.test-env }}

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

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -144,68 +144,6 @@ def create_data_row_for_project(project, dataset, data_row_ndjson, batch_name):
144144
return data_row
145145

146146

147-
# TODO: Add VideoData. Currently label import job finishes without errors but project.export_labels() returns empty list.
148-
@pytest.mark.export_v1("tests used export v1 method, v2 test -> test_import_data_types_v2 below")
149-
@pytest.mark.parametrize(
150-
"data_type_class",
151-
[
152-
AudioData,
153-
ConversationData,
154-
DicomData,
155-
DocumentData,
156-
HTMLData,
157-
ImageData,
158-
TextData,
159-
LlmPromptCreationData,
160-
LlmPromptResponseCreationData,
161-
LlmResponseCreationData,
162-
],
163-
)
164-
def test_import_data_types(
165-
client,
166-
configured_project,
167-
initial_dataset,
168-
rand_gen,
169-
data_row_json_by_data_type,
170-
annotations_by_data_type,
171-
data_type_class,
172-
helpers,
173-
):
174-
project = configured_project
175-
project_id = project.uid
176-
dataset = initial_dataset
177-
178-
helpers.set_project_media_type_from_data_type(project, data_type_class)
179-
180-
data_type_string = data_type_class.__name__[:-4].lower()
181-
data_row_ndjson = data_row_json_by_data_type[data_type_string]
182-
data_row = create_data_row_for_project(project, dataset, data_row_ndjson,
183-
rand_gen(str))
184-
185-
annotations_ndjson = annotations_by_data_type[data_type_string]
186-
annotations_list = [
187-
label.annotations
188-
for label in NDJsonConverter.deserialize(annotations_ndjson)
189-
]
190-
labels = [
191-
lb_types.Label(data=data_type_class(uid=data_row.uid),
192-
annotations=annotations)
193-
for annotations in annotations_list
194-
]
195-
196-
label_import = lb.LabelImport.create_from_objects(
197-
client, project_id, f"test-import-{data_type_string}", labels)
198-
label_import.wait_until_done()
199-
200-
assert label_import.state == AnnotationImportState.FINISHED
201-
assert len(label_import.errors) == 0
202-
exported_labels = project.export_labels(download=True)
203-
objects = exported_labels[0]["Label"]["objects"]
204-
classifications = exported_labels[0]["Label"]["classifications"]
205-
assert len(objects) + len(classifications) == len(labels)
206-
data_row.delete()
207-
208-
209147
def test_import_data_types_by_global_key(
210148
client,
211149
configured_project,

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,16 @@ dev-dependencies = [
2525
"pytest-xdist>=3.5.0",
2626
"toml-cli>=0.6.0",
2727
"faker>=25.5.0",
28+
"pytest-timestamper>=0.0.10",
29+
"pytest-timeout>=2.3.1",
2830
]
2931

3032
[tool.rye.workspace]
3133
members = ["libs/*", "examples"]
3234

3335
[tool.pytest.ini_options]
34-
addopts = "-rP -vvv --reruns 1 --reruns-delay 5 --durations=20 -n auto --maxprocesses=10 --cov=labelbox --import-mode=importlib"
36+
# https://github.com/pytest-dev/pytest-rerunfailures/issues/99
37+
addopts = "-rP -vvv --reruns 1 --reruns-delay 5 --durations=20 -n logical --cov=labelbox --import-mode=importlib"
3538
markers = """
3639
slow: marks tests as slow (deselect with '-m "not slow"')
3740
"""

requirements-dev.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,14 @@ pytest==8.2.2
200200
# via pytest-cov
201201
# via pytest-rerunfailures
202202
# via pytest-snapshot
203+
# via pytest-timeout
203204
# via pytest-xdist
204205
pytest-cases==3.8.5
205206
pytest-cov==5.0.0
206207
pytest-rerunfailures==14.0
207208
pytest-snapshot==0.9.0
209+
pytest-timeout==2.3.1
210+
pytest-timestamper==0.0.10
208211
pytest-xdist==3.6.1
209212
python-dateutil==2.8.2
210213
# via faker

0 commit comments

Comments
 (0)