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
Integration tests for collections #299
Conversation
) | ||
assert 'Index and collection must have the same dimension' in str(e.value) | ||
|
||
# def test_create_index_from_notready_collection(self, client, ready_index, random_vector, dimension, metric, environment): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this scenario. Need to follow up later. I expected it to fail but it seems to succeed?
source_collection: Optional[str] = None | ||
""" | ||
The name of the collection to use as the source for the pod index. This configuration is only used when creating a pod index from an existing collection. | ||
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This missing property was the cause of create_index
with source_collection
failing.
280416d
to
3f048b8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work continuing to expand our testing setup. Some nits and questions, but this looks good to go. 🚢
run: poetry run pytest tests/integration/control/serverless -s -v | ||
env: | ||
PINECONE_DEBUG_CURL: 'true' | ||
PINECONE_CONTROLLER_HOST: 'https://api.pinecone.io' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: We could probably leave this out for the standard non-staging run, similar to down in control-rest-serverless
. Small complaint, more for consistencies sake.
pass | ||
|
||
if time_waited >= 120: | ||
raise Exception(f"Index {index_name} is not ready to delete after 120 seconds") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Wording here could be: "Index {index_name} was not able to be deleted after 120 seconds"
|
||
@pytest.fixture() | ||
def create_index_params(index_name, environment, dimension, metric): | ||
spec = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, I thought you had to use the PodSpec
class for spec
rather than passing a plain object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The python client is flexible enough to accept both.
time.sleep(10) # Wait a little more, just in case. | ||
client.configure_index(ready_index, replicas=1, pod_type='p1.x1') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need some asserts here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe someday. To start with, I just wanted to see if the request can be made without errors and this was enough to catch the bug we saw ahead of the release last week. Asserting what the server actually does as a result can come later, or possibly be covered in tests owned by platform.
Problem
We received a bug report that creation of indexes using
PodSpec
fails ifsource_collection
is specified.Solution
index --> collection --> index
path and error cases.tests/integration/control/pod
and can be run separately from severless indexes tested intests/integration/control/serverless
. This allows for greater parallelism in CI.Type of Change