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

Cache terminal output #1232

Open
otakustay opened this issue Nov 17, 2024 · 2 comments
Open

Cache terminal output #1232

otakustay opened this issue Nov 17, 2024 · 2 comments

Comments

@otakustay
Copy link

It seems a script cached by wireit does not show previous terminal outputs, so if I cache a unit test (with coverage folder as output, src as input files), I won't see the test results and coverage table again.

Klarwind :: ~/Develop/template-lib-ts ‹master*› » WIREIT_LOGGER=metrics npm run test

> @otakustay/[email protected] test
> wireit

🏃 [test] Running command "vitest run"

 RUN  v2.1.5 /Users/otakustay/Develop/template-lib-ts
      Coverage enabled with v8

 ✓ src/__tests__/index.test.ts (1 test) 2ms

 Test Files  1 passed (1)
      Tests  1 passed (1)
   Start at  16:21:31
   Duration  243ms (transform 14ms, setup 0ms, collect 10ms, tests 2ms, environment 0ms, prepare 33ms)

 % Coverage report from v8
----------|---------|----------|---------|---------|-------------------
File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files |     100 |      100 |     100 |     100 |
 index.ts |     100 |      100 |     100 |     100 |
----------|---------|----------|---------|---------|-------------------
✅ [test] Executed successfully
🏁 [metrics] Executed 1 script(s) in 0.49 seconds
	Ran                 : 1 (100%)
	Skipped (fresh)     : 0 (0%)
	Restored from cache : 0 (0%)
Klarwind :: ~/Develop/template-lib-ts ‹master*› » WIREIT_LOGGER=metrics npm run test

> @otakustay/[email protected] test
> wireit

✅ [test] Already fresh
🏁 [metrics] Executed 1 script(s) in 0.01 seconds
	Ran                 : 0 (0%)
	Skipped (fresh)     : 1 (100%)
	Restored from cache : 0 (0%)
@aomarks
Copy link
Member

aomarks commented Dec 3, 2024

This is by design. We actually used to cache stdout/err and replay it, but most of the time it was too noisy. This could be a good option to have, though.

@otakustay
Copy link
Author

I believe output like unit test coverage, build asset size, are very helpful for developers, would it be possible that we add an option in wireit section like keepOutput to specify whether each command should silent previous output or just pipe it to stdout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants