Skip to content
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

[TST] Get ts-integration-test.sh script working locally #2518

Merged
merged 2 commits into from
Jul 18, 2024
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
5 changes: 4 additions & 1 deletion .github/workflows/_javascript-client-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: pnpm/action-setup@v3
with:
version: "9"
- name: Test
run: bin/ts-integration-test
run: bin/ts-integration-test.sh
33 changes: 16 additions & 17 deletions bin/ts-integration-test → bin/ts-integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@ function cleanup {
function setup_auth {
local auth_type="$1"
case "$auth_type" in
basic)
docker run --rm --entrypoint htpasswd httpd:2 -Bbn admin admin > server.htpasswd
cat <<EOF > .chroma_env
basic)
docker run --rm --entrypoint htpasswd httpd:2 -Bbn admin admin >server.htpasswd
cat <<EOF >.chroma_env
CHROMA_SERVER_AUTHN_CREDENTIALS_FILE="/chroma/server.htpasswd"
CHROMA_SERVER_AUTHN_PROVIDER="chromadb.auth.basic_authn.BasicAuthenticationServerProvider"
EOF
;;
token)
cat <<EOF > .chroma_env
;;
token)
cat <<EOF >.chroma_env
CHROMA_AUTH_TOKEN_TRANSPORT_HEADER="Authorization"
CHROMA_SERVER_AUTHN_CREDENTIALS="test-token"
CHROMA_SERVER_AUTHN_PROVIDER="chromadb.auth.token_authn.TokenAuthenticationServerProvider"
EOF
;;
xtoken)
cat <<EOF > .chroma_env
;;
xtoken)
cat <<EOF >.chroma_env
CHROMA_AUTH_TOKEN_TRANSPORT_HEADER="X-Chroma-Token"
CHROMA_SERVER_AUTHN_CREDENTIALS="test-token"
CHROMA_SERVER_AUTHN_PROVIDER="chromadb.auth.token_authn.TokenAuthenticationServerProvider"
EOF
;;
*)
echo "Unknown auth type: $auth_type"
exit 1
;;
*)
echo "Unknown auth type: $auth_type"
exit 1
;;
esac
}

Expand All @@ -49,10 +49,9 @@ export CHROMA_SERVER_HTTP_PORT=8000
export CHROMA_SERVER_NOFILE=65535

cd clients/js
# moved off of yarn to npm to fix issues with jackspeak/cliui/string-width versions #1314
npm install
pnpm install

npm run test:run
pnpm test:run
docker compose down

cd ../..
Expand All @@ -62,7 +61,7 @@ for auth_type in basic token xtoken; do
setup_auth "$auth_type"
cd clients/js
docker compose --env-file ../../.chroma_env -f ../../docker-compose.test-auth.yml up --build -d
npm run test:run-auth-"$auth_type"
pnpm test:run-auth-"$auth_type"
cd ../..
docker compose down
done
2 changes: 2 additions & 0 deletions clients/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"@openapi-generator-plus/typescript-fetch-client-generator": "^1.5.0",
"@types/jest": "^29.5.0",
"@types/node": "^20.8.10",
"@jest/types": "^29.6.3",
"@jest/globals": "^29.7.0",
"jest": "^29.5.0",
"npm-run-all": "^4.1.5",
"openapi-generator-plus": "^2.6.0",
Expand Down
Loading
Loading