Skip to content

Commit ec6b432

Browse files
committed
test: add integration tests to cover different path variants in model test and store import
1 parent d5566a9 commit ec6b432

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Relative Path Store
2+
model_file: ../basic-model.fga
3+
tuple_file: ../basic-tuples.json
4+
tests:
5+
- name: test-1
6+
check:
7+
- user: user:anne
8+
object: group:foo
9+
assertions:
10+
owner: true

tests/import-tests-cases.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@ tests:
88
stdout:
99
json:
1010
store.name: "Basic Store"
11+
002 - it successfully imports a store with relative paths:
12+
command: fga store import --file=./tests/fixtures/relative-path/relative-path-store.fga.yaml
13+
exit-code: 0
14+
stdout:
15+
json:
16+
store.name: "Relative Path Store"

tests/model-test-cases.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
config:
2+
inherit-env: true
3+
4+
tests:
5+
001 - it successfully runs local tests against a store with an absolute path:
6+
command: fga model test --tests ./tests/fixtures/basic-store.fga.yaml
7+
exit-code: 0
8+
stderr: # Test Summary #
9+
002 - it successfully runs local tests against a store with a relative path:
10+
command: fga model test --tests tests/fixtures/basic-store.fga.yaml
11+
exit-code: 0
12+
stderr: # Test Summary #
13+
003 - it successfully runs local tests against a store when resolving a glob pattern:
14+
command: fga model test --tests "tests/**/*-store.fga.yaml"
15+
exit-code: 0
16+
stderr: # Test Summary #
17+
004 - it successfully runs local tests against a store with relative paths in the store file:
18+
command: fga model test --tests tests/fixtures/relative-path/relative-path-store.fga.yaml
19+
exit-code: 0
20+
stderr: # Test Summary #

0 commit comments

Comments
 (0)