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

Initial baseline diagnostics output with-u not canonified #94

Open
awelzel opened this issue Jun 13, 2023 · 0 comments
Open

Initial baseline diagnostics output with-u not canonified #94

awelzel opened this issue Jun 13, 2023 · 0 comments

Comments

@awelzel
Copy link
Contributor

awelzel commented Jun 13, 2023

I've ran into this a few times now and continue to be confused if it's my canonifier not working right, or btest not showing me what the baseline will actually look like. IMO the UX would be better if the initial diagnostics output showed the canonified baseline.

Workflow:

  • Write a new test with a canonifier
  • run with btest -d -u new.test
  • The first update shown with "diagnostics" presents the non-canonified version:
$ btest -d scripts/base/frameworks/cluster/leftover-log-rotation-multi-logger.zeek -u
[  0%] scripts.base.frameworks.cluster.leftover-log-rotation-multi-logger ... failed
>> Type 'c' to continue, 'd' to see diagnostics, 'u' to update baseline, and 'a' to abort
(pressing d)
== File ===============================
./log-queue/conn__2023-06-13-08-16-52__2023-06-13-08-16-52__log_suffix=logger-2__.log
./log-queue/dns__2023-06-13-08-16-52__2023-06-13-08-16-52__log_suffix=logger-2__.log
leftover conn log
leftover dns log
=======================================
(pressing q)
>> Type 'c' to continue, 'd' to see diagnostics, 'u' to update baseline, and 'a' to abort.
(pressing u for update)
>> Updating baseline ...
all 1 tests successful
  • Checking the just stored baseline shows it was actually canonified even if the diagnostics output doesn't show it.
$ cat Baseline/scripts.base.frameworks.cluster.leftover-log-rotation-multi-logger/out
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
./log-queue/conn__XXXX-XX-XX-XX-XX-XX__XXXX-XX-XX-XX-XX-XX__log_suffix=logger-2__.log
./log-queue/dns__XXXX-XX-XX-XX-XX-XX__XXXX-XX-XX-XX-XX-XX__log_suffix=logger-2__.log
leftover conn log
leftover dns log

Interestingly, updating an existing baseline shows the canonified diff. It's probably a small tweak somewhere.

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

1 participant