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

forc test should show decoded logs as default #6312

Closed
JoshuaBatty opened this issue Jul 29, 2024 · 3 comments
Closed

forc test should show decoded logs as default #6312

JoshuaBatty opened this issue Jul 29, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request forc-test Everything related to the `forc-test` lib and `forc test` command.

Comments

@JoshuaBatty
Copy link
Member

Currently users need to type forc test --decode --logs in order to see human readable output from the logs.

We should have this be the default and instead have a flag that will instead show the raw logging.

@JoshuaBatty JoshuaBatty added the forc-test Everything related to the `forc-test` lib and `forc test` command. label Jul 29, 2024
@kayagokalp
Copy link
Member

kayagokalp commented Jul 31, 2024

There is couple of details we should iron before implementing this. Currently if the test do not fail we do not show any logs to the user if they do not specifically ask for it with --logs. Should we keep this behaviour, given that we will by default show human decodable logs? I think we should only be seeing the debug prompts if the test fails or the users asks for it explicitly. Which means keeping --logs as it is. This way we would be removing --decode flag and decode logs by default. Only show raw receipt, if either:

  1. Receipt is a log, but we cannot decode for some reason,
  2. It is not a log receipt
  3. Or user asked for --raw-logs.

This brings me to the second point. I think we are using the term log in a sense that might be confusing. We have receipts coming from VM and some of them are log receipts. --logs should be named --receipts in my opinion in this regard and if present we should show the receipts we got from vm.

This way overall design would be:

  1. forc test and the code has logs in it, and test fails -> show human readable logs.
  2. forc test --receipts, whether test fails or not -> all receipts are shown, logs are decoded.
  3. forc test --receipts --raw-logs, whether test fails or not -> all receipts are shown, logs are note decoded.

Let's try to get a design first, the implementation should be fairly easy. We just need to move couple of ifs around :)

@kayagokalp kayagokalp added the enhancement New feature or request label Jul 31, 2024
@sdankel
Copy link
Member

sdankel commented Sep 9, 2024

Related #6015

@sdankel
Copy link
Member

sdankel commented Sep 30, 2024

I believe this is closed by #6528

Feel free to reopen if there's anything missing.

@sdankel sdankel closed this as completed Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request forc-test Everything related to the `forc-test` lib and `forc test` command.
Projects
None yet
Development

No branches or pull requests

3 participants