Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fga model test --verbose output should be easy to parse #385

Open
jmickeyd opened this issue Sep 5, 2024 · 4 comments · May be fixed by #407
Open

fga model test --verbose output should be easy to parse #385

jmickeyd opened this issue Sep 5, 2024 · 4 comments · May be fixed by #407
Labels
enhancement New feature or request

Comments

@jmickeyd
Copy link

jmickeyd commented Sep 5, 2024

Currently when running tests with the --verbose flag, a nicely parsable json is immediately followed by the plain text summary, making the whole thing harder to parse.

Example:

$ fga model test --verbose --tests tests.fga.yaml | jq .
[ json blob ... ]
jq: parse error: Invalid numeric literal at line 2, column 2

Either one of the blobs should be send to stderr, the pretty print text should be suppressed, or at a minimum, a flag be added to optionally suppress the pretty print.

@jmickeyd
Copy link
Author

jmickeyd commented Sep 5, 2024

I'm willing to send a patch, it should be trivially small, but I'm not sure what you consider a breaking change for things like this. I.e. is the last option (adding a new flag) the preferable one?

@jmickeyd
Copy link
Author

jmickeyd commented Sep 5, 2024

Actually, it looks like due to an effort to set the exit code correctly, the pretty print is already suppressed when there are test failures,

cli/cmd/model/test.go

Lines 77 to 79 in 36091f0

if !passing {
os.Exit(1)
}

@rhamzeh rhamzeh added the enhancement New feature or request label Sep 11, 2024
@Siddhant-K-code Siddhant-K-code linked a pull request Oct 15, 2024 that will close this issue
4 tasks
@Siddhant-K-code
Copy link
Contributor

I've introduced a new flag suppress-summary & raised #407

@Siddhant-K-code
Copy link
Contributor

bump to this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

3 participants