test(adr0034): Add per-domain assignment driver tests - #1222
Merged
Conversation
Unit suites under crates/core/src/assignment/service/tests/: target-keyed dispatch, the per-domain resolution cache, the system carve-out, stale binding fallback, the shared-backend fast path, the cross-domain grant invariant, and the untargeted fan-out with de-dup / pagination / fail-fast. Reload suite: block reuse by pointer, drop of an unmapped block, dispatch switch-off, cache clear, and last-known-good on an unresolvable config. Integration suite tests/integration/src/assignment_per_domain.rs, over the real Provider stack: dispatch-on still serves the global SQL path, a named [assignment.backends.*] block is built by the reload reactor through inventory, an unmapped binding falls back to global, the config API rejects an unbindable driver, an untargeted listing unions and de-duplicates two live SQL backends, and per-domain resolution is cached. A stub OpenFGA HTTP server (mod openfga_stub, a stateful axum tuple store) then drives the OpenFGA driver crate end to end: a domain bound to a named OpenFGA block routes create_grant to it over real HTTP, the target-scoped listing reads the tuple back through the driver, and the grant stays disjoint from the global SQL backend; an untargeted fan-out with an OpenFGA instance present fails the whole call. tests/integration/Cargo.toml gains the axum json and tokio net features and turns on openstack-keystone's openfga feature, which links the OpenFGA assignment driver and its NamedAssignmentBackendRegistration into the integration binary. Live test_api suite tests/api/tests/api_v3/domain_config.rs, over the real server and OPA: a cloud admin binds assignment/driver and reads it back; a non-system caller is refused it on the whole-config, group and option write shapes (ADR 0034 section 6). driver_for_target held the binding_cache read guard as a match scrutinee temporary while the None arm awaited a write on the same lock, a self-deadlock on every resolver-routed grant or listing. Edition 2024 rescopes if-let scrutinee temporaries but not match ones; read into an owned value first. Split the in-file unit module into service/tests.rs and add a from_parts test constructor that wires mock backends straight into the routing bundle. Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
|
🧪 Tempest Identity Compatibility Results (advisory, non-blocking) rust Failed test IDs |
|
🦢 Load Test Results Goose Attack ReportPlan Overview
Request Metrics
Response Time Metrics
Status Code Metrics
Transaction Metrics
Scenario Metrics
Error Metrics
|
|
| Project | keystone |
| Branch | claude/per-domain-assignments-provider-k0tp5e |
| Testbed | ubuntu-latest |
Click to view all benchmark results
| Benchmark | Latency | Benchmark Result nanoseconds (ns) (Result Δ%) | Upper Boundary nanoseconds (ns) (Limit %) |
|---|---|---|---|
| Command_Serde/apply/remove | 📈 view plot 🚷 view threshold | 129,500.00 ns(-49.78%)Baseline: 257,849.81 ns | 1,308,205.78 ns (9.90%) |
| Command_Serde/apply/set | 📈 view plot 🚷 view threshold | 145,170.00 ns(-65.12%)Baseline: 416,221.62 ns | 3,206,133.85 ns (4.53%) |
| Command_Serde/pack/delete | 📈 view plot 🚷 view threshold | 120.62 ns(+2.47%)Baseline: 117.71 ns | 152.62 ns (79.03%) |
| Command_Serde/pack/delete_index | 📈 view plot 🚷 view threshold | 108.16 ns(+3.06%)Baseline: 104.95 ns | 135.21 ns (79.99%) |
| Command_Serde/pack/set | 📈 view plot 🚷 view threshold | 198.46 ns(+4.10%)Baseline: 190.64 ns | 241.12 ns (82.31%) |
| Command_Serde/pack/set_index | 📈 view plot 🚷 view threshold | 108.65 ns(+3.56%)Baseline: 104.91 ns | 135.77 ns (80.03%) |
| Command_Serde/unpack/delete | 📈 view plot 🚷 view threshold | 195.38 ns(+4.53%)Baseline: 186.91 ns | 268.30 ns (72.82%) |
| Command_Serde/unpack/delete_index | 📈 view plot 🚷 view threshold | 156.80 ns(+0.86%)Baseline: 155.46 ns | 217.04 ns (72.24%) |
| Command_Serde/unpack/set | 📈 view plot 🚷 view threshold | 296.97 ns(+12.44%)Baseline: 264.12 ns | 360.38 ns (82.40%) |
| Command_Serde/unpack/set_index | 📈 view plot 🚷 view threshold | 155.30 ns(+1.44%)Baseline: 153.09 ns | 211.63 ns (73.38%) |
| Payload_encryption/pack/remove_cmd | 📈 view plot 🚷 view threshold | 115.43 ns(+2.90%)Baseline: 112.17 ns | 148.65 ns (77.65%) |
| Payload_encryption/pack/set_cmd | 📈 view plot 🚷 view threshold | 205.30 ns(+2.99%)Baseline: 199.34 ns | 262.06 ns (78.34%) |
| Payload_encryption/unpack/remove_cmd | 📈 view plot 🚷 view threshold | 204.66 ns(+4.61%)Baseline: 195.64 ns | 282.55 ns (72.43%) |
| Payload_encryption/unpack/set_cmd | 📈 view plot 🚷 view threshold | 301.84 ns(+10.47%)Baseline: 273.22 ns | 375.99 ns (80.28%) |
| Raft_1Node_Latency/prefix/1node | 📈 view plot 🚷 view threshold | 2,552,300.00 ns(-16.98%)Baseline: 3,074,491.23 ns | 7,924,629.46 ns (32.21%) |
| Raft_1Node_Latency/read/1node | 📈 view plot 🚷 view threshold | 42,883.00 ns(+14.56%)Baseline: 37,432.14 ns | 51,665.48 ns (83.00%) |
| Raft_1Node_Latency/remove/1node | 📈 view plot 🚷 view threshold | 383,460.00 ns(-67.38%)Baseline: 1,175,686.72 ns | 11,499,900.76 ns (3.33%) |
| Raft_1Node_Latency/write/1node | 📈 view plot 🚷 view threshold | 397,090.00 ns(-59.36%)Baseline: 977,114.22 ns | 7,555,767.72 ns (5.26%) |
| build_snapshot/default | 📈 view plot 🚷 view threshold | 117,430.00 ns(-4.52%)Baseline: 122,988.55 ns | 268,765.34 ns (43.69%) |
| fernet token/project | 📈 view plot 🚷 view threshold | 1,474.20 ns(+3.56%)Baseline: 1,423.53 ns | 1,795.59 ns (82.10%) |
| get_data_keyspace | 📈 view plot 🚷 view threshold | 0.31 ns(-0.16%)Baseline: 0.31 ns | 0.39 ns (81.55%) |
| get_db | 📈 view plot 🚷 view threshold | 0.32 ns(+1.26%)Baseline: 0.32 ns | 0.39 ns (82.82%) |
| get_fernet_token_timestamp/project | 📈 view plot 🚷 view threshold | 148.88 ns(+6.15%)Baseline: 140.25 ns | 180.02 ns (82.70%) |
| get_keyspace | 📈 view plot 🚷 view threshold | 4.43 ns(-24.47%)Baseline: 5.87 ns | 13.51 ns (32.81%) |
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unit suites under crates/core/src/assignment/service/tests/:
target-keyed dispatch, the per-domain resolution cache, the system
carve-out, stale binding fallback, the shared-backend fast path, the
cross-domain grant invariant, and the untargeted fan-out with de-dup /
pagination / fail-fast. Reload suite: block reuse by pointer, drop of an
unmapped block, dispatch switch-off, cache clear, and last-known-good on
an unresolvable config.
Integration suite tests/integration/src/assignment_per_domain.rs, over
the real Provider stack: dispatch-on still serves the global SQL path, a
named [assignment.backends.*] block is built by the reload reactor
through inventory, an unmapped binding falls back to global, the config
API rejects an unbindable driver, an untargeted listing unions and
de-duplicates two live SQL backends, and per-domain resolution is
cached. A stub OpenFGA HTTP server (mod openfga_stub, a stateful axum
tuple store) then drives the OpenFGA driver crate end to end: a domain
bound to a named OpenFGA block routes create_grant to it over real HTTP,
the target-scoped listing reads the tuple back through the driver, and
the grant stays disjoint from the global SQL backend; an untargeted
fan-out with an OpenFGA instance present fails the whole call.
tests/integration/Cargo.toml gains the axum json and tokio net features
and turns on openstack-keystone's openfga feature, which links the
OpenFGA assignment driver and its NamedAssignmentBackendRegistration
into the integration binary.
Live test_api suite tests/api/tests/api_v3/domain_config.rs, over the
real server and OPA: a cloud admin binds assignment/driver and reads it
back; a non-system caller is refused it on the whole-config, group and
option write shapes (ADR 0034 section 6).
driver_for_target held the binding_cache read guard as a match scrutinee
temporary while the None arm awaited a write on the same lock, a
self-deadlock on every resolver-routed grant or listing. Edition 2024
rescopes if-let scrutinee temporaries but not match ones; read into an
owned value first.
Split the in-file unit module into service/tests.rs and add a from_parts
test constructor that wires mock backends straight into the routing
bundle.
Signed-off-by: Artem Goncharov artem.goncharov@gmail.com