Skip to content

Commit

Permalink
[BUG][TST] Fix thin client package test (#2497)
Browse files Browse the repository at this point in the history
## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
	 - Fix thin client package bug introduced by #2466 by @tazarov 
- Do this as opposed to #2490 - as it is cleaner and more explicit.
Making it less brittle to changes.
 - New functionality
	 - ..

## Test plan
*How are these changes tested?*

- [ ] Tests pass locally with `pytest` for python, `yarn test` for js,
`cargo test` for rust

## Documentation Changes
*Are all docstrings for user-facing APIs updated if required? Do we need
to make documentation changes in the [docs
repository](https:/chroma-core/docs)?*
  • Loading branch information
HammadB authored Jul 10, 2024
1 parent 9c91fe4 commit 8b546be
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release-chromadb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
- name: Build Client
run: python -m build
- name: Test Client Package
run: bin/test-package.sh dist/*.tar.gz
run: bin/test-package/test-package.sh dist/*.tar.gz
- name: Upload as artifact
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:
- name: Build Client
run: ./clients/python/build_python_thin_client.sh
- name: Test Client Package
run: bin/test-package.sh dist/*.tar.gz
run: bin/test-package/test-thin-client-package.sh dist/*.tar.gz
- name: Install setuptools_scm
run: python -m pip install setuptools_scm
- name: Publish to Test PyPI
Expand Down
24 changes: 0 additions & 24 deletions bin/test-package.sh

This file was deleted.

24 changes: 24 additions & 0 deletions bin/test-package/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

pip_install_from_tarball() {
local tarball=$(readlink -f $1)
if [ -f "$tarball" ]; then
echo "Testing PIP package from tarball: $tarball"
else
echo "Could not find PIP package: $tarball"
return 1
fi

# Create temporary project dir
local dir=$(mktemp -d)

echo "Building python project dir at $dir ..."

cd $dir

python3 -m venv venv

source venv/bin/activate

pip install $tarball
}
8 changes: 8 additions & 0 deletions bin/test-package/test-package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
# Sanity check to ensure package is installed correctly

source ./install.sh

pip_install_from_tarball $1

python -c "import chromadb; api = chromadb.Client(); print(api.heartbeat())"
8 changes: 8 additions & 0 deletions bin/test-package/test-thin-client-package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
# Sanity check to ensure package is installed correctly

source ./install.sh

pip_install_from_tarball $1

python -c "import chromadb; print(chromadb.__version__)"

0 comments on commit 8b546be

Please sign in to comment.