Skip to content

Use Relative Path in model_file in Tests #349

@RichardWhitfield

Description

@RichardWhitfield

When defining the location of the model_file in a test yaml file, the expected behaviour is that the path to the model_file is relative to the test file where it is referenced but seems to be relative to the directory where the command originated.

For example: I have a folder structure as below:

  • src
    • schema.fga
  • tests
    • tests.yaml
    • data.yaml

In my tests.yaml file I define the location of the model_file as ../src/schema.fga.

If I execute this command:
fga model test --tests .\tests\tests.fga.yaml
from the root directory of the repo I get the below error:
Error: failed to read file ../src/schema.fga due to open ../src/schema.fga: The system cannot find the path specified.

If I execute the similar command:
fga model test --tests .\tests.fga.yaml then the command successfully executes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions