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:
Matt Robinson 2023-03-17 13:57:09 -04:00 committed by GitHub
parent ff63ad81d9
commit b47bfaf33a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 13 deletions

View File

@ -8,10 +8,7 @@ flake8
mypy
types-Markdown
pytest-cov
# NOTE(robinson) - Currently tests do not pass with 0.0.18. Added the following
# issue to address
# ref: https://github.com/Unstructured-IO/unstructured/issues/200
label_studio_sdk==0.0.17
label_studio_sdk
types-requests
vcrpy
ruff

View File

@ -4,6 +4,11 @@
#
# 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
# via pytest
black==23.1.0
@ -22,7 +27,7 @@ coverage[toml]==7.2.1
# via
# -r requirements/test.in
# pytest-cov
exceptiongroup==1.1.0
exceptiongroup==1.1.1
# via pytest
flake8==6.0.0
# via -r requirements/test.in
@ -32,10 +37,14 @@ idna==3.4
# yarl
iniconfig==2.0.0
# via pytest
label-studio-sdk==0.0.17
label-studio-sdk==0.0.21
# via -r requirements/test.in
lxml==4.9.2
label-studio-tools==0.0.2
# via label-studio-sdk
lxml==4.9.2
# via
# label-studio-sdk
# label-studio-tools
mccabe==0.7.0
# via flake8
multidict==6.0.4
@ -50,7 +59,7 @@ packaging==23.0
# via
# black
# pytest
pathspec==0.11.0
pathspec==0.11.1
# via black
platformdirs==3.1.1
# via black
@ -70,7 +79,7 @@ pyyaml==6.0
# via vcrpy
requests==2.28.2
# via label-studio-sdk
ruff==0.0.254
ruff==0.0.256
# via -r requirements/test.in
six==1.16.0
# via vcrpy
@ -91,7 +100,7 @@ typing-extensions==4.5.0
# black
# mypy
# pydantic
urllib3==1.26.14
urllib3==1.26.15
# via requests
vcrpy==4.2.1
# via -r requirements/test.in

View File

@ -14,7 +14,10 @@ def elements():
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):
"""
Testing Instructions

View File

@ -4,9 +4,9 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd "$SCRIPT_DIR"/.. || exit 1
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
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
fi
fi