refactor: SpiceDB test#808
Conversation
azgabur
left a comment
There was a problem hiding this comment.
If the purpose of this PR is just to allow parallel runs of the same test I think only modification of fixtures schema_config and relationship_config was needed or maybe some other places. Currently (on main) the configs uses static names for all fields which I presume would override each other. Not sure how the spiceDB handles writes of the same schemas. Did you try making the names of the schemas unique between runs?
The problem is that the schema in SpiceDB only overwrites itself, and using unique names does not solve this problem. Therefore, you cannot have multiple schemas in a single SpiceDB instance. That is why we want to create a single instance for each test. |
5964f57 to
0c10f12
Compare
0c10f12 to
7b6a524
Compare
|
I've added a commit to handle SpiceDB connection issues related to LoadBalancer provisioning and I would like to hear your thoughts on the solution @azgabur, @averevki:
The retry logic gives the LoadBalancer time to become accessible on rhos-01 clusters, and if it remains unreachable after retries, the test is skipped with a clear explanation rather than producing a false test failure. |
|
Loadbalancer problems on Openstack are indeed infrastructure problem. If SpiceDB is not used in multicluster testing maybe using local service url would suffice? |
7b6a524 to
a4d1447
Compare
@azgabur I've taken your suggestion to use local service URLs instead of relying on LoadBalancer IPs. I've changed the approach to route to SpiceDB through an HTTPRoute via the Gateway. This eliminates the LoadBalancer reliability issues on OpenStack entirely. The reason I had to switch to an HTTP client is that the official Regarding deploying instances at runtime versus using SpiceDB in tools - I actually think having one instance per test is better in this case. SpiceDB doesn't support running multiple schemas in a single instance, which |
a4d1447 to
1a55de4
Compare
azgabur
left a comment
There was a problem hiding this comment.
Not sure why the library was removed in favor of direct http client but it works and I dont mind.
1a55de4 to
11bf201
Compare
Signed-off-by: Silvia Tarabova <starabov@redhat.com> # Conflicts: # pyproject.toml
Signed-off-by: Silvia Tarabova <starabov@redhat.com>
11bf201 to
f347f74
Compare
Description
Changes
Refactoring
testsuite/spicedb/spicedb.py: Complete refactor of SpiceDB integrationSpiceDBServicewithSpiceDB(Backend) andSpiceDBClientclasseshttpxfor SpiceDB HTTP API (/v1/schema/write,/v1/relationships/write,/v1/permissions/check)Configuration
config/settings.yaml: Addedspicedb.imageconfiguration with default imagequay.io/authzed/spicedb:latestconfig/settings.local.yaml.tpl: Updated template to useimageinstead ofurlandpasswordtestsuite/config/__init__.py: Removed validators forspicedb.urlandspicedb.passwordas they are no longer neededVerification steps
Follow-up
After merging, step 2 from #770 needs to be completed: Remove the SpiceDB instance from tools.