-
Notifications
You must be signed in to change notification settings - Fork 20
Look in parent directories for btest.cfg
#115
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
Conversation
97092cc to
3c754ac
Compare
3c754ac to
61bffc2
Compare
61bffc2 to
a83c459
Compare
|
I updated it to make sure dots work from relative directories, but that specifies the test exactly. So the dot syntax should stay the same, where you can't specify a "relative" test with dots. I think the edge cases are mostly covered too, dots seem to work the same and I think temp directories don't change since they |
a83c459 to
1eb4b45
Compare
d0dbd14 to
bf71a3e
Compare
awelzel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
d332fe2 to
ba6f941
Compare
1680970 to
ff7cd9f
Compare
rsmmr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are cases where we don't abort if not finding a btest.cfg:
# pwd
/Users/robin/work/zeek/master/auxil/btest/testing
# ../btest /etc
/etc/manpaths: mandatory keyword '@TEST-EXEC' or '@TEST-EXEC-FAIL' is missing..
One question: Once we have found btest.cfg, is the current working directory then consistently set to where it's located, independent from where btest was called? Is should, and from a quick test, I couldn't find a counter example; but from the code, I wasn't really sure.
ff7cd9f to
c8ba86c
Compare
I believe so, it changes to the directory that the config file was found in. That's (thankfully) why all of the temp files and directories in the config just magically worked with this change. Seems like that's necessary for when a different config file is passed in, even before this change, so the machinery was there.
Seems like btest also lets you execute ignored files as tests, it just adds them if it doesn't already know about them and you passed a file in. I personally would rather that case just error, but maybe it has some use? |
rsmmr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so approving, I don't want to hold this up on the rare/impossible case of multiple configs. If you can easily make that one change of finding all configs, I'd still prefer that, otherwise fine as is.
3e33a5e to
fd0c25c
Compare
|
For the test I had to update the This seems to be the consensus behavior, minus style nits |
If btest.cfg is in the `testing/btest` relative directory, this allows
the user to call btest with `btest testing/btest/tests`, which will use
the btest.cfg file in testing/btest. It will also check its parents, so
you may use `btest testing/btest/language/while.zeek` - for example.
The first complication is that previously-valid uses of btest should
remain the same. This is done by always checking the current directory
for btest.cfg first.
The second is if there is a conflict between two tests' btest.cfg file.
For example, the following may choose two different btest.cfg files:
.
└── multiple-cfg
├── Baseline
├── btest.cfg
└── tests
├── no-cfg
│ └── test2.test
└── with-cfg
├── btest.cfg
└── tests
└── test1.test
If there is a conflicting config file, then btest should raise an error,
as it can currently only execute with one config file per run.
fd0c25c to
28b2f89
Compare
btest zeek/testing/btest/language/while.zeek)There are a couple edge cases I'll check tomorrow-or-so, therefore this is a draft. And the failing test is a little sad (where it finds the parent's btest config even though it should fail), may need a different config file name so that it doesn't clash with the test suite's btest config.