mirror of
https://github.com/Unstructured-IO/unstructured.git
synced 2025-12-16 17:55:48 +00:00
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.
This commit is contained in:
parent
ff63ad81d9
commit
b47bfaf33a
@ -8,10 +8,7 @@ flake8
|
|||||||
mypy
|
mypy
|
||||||
types-Markdown
|
types-Markdown
|
||||||
pytest-cov
|
pytest-cov
|
||||||
# NOTE(robinson) - Currently tests do not pass with 0.0.18. Added the following
|
label_studio_sdk
|
||||||
# issue to address
|
|
||||||
# ref: https://github.com/Unstructured-IO/unstructured/issues/200
|
|
||||||
label_studio_sdk==0.0.17
|
|
||||||
types-requests
|
types-requests
|
||||||
vcrpy
|
vcrpy
|
||||||
ruff
|
ruff
|
||||||
|
|||||||
@ -4,6 +4,11 @@
|
|||||||
#
|
#
|
||||||
# pip-compile requirements/test.in
|
# pip-compile requirements/test.in
|
||||||
#
|
#
|
||||||
|
--extra-index-url https://pypi.ngc.nvidia.com
|
||||||
|
--trusted-host pypi.ngc.nvidia.com
|
||||||
|
|
||||||
|
appdirs==1.4.4
|
||||||
|
# via label-studio-tools
|
||||||
attrs==22.2.0
|
attrs==22.2.0
|
||||||
# via pytest
|
# via pytest
|
||||||
black==23.1.0
|
black==23.1.0
|
||||||
@ -22,7 +27,7 @@ coverage[toml]==7.2.1
|
|||||||
# via
|
# via
|
||||||
# -r requirements/test.in
|
# -r requirements/test.in
|
||||||
# pytest-cov
|
# pytest-cov
|
||||||
exceptiongroup==1.1.0
|
exceptiongroup==1.1.1
|
||||||
# via pytest
|
# via pytest
|
||||||
flake8==6.0.0
|
flake8==6.0.0
|
||||||
# via -r requirements/test.in
|
# via -r requirements/test.in
|
||||||
@ -32,10 +37,14 @@ idna==3.4
|
|||||||
# yarl
|
# yarl
|
||||||
iniconfig==2.0.0
|
iniconfig==2.0.0
|
||||||
# via pytest
|
# via pytest
|
||||||
label-studio-sdk==0.0.17
|
label-studio-sdk==0.0.21
|
||||||
# via -r requirements/test.in
|
# via -r requirements/test.in
|
||||||
lxml==4.9.2
|
label-studio-tools==0.0.2
|
||||||
# via label-studio-sdk
|
# via label-studio-sdk
|
||||||
|
lxml==4.9.2
|
||||||
|
# via
|
||||||
|
# label-studio-sdk
|
||||||
|
# label-studio-tools
|
||||||
mccabe==0.7.0
|
mccabe==0.7.0
|
||||||
# via flake8
|
# via flake8
|
||||||
multidict==6.0.4
|
multidict==6.0.4
|
||||||
@ -50,7 +59,7 @@ packaging==23.0
|
|||||||
# via
|
# via
|
||||||
# black
|
# black
|
||||||
# pytest
|
# pytest
|
||||||
pathspec==0.11.0
|
pathspec==0.11.1
|
||||||
# via black
|
# via black
|
||||||
platformdirs==3.1.1
|
platformdirs==3.1.1
|
||||||
# via black
|
# via black
|
||||||
@ -70,7 +79,7 @@ pyyaml==6.0
|
|||||||
# via vcrpy
|
# via vcrpy
|
||||||
requests==2.28.2
|
requests==2.28.2
|
||||||
# via label-studio-sdk
|
# via label-studio-sdk
|
||||||
ruff==0.0.254
|
ruff==0.0.256
|
||||||
# via -r requirements/test.in
|
# via -r requirements/test.in
|
||||||
six==1.16.0
|
six==1.16.0
|
||||||
# via vcrpy
|
# via vcrpy
|
||||||
@ -91,7 +100,7 @@ typing-extensions==4.5.0
|
|||||||
# black
|
# black
|
||||||
# mypy
|
# mypy
|
||||||
# pydantic
|
# pydantic
|
||||||
urllib3==1.26.14
|
urllib3==1.26.15
|
||||||
# via requests
|
# via requests
|
||||||
vcrpy==4.2.1
|
vcrpy==4.2.1
|
||||||
# via -r requirements/test.in
|
# via -r requirements/test.in
|
||||||
|
|||||||
@ -14,7 +14,10 @@ def elements():
|
|||||||
return [Title(text="Title 1"), NarrativeText(text="Narrative 1")]
|
return [Title(text="Title 1"), NarrativeText(text="Narrative 1")]
|
||||||
|
|
||||||
|
|
||||||
@vcr.use_cassette("test_unstructured/vcr_fixtures/cassettes/label_studio_upload.yaml")
|
@vcr.use_cassette(
|
||||||
|
"test_unstructured/vcr_fixtures/cassettes/label_studio_upload.yaml",
|
||||||
|
allow_playback_repeats=True,
|
||||||
|
)
|
||||||
def test_upload_label_studio_data_with_sdk(caplog, elements):
|
def test_upload_label_studio_data_with_sdk(caplog, elements):
|
||||||
"""
|
"""
|
||||||
Testing Instructions
|
Testing Instructions
|
||||||
|
|||||||
@ -4,9 +4,9 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|||||||
cd "$SCRIPT_DIR"/.. || exit 1
|
cd "$SCRIPT_DIR"/.. || exit 1
|
||||||
|
|
||||||
if [[ "$CI" == "true" ]]; then
|
if [[ "$CI" == "true" ]]; then
|
||||||
if [ "$(( RANDOM % 10))" -lt 2 ] ; then
|
if [ "$(( RANDOM % 10))" -lt 1 ] ; then
|
||||||
# NOTE(crag): proper fix is being tracked here: https://github.com/Unstructured-IO/unstructured/issues/306
|
# NOTE(crag): proper fix is being tracked here: https://github.com/Unstructured-IO/unstructured/issues/306
|
||||||
echo "Skipping ingest 80% of github ingest tests to avoid rate limiting issue."
|
echo "Skipping ingest 90% of github ingest tests to avoid rate limiting issue."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user