Skip to content

Commit b47bfaf

Browse files
authored
fix: update test to pass on later label_studio_sdk versions (#369)
Closes #200. Fixes the failing test for label_studio_sdk>0.0.17 using the suggestion found in this comment. The vcr fixture on the test needed allow_playback_repeats=True. Unpinned label_studio_sdk and pip-compiled.
1 parent ff63ad8 commit b47bfaf

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed

requirements/test.in

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ flake8
88
mypy
99
types-Markdown
1010
pytest-cov
11-
# NOTE(robinson) - Currently tests do not pass with 0.0.18. Added the following
12-
# issue to address
13-
# ref: https://github.com/Unstructured-IO/unstructured/issues/200
14-
label_studio_sdk==0.0.17
11+
label_studio_sdk
1512
types-requests
1613
vcrpy
1714
ruff

requirements/test.txt

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
#
55
# pip-compile requirements/test.in
66
#
7+
--extra-index-url https://pypi.ngc.nvidia.com
8+
--trusted-host pypi.ngc.nvidia.com
9+
10+
appdirs==1.4.4
11+
# via label-studio-tools
712
attrs==22.2.0
813
# via pytest
914
black==23.1.0
@@ -22,7 +27,7 @@ coverage[toml]==7.2.1
2227
# via
2328
# -r requirements/test.in
2429
# pytest-cov
25-
exceptiongroup==1.1.0
30+
exceptiongroup==1.1.1
2631
# via pytest
2732
flake8==6.0.0
2833
# via -r requirements/test.in
@@ -32,10 +37,14 @@ idna==3.4
3237
# yarl
3338
iniconfig==2.0.0
3439
# via pytest
35-
label-studio-sdk==0.0.17
40+
label-studio-sdk==0.0.21
3641
# via -r requirements/test.in
37-
lxml==4.9.2
42+
label-studio-tools==0.0.2
3843
# via label-studio-sdk
44+
lxml==4.9.2
45+
# via
46+
# label-studio-sdk
47+
# label-studio-tools
3948
mccabe==0.7.0
4049
# via flake8
4150
multidict==6.0.4
@@ -50,7 +59,7 @@ packaging==23.0
5059
# via
5160
# black
5261
# pytest
53-
pathspec==0.11.0
62+
pathspec==0.11.1
5463
# via black
5564
platformdirs==3.1.1
5665
# via black
@@ -70,7 +79,7 @@ pyyaml==6.0
7079
# via vcrpy
7180
requests==2.28.2
7281
# via label-studio-sdk
73-
ruff==0.0.254
82+
ruff==0.0.256
7483
# via -r requirements/test.in
7584
six==1.16.0
7685
# via vcrpy
@@ -91,7 +100,7 @@ typing-extensions==4.5.0
91100
# black
92101
# mypy
93102
# pydantic
94-
urllib3==1.26.14
103+
urllib3==1.26.15
95104
# via requests
96105
vcrpy==4.2.1
97106
# via -r requirements/test.in

test_unstructured/staging/test_label_studio.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ def elements():
1414
return [Title(text="Title 1"), NarrativeText(text="Narrative 1")]
1515

1616

17-
@vcr.use_cassette("test_unstructured/vcr_fixtures/cassettes/label_studio_upload.yaml")
17+
@vcr.use_cassette(
18+
"test_unstructured/vcr_fixtures/cassettes/label_studio_upload.yaml",
19+
allow_playback_repeats=True,
20+
)
1821
def test_upload_label_studio_data_with_sdk(caplog, elements):
1922
"""
2023
Testing Instructions

test_unstructured_ingest/test-ingest-github.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
44
cd "$SCRIPT_DIR"/.. || exit 1
55

66
if [[ "$CI" == "true" ]]; then
7-
if [ "$(( RANDOM % 10))" -lt 2 ] ; then
7+
if [ "$(( RANDOM % 10))" -lt 1 ] ; then
88
# NOTE(crag): proper fix is being tracked here: https://github.com/Unstructured-IO/unstructured/issues/306
9-
echo "Skipping ingest 80% of github ingest tests to avoid rate limiting issue."
9+
echo "Skipping ingest 90% of github ingest tests to avoid rate limiting issue."
1010
exit 0
1111
fi
1212
fi

0 commit comments

Comments
 (0)