From d9a0bd741a6c06de8808e4043536da70b8d0cdeb Mon Sep 17 00:00:00 2001 From: ryannikolaidis <1208590+ryannikolaidis@users.noreply.github.com> Date: Fri, 13 Oct 2023 01:08:27 -0700 Subject: [PATCH] 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 --- .github/workflows/docker-publish.yml | 3 ++- Makefile | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index f46767d86..4f25c51b6 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -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 diff --git a/Makefile b/Makefile index 5b363860d..3e27e193f 100644 --- a/Makefile +++ b/Makefile @@ -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: