Skip to content

feat: fix CI failing issues #267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
test_unit:
strategy:
matrix:
python-version: ["3.9","3.10","3.11"]
python-version: [ "3.9","3.10","3.11", "3.12" ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -32,7 +32,7 @@ jobs:
run: make install
- name: Run unit tests
run: |
poetry run make test-unit
make test-unit

lint:
runs-on: ubuntu-latest
Expand All @@ -42,12 +42,12 @@ jobs:
run: make install
- name: Lint
run: |
poetry run make lint
make lint

test_integration:
strategy:
matrix:
python-version: ["3.9","3.10","3.11"]
python-version: [ "3.9","3.10","3.11", "3.12" ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -57,9 +57,9 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: make install
- name: Run all tests
- name: Run integration tests
run: |
poetry run make test
make test-integration-docker
env:
UNSTRUCTURED_API_KEY: ${{ secrets.UNSTRUCTURED_API_KEY }}

Expand All @@ -79,8 +79,7 @@ jobs:
- name: Install dependencies
run: |
make install
source .venv/bin/activate && make install-test-contract
- name: Run unit tests
- name: Run contract tests
run: |
poetry run make test-contract
make test-contract

17 changes: 6 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ install:
install-speakeasy-cli:
curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh

## install-test: install test requirements as they cannot be put into pyproject.toml due to python version requirements mismatch
.PHONY: install-test-contract
install-test-contract:
pip install unstructured pytest-httpx

#################
# Test and Lint #
#################
Expand All @@ -33,30 +28,30 @@ test: test-unit test-integration-docker

.PHONY: test-unit
test-unit:
PYTHONPATH=. pytest _test_unstructured_client -v -k "unit"
PYTHONPATH=. poetry run pytest -n auto _test_unstructured_client -v -k "unit"

.PHONY: test-contract
test-contract:
PYTHONPATH=. pytest _test_contract -v
PYTHONPATH=. poetry run pytest -n auto _test_contract -v

# Assumes you have unstructured-api running on localhost:8000
.PHONY: test-integration
test-integration:
PYTHONPATH=. pytest _test_unstructured_client -v -k "integration"
PYTHONPATH=. poetry run pytest -n auto _test_unstructured_client -v -k "integration"

# Runs the unstructured-api in docker for tests
.PHONY: test-integration-docker
test-integration-docker:
-docker stop unstructured-api && docker kill unstructured-api
docker run --name unstructured-api -p 8000:8000 -d --rm ${DOCKER_IMAGE} --host 0.0.0.0 && \
curl -s -o /dev/null --retry 10 --retry-delay 5 --retry-all-errors http://localhost:8000/general/docs && \
PYTHONPATH=. pytest _test_unstructured_client -v -k "integration" && \
PYTHONPATH=. poetry run pytest -n auto _test_unstructured_client -v -k "integration" && \
docker kill unstructured-api

.PHONY: lint
lint:
pylint --rcfile=pylintrc src
mypy src
poetry run pylint --rcfile=pylintrc src
poetry run mypy src

#############
# Speakeasy #
Expand Down
Loading