Skip to content

Commit d1ea29c

Browse files
authored
Merge pull request #969 from Labelbox/attila/fix-test
fix test by waiting until data rows are processed
2 parents 18fe1c1 + 6174ac4 commit d1ea29c

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

Makefile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11

2-
build:
2+
build-image:
33
docker build -t local/labelbox-python:test .
44

5+
test-local: build-image
56

6-
test-local: build
7-
8-
@# if PATH_TO_TEST we asuume you know what you are doing
7+
@# if PATH_TO_TEST we assume you know what you are doing
98
@if [ -z ${PATH_TO_TEST} ]; then \
109
./scripts/ensure_local_setup.sh; \
1110
fi
@@ -16,29 +15,29 @@ test-local: build
1615
-e LABELBOX_TEST_API_KEY_LOCAL=${LABELBOX_TEST_API_KEY_LOCAL} \
1716
local/labelbox-python:test pytest $(PATH_TO_TEST)
1817

19-
test-staging: build
18+
test-staging: build-image
2019
docker run -it -v ${PWD}:/usr/src -w /usr/src \
2120
-e LABELBOX_TEST_ENVIRON="staging" \
2221
-e DA_GCP_LABELBOX_API_KEY=${DA_GCP_LABELBOX_API_KEY} \
2322
-e LABELBOX_TEST_API_KEY_STAGING=${LABELBOX_TEST_API_KEY_STAGING} \
24-
local/labelbox-python:test pytest -n 10 $(PATH_TO_TEST)
23+
local/labelbox-python:test pytest $(PATH_TO_TEST)
2524

26-
test-prod: build
25+
test-prod: build-image
2726
docker run -it -v ${PWD}:/usr/src -w /usr/src \
2827
-e LABELBOX_TEST_ENVIRON="prod" \
2928
-e DA_GCP_LABELBOX_API_KEY=${DA_GCP_LABELBOX_API_KEY} \
3029
-e LABELBOX_TEST_API_KEY_PROD=${LABELBOX_TEST_API_KEY_PROD} \
3130
local/labelbox-python:test pytest $(PATH_TO_TEST)
3231

33-
test-onprem: build
32+
test-onprem: build-image
3433
docker run -it -v ${PWD}:/usr/src -w /usr/src \
3534
-e LABELBOX_TEST_ENVIRON="onprem" \
3635
-e DA_GCP_LABELBOX_API_KEY=${DA_GCP_LABELBOX_API_KEY} \
3736
-e LABELBOX_TEST_API_KEY_ONPREM=${LABELBOX_TEST_API_KEY_ONPREM} \
3837
-e LABELBOX_TEST_ONPREM_HOSTNAME=${LABELBOX_TEST_ONPREM_HOSTNAME} \
3938
local/labelbox-python:test pytest $(PATH_TO_TEST)
4039

41-
test-custom: build
40+
test-custom: build-image
4241
docker run -it -v ${PWD}:/usr/src -w /usr/src \
4342
-e LABELBOX_TEST_ENVIRON="custom" \
4443
-e DA_GCP_LABELBOX_API_KEY=${DA_GCP_LABELBOX_API_KEY} \

tests/integration/test_project.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ def test_project(client, rand_gen):
4343

4444

4545
def test_project_export_v2(configured_project_with_label):
46-
project, _, _, label = configured_project_with_label
46+
project, _, data_row, label = configured_project_with_label
47+
project._wait_until_data_rows_are_processed(
48+
[data_row.uid], wait_processing_max_seconds=3600, sleep_interval=5)
4749
label_id = label.uid
4850
# Wait for exporter to retrieve latest labels
4951
time.sleep(10)

0 commit comments

Comments
 (0)