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

test to validate the class name-algomo-dev crashloop on 363-char clas… #166

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rthiiyer82
Copy link
Contributor

This PR has test for invalid class name creation. There are 2 tests to validate the length of character in the name of a class. One test when 'AUTO-SCHEMA-ENABLED' is true and the other when the 'AUTO-SCHEMA-ENABLED' is false.

Please note: I will have to revist this test when the fix is in place. For now, I am asserting if the status code of the class creation is 200.

}
client.schema.create_class(class_obj)
response = client.schema.get();
print(response);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this print statement can be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@weaviate-git-bot
Copy link

To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge.

beep boop - the Weaviate bot 👋🤖

PS:
Are you already a member of the Weaviate Slack channel?

client.schema.delete_all()
class_obj = {
"vectorizer": "none",
"vectorIndexConfig": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it is not needed when vectorizer is turned off

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The Default vectorizer is 'none' in docker file. I can remove this line.

assert (response.status_code == 200)
return response;

invalid_long_classname(client)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

script could be extended to validate property name as well.
property names are used to create directory names, so they may turn up being too long.

Comment on lines +41 to +44
echo "Starting Weaviate with auto-schema enabled..."
docker-compose -f apps/create-class-validation/docker-compose.yml up -d

docker run --network host -t create-class-validation python3 invalid_class_long_name.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no wait_weaviate in between?

fi

echo "Starting Weaviate with auto-schema enabled..."
docker-compose -f apps/create-class-validation/docker-compose.yml up -d
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO instead of creating new docker compose to change one env variable, existing docker compose could be reused and updated to support new variable apps/weaviate-no-restart-on-crash/docker-compose.yml.
Default value for variable can be set in apps/weaviate-no-restart-on-crash/.env and overwritten when needed directly in command:

AUTOSCHEMA_ENABLED=false docker-compose -f apps/weaviate-no-restart-on-crash/docker-compose.yml up -d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants