Skip to content

Commit 32bcbf4

Browse files
committed
Add failing test for schema write validation
1 parent 7332a2d commit 32bcbf4

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

internal/services/steelthreadtesting/definitions.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,4 +550,29 @@ var steelThreadTestCases = []steelThreadTestCase{
550550
},
551551
},
552552
},
553+
{
554+
// This case was found in the wild
555+
name: "remove relation on real schema",
556+
datafile: "real-schema-and-data-with-many-relations.yaml",
557+
operations: []steelThreadOperationCase{
558+
{
559+
operationName: "writeSchema",
560+
arguments: map[string]any{
561+
"schema": `
562+
use expiration
563+
564+
definition user {}
565+
566+
definition platform {}
567+
568+
definition resource {
569+
relation platform: platform
570+
571+
relation viewer: user | user:*
572+
}
573+
`,
574+
},
575+
},
576+
},
577+
},
553578
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
{}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
schema: |+
2+
use expiration
3+
4+
definition resource {
5+
relation platform: platform
6+
7+
relation viewer: user | user:*
8+
}
9+
10+
definition platform {
11+
relation othersubject_thing_doer: othersubject
12+
13+
permission do_thing = othersubject_thing_doer
14+
}
15+
16+
definition othersubject {}
17+
18+
definition user {}
19+
relationships: |
20+
resource:oneresource#platform@platform:foo
21+
resource:anotherresource#viewer@user:*

0 commit comments

Comments
 (0)