Skip to content

Commit

Permalink
Move scripts, add assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
jhamon committed Jan 13, 2024
1 parent 9426b99 commit f1af4f1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/actions/create-index-legacy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ runs:
- name: Create index
id: create-index
shell: bash
run: python3 .github/actions/create-index-legacy/create-index-legacy.py
run: python3 scripts/2.x/create-index-legacy.py
env:
PINECONE_API_KEY: ${{ inputs.PINECONE_API_KEY }}
PINECONE_ENVIRONMENT: ${{ inputs.PINECONE_ENVIRONMENT }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/test-legacy-index/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ runs:
- name: Create index
id: create-index
shell: bash
run: python3 .github/actions/test-legacy-index/test-index.py
run: python3 scripts/3.x/test-index.py
env:
PINECONE_API_KEY: ${{ inputs.PINECONE_API_KEY }}
PINECONE_ENVIRONMENT: ${{ inputs.PINECONE_ENVIRONMENT }}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import random
import string
import os
import time
import math
from pinecone import Pinecone

def read_env_var(name):
Expand Down Expand Up @@ -42,6 +40,23 @@ def main():
assert description.spec.serverless == None
assert description.spec.pod != None
assert description.spec.pod.environment == environment
assert description.host != None
assert len(description.host) > 0
assert description.status != None
assert description.status.state == 'Ready'
assert description.status.ready == True

print(f'Index description looks correct.')

host_url = description.host

idx = pc.Index(name=index_name)

stats = idx.describe_index_stats()
print(f'Index stats: {stats}')




if __name__ == '__main__':
main()

0 comments on commit f1af4f1

Please sign in to comment.