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

Support for multiple btest baselines #32

Closed
vpax opened this issue Oct 23, 2020 · 5 comments
Closed

Support for multiple btest baselines #32

vpax opened this issue Oct 23, 2020 · 5 comments
Assignees

Comments

@vpax
Copy link

vpax commented Oct 23, 2020

I'd like to be able to use btest's --alternative option as a way to conduct testing of Zeek options that alter Zeek's behavior on only a small number of tests, and for which I'd like to make sure that on the bulk of the tests the options don't result in any changes. While there's already a notion in btest of alternative baselines (via BTEST_TEST_BASE), that changes the entire baseline. What I want instead is essentially a series of baseline directories that are searched first-to-last. With that, then I can put updates for the given Zeek option in Baseline.my_alternative/ and confine what goes in there to just the differences, still picking up the bulk of the baseline from the default Baseline/. I'd also want btest -u to update into the alternative Baseline rather than the original.

@ckreibich
Copy link
Member

Vern, this is primarily a btest feature request, so we could move it over to github.com/zeek/btest — yes? (Happy to do that, just wanted to confirm.)
The following might be a workaround in the interim: you can make the (few) tests whose behavior differs when the option is set conditional on that setting. For example, if your option is going to be ZEEK_SPECIAL_FLAG=vern, set that in an alternative, and say @TEST-REQUIRES: test "${ZEEK_SPECIAL_FLAG}" == "vern" and the test will simply be skipped when that requirement isn't fulfilled. The other tests will still run with the option, but for those the expectation is that their behavior remains unchanged.

@vpax
Copy link
Author

vpax commented Oct 26, 2020

@ckreibich happy to move this ot github.com/zeek/btest, thanks for pointing that out. (Still getting acquainted with all of the angles of our ecosystem! :-) I'll try out what you sketch flag-wise to see if it does suffices in the interim.

@ckreibich
Copy link
Member

Still getting acquainted with all of the angles of our ecosystem!

😄 — it's bigger on the inside, isn't it!

@rsmmr rsmmr transferred this issue from zeek/zeek Nov 3, 2020
@rsmmr rsmmr self-assigned this Nov 4, 2020
@rsmmr
Copy link
Member

rsmmr commented Nov 4, 2020

I'll give this a try.

rsmmr added a commit that referenced this issue Dec 1, 2020
* origin/topic/robin/gh-32-baselines:
  Address review feedback.
  Update README.
  Adding tests for new functionality.
  Allow to set baseline directories through an alternative section.
  Teach btest-diff to work with multiple baseline directories.
  Support multiple baseline directories internally.
@rsmmr
Copy link
Member

rsmmr commented Dec 2, 2020

This has landed.

@rsmmr rsmmr closed this as completed Dec 2, 2020
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

3 participants