You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*`--file`: File containing the store. See [Store File Format](docs/STORE_FILE.md) for detailed documentation.
232
232
*`--store-id`: Specifies the store id to import into
233
233
*`--max-tuples-per-write`: Max tuples to send in a single write (optional, default=1)
234
234
*`--max-parallel-requests`: Max requests to send in parallel (optional, default=4)
@@ -541,7 +541,7 @@ fga model **test**
541
541
542
542
###### Parameters
543
543
544
-
* `--tests`: Name of the tests file. Must be in yaml format (see below)
544
+
* `--tests`: Name of the tests file. Must be in yaml format. See [Store File Format](docs/STORE_FILE.md) for detailed documentation.
545
545
* `--verbose`: Outputs the results in JSON
546
546
547
547
If a model is provided, the test will run in a built-in OpenFGA instance (you do not need a separate server). Otherwise, the test will be run against the configured store of your OpenFGA instance. When running against a remote instance, the tuples will be sent as contextual tuples, and will have to abide by the OpenFGA server limits (20 contextual tuples per request).
@@ -574,35 +574,35 @@ tests: # required
574
574
- name: test-1
575
575
description: testing that the model works # optional
576
576
# tuple_file: ./tuples.json # tuples that would apply per test
577
-
tuples:
578
-
- user: user:anne
579
-
relation: owner
580
-
object: folder:1
581
-
check: # a set of checks to run
582
-
- user: user:anne
583
-
object: folder:1
584
-
assertions:
585
-
# a set of expected results for each relation
586
-
can_view: true
587
-
can_write: true
588
-
can_share: false
589
-
# checks can group multiple users that share the same expected results
590
-
- object: folder:2
591
-
users:
592
-
- user:beth
593
-
- user:carl
594
-
assertions:
595
-
can_view: false
596
-
# checks can group multiple objects that share the same expected results
597
-
- objects:
598
-
- folder:1
599
-
- folder:2
600
-
user: user:beth
601
-
assertions:
602
-
can_write: false
603
-
# either "user" or "users" may be provided, but not both
604
-
# either "object" or "objects" may be provided, but not both
605
-
list_objects: # a set of list objects to run
577
+
tuples:
578
+
- user: user:anne
579
+
relation: owner
580
+
object: folder:1
581
+
check: # a set of checks to run
582
+
- user: user:anne
583
+
object: folder:1
584
+
assertions:
585
+
# a set of expected results for each relation
586
+
can_view: true
587
+
can_write: true
588
+
can_share: false
589
+
# checks can group multiple users that share the same expected results
590
+
- object: folder:2
591
+
users:
592
+
- user:beth
593
+
- user:carl
594
+
assertions:
595
+
can_view: false
596
+
# checks can group multiple objects that share the same expected results
597
+
- objects:
598
+
- folder:1
599
+
- folder:2
600
+
user: user:beth
601
+
assertions:
602
+
can_write: false
603
+
# either "user" or "users" may be provided, but not both
604
+
# either "object" or "objects" may be provided, but not both
605
+
list_objects: # a set of list objects to run
606
606
- user: user:anne
607
607
type: folder
608
608
assertions:
@@ -638,7 +638,7 @@ tests: # required
638
638
###### Example
639
639
`fga model test --tests tests.fga.yaml`
640
640
641
-
For more examples of `.fga.yaml` files, check the [sample-stores repository](https://github.com/openfga/sample-stores/)/
641
+
For more examples of `.fga.yaml` files, check our [Store File Format documentation](docs/STORE_FILE.md) and the [sample-stores repository](https://github.com/openfga/sample-stores/)/
0 commit comments