openfga / cli

A cross-platform CLI to interact with an OpenFGA server
https://openfga.dev
Apache License 2.0
50 stars 26 forks source link

Difference in output when tests fails or succeeds when running fga model test with --verbose flag. #360

Open magnusart opened 6 months ago

magnusart commented 6 months ago

Checklist

Description

When I run the command fga model test --test=.. I get the output:

# Test Summary #
Tests 24/24 passing
Checks 62/62 passing

When I run the command fga model test --test=.. --verbose I get the output:

[
 ... JSON output ...
]
# Test Summary #
Tests 24/24 passing
Checks 62/62 passing

However if I make a change to a test so one test fails and run the same command fga model test --test=.. --verbose I get the output:

[
 ... JSON output ...
]

Expectation

  1. The test summary should not be included when using the --verbose flag.
  2. The output should be identical in structure when using the --verbose flag regardless if the test suite fails or succeeds.

This creates problems when running the CLI tool from build scripts and I want to interpret the output.

Reproduction

  1. fga model test --test=.. --verbose
  2. Check output
  3. Make test fail
  4. Compare output

OpenFGA version

0.4.0 (latest from homebrew)

How are you running OpenFGA?

As a binary

What datastore are you using?

In-Memory

OpenFGA Flags

Nope

Logs

No