Adopt VCR cassette style for Grafana tests
Refactor the Grafana driver test to use the shared recorder and VCR helpers used by other access-review drivers. This aligns the test with the existing cassette workflow and adds a committed cassette fixture for deterministic replay. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This commit is contained in:
committed by
Bryan Frimin
parent
f5a632ffac
commit
5ca1e369c0
58
pkg/accessreview/drivers/testdata/grafana.yaml
vendored
Normal file
58
pkg/accessreview/drivers/testdata/grafana.yaml
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
---
|
||||
version: 2
|
||||
interactions:
|
||||
- id: 0
|
||||
request:
|
||||
proto: HTTP/1.1
|
||||
proto_major: 1
|
||||
proto_minor: 1
|
||||
content_length: 0
|
||||
host: grafana.example.com
|
||||
form:
|
||||
page:
|
||||
- "1"
|
||||
perpage:
|
||||
- "100"
|
||||
headers:
|
||||
Accept:
|
||||
- application/json
|
||||
url: https://grafana.example.com/api/org/users?page=1&perpage=100
|
||||
method: GET
|
||||
response:
|
||||
proto: HTTP/2.0
|
||||
proto_major: 2
|
||||
proto_minor: 0
|
||||
content_length: -1
|
||||
uncompressed: true
|
||||
body: '[{"userId":1,"email":"admin@example.com","login":"admin@example.com","name":"Admin User","role":"Admin","lastSeenAt":"2026-05-20T10:00:00Z","isDisabled":false},{"userId":2,"email":"","login":"viewer@example.com","name":"Viewer User","role":"Viewer","lastSeenAt":"","isDisabled":true}]'
|
||||
headers:
|
||||
Content-Type:
|
||||
- application/json
|
||||
status: 200 OK
|
||||
code: 200
|
||||
duration: 100ms
|
||||
- id: 1
|
||||
request:
|
||||
proto: HTTP/1.1
|
||||
proto_major: 1
|
||||
proto_minor: 1
|
||||
content_length: 0
|
||||
host: grafana.example.com
|
||||
headers:
|
||||
Accept:
|
||||
- application/json
|
||||
url: https://grafana.example.com/api/org
|
||||
method: GET
|
||||
response:
|
||||
proto: HTTP/2.0
|
||||
proto_major: 2
|
||||
proto_minor: 0
|
||||
content_length: -1
|
||||
uncompressed: true
|
||||
body: '{"id":1,"name":"Acme Grafana"}'
|
||||
headers:
|
||||
Content-Type:
|
||||
- application/json
|
||||
status: 200 OK
|
||||
code: 200
|
||||
duration: 100ms
|
||||
Reference in New Issue
Block a user