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

Extend test suite for WeaviateAsyncClient #334

Merged
merged 11 commits into from
Nov 25, 2024

Conversation

bevzzz
Copy link
Collaborator

@bevzzz bevzzz commented Nov 22, 2024

This PR mirrors some of the "sync" unit test for the AsyncClient.

Schema management:

  • classGetter
  • exists
  • classUpdater
  • references

Sharding:

  • shardsGetter
  • shardUpdater + API support
  • shardsUpdater (plural)

Multitenancy:

  • tenantsCreator
  • tenantsGetter
  • tenantsDeleter + API support
  • tenantExists + API suppport

Backups:

  • getter()

GET /backups/<backend> is not supported by the Weaviate Server at the moment.

The BackupGetter tests are skipped automatically, but will re-activate once "list backups" stops returning "not implemented".

Found some bugs while porting the sync tests. The buggy test cases are @ignored; a commit with fixes will follow.

Schema management:
- classGetter
- exists
- classUpdater

Sharding:
- shardsGetter
- shardsUpdater (FIXME)

Multitennancy:
- tennantsCreator (FIXME)
- tennantsGetter (FIXME)
@bevzzz bevzzz changed the title test add missing schema/ endpoint tests Extend test suite for WeaviateAsyncClient Nov 22, 2024
Copy link

@orca-security-eu orca-security-eu bot left a comment

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

ShardsUpdater must update all shards and result ShardStatus[].
Added shardUpdater (singular!) to async.Schema to mirror the sync implementation.
Return Boolean instead of the Tennant object.
Added TenantExists to complement the existing test case.

Extended base.Result to store the statusCode used in the constructor to create derived Result objects, like .withNewResult does.
@bevzzz
Copy link
Collaborator Author

bevzzz commented Nov 22, 2024

OK, I just figured out that instead of the Result.withNewResult() I can simply pass a custom ResponseParser to a send[Method]Request() method to, e.g., return a boolean instead of array.

I'll update that part in TenantCreator tomorrow.


Updated ✔️

Removed Result.withNewResult as it's no longer used anywhere.
Note, that GET /backups/<backend> is currently not supported on the server;
both tests end up being skipped, but will automatically "re-activate" once
the operation becomes supported.
@bevzzz bevzzz marked this pull request as ready for review November 25, 2024 08:38
@antas-marcin antas-marcin merged commit d4d4194 into weaviate:main Nov 25, 2024
4 checks passed
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.

3 participants