fix: build test failures (#1748)

* Fix missing HF_TOKEN when running containerized test for the build
process
* Fix pytest args when running specific test

## Testing
Example run of the HF_TOKEN assgned for the containerized test in the
build process:
https://github.com/Unstructured-IO/unstructured/actions/runs/6504556437/job/17666669155

Example run of the pytest args working for the arm test (ran in a new
workflow for testing on push):
https://github.com/Unstructured-IO/unstructured/actions/runs/6504213010
This commit is contained in:
ryannikolaidis 2023-10-13 01:08:27 -07:00 committed by GitHub
parent 4b84d596c2
commit d9a0bd741a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -59,13 +59,14 @@ jobs:
- name: Test images
run: |
echo "UNS_API_KEY=${{ secrets.UNS_API_KEY }}" > uns_test_env_file
echo "UNSTRUCTURED_HF_TOKEN=${{ secrets.HF_TOKEN }}" > uns_test_env_file
ARCH=$(cut -d "/" -f2 <<< ${{ matrix.docker-platform }})
if [ "$ARCH" = "amd64" ]; then
DOCKER_PLATFORM="${{ matrix.docker-platform }}" DOCKER_IMAGE="$DOCKER_BUILD_REPOSITORY:$ARCH-$SHORT_SHA" \
make docker-test CI=true
else
DOCKER_PLATFORM="${{ matrix.docker-platform }}" DOCKER_IMAGE="$DOCKER_BUILD_REPOSITORY:$ARCH-$SHORT_SHA" \
make docker-test CI=true TEST_NAME=partition/test_text.py
make docker-test CI=true TEST_FILE=test_unstructured/partition/test_text.py
fi
DOCKER_IMAGE=$DOCKER_BUILD_REPOSITORY:$ARCH-$SHORT_SHA make docker-smoke-test
- name: Push images

View File

@ -399,7 +399,7 @@ docker-test:
$(DOCKER_IMAGE) \
bash -c "CI=$(CI) \
UNSTRUCTURED_INCLUDE_DEBUG_METADATA=$(UNSTRUCTURED_INCLUDE_DEBUG_METADATA) \
pytest $(if $(TEST_NAME),-k $(TEST_NAME),) test_unstructured"
pytest $(if $(TEST_FILE),$(TEST_FILE),test_unstructured)"
.PHONY: docker-smoke-test
docker-smoke-test: