-
Notifications
You must be signed in to change notification settings - Fork 13.7k
compiletest: assert that debugger provided for debuginfo tests and any tests actually collected for run #145326
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
base: master
Are you sure you want to change the base?
Conversation
…y tests actually collected for run
rustbot has assigned @Mark-Simulacrum. Use |
Some changes occurred in src/tools/compiletest cc @jieyouxu |
Hm, so on the one hand, this feels reasonable. On the other hand, if you genuinely don't have any debuggers I think this will cause e.g. I think if you're explicitly asking to run debugger-using tests it makes more sense to treat that as a failure... @rust-lang/bootstrap (for lack of a better group), any opinions on this change? Do we think failing with zero tests found is right? |
IMO this feels a bit weird (but it's due to how debuginfo suite is implemented, which IMO suboptimal in the first place). I've wanted to change the debuginfo setup to make it not report 0 of 0, but properly report like all the tests as ignored. |
Ah, so this wouldn't actually panic if we reported all the tests as ignored? That seems like good reason to not do it, then... |
IIRC how it currently works is a hack, if you don't have the debugger available (without specifying explicit debugger |
I don't think that we should aim for I'd rather error out here - if you run debuginfo tests and you don't have a debugger, it should be a failure. If we want to make this situation a success, we should remove debuginfo tests from |
I think we agree in spirit, I'm not sure the current proposal ("no tests ran") feels right though. Is it OK to run debuginfo tests with just a single version of gdb? Presumably, yes, at least in their current formulation. But it seems clear that might run a very small amount of tests in practice, especially if it's an old version. Does running 1/50 tests, with the rest ignored due to missing lldb/cdb/gdb (or wrong version) seem reasonably a "success"? |
I would say so, as long as it clearly tells you that the rest was skipped because of some specific reason that you then might want to fix locally to run more tests (e.g. installing a debugger). |
So, then it seems like:
Should imply we drop that panic/assertion from this PR :) |
Maybe print something like "Warning: tests that require debugger foo, bar will be skipped, only tests that require debugger baz will run" if there at least some debugger. |
Yes, things like https://github.com/rust-lang/rust/blob/master/tests/debuginfo/issue-14411.rs didn't require debugger, but i remember that there was some issues with running it anyway, i'll try to check what's wrong again. |
Or by default all debuggers required, any error on locating them is hard error; and add option where you explicitly excludes usage of some debuggers, so not to rely on whether they found or not. Used/unused should still should be logged. |
This is impossible, right? E.g., cdb I think is Windows-only? It also doesn't get into the versioning -- but I wouldn't generally expect it to be easy to get a full set of debuggers to run the full test suite on one machine, at least not as a user. Maybe we should punt on this kind of check until some rework of debug info tests (e.g., I could imagine trying to build lldb if that's not too hard -- we do have llvm sources already -- so we have a reliable version, or similar stories that make it easier to get a baseline check; I could also imagine trying to lint DWARF information in generated binaries/libraries rather than using off the shelf debuggers). |
No, i mean that by default all debuggers required - means that you should disable unused ones manually via compiletest/bootstrap/config.toml/etc. So when debuginfo test run: they will fail if debuggers not set/not found/etc -> user will review this and unset ones that he don't want to use, so user will have full info why some tests skipped. |
I think the current behavior (that all debuggers are required and you can opt-out of certain ones) is very awkward. I wonder if it's... less annoying to run the test suite if:
But perhaps before that, we may need to revisit what use cases we are looking for from the debuginfo test suite, because this has been a very awkward test suite for contributors to run IME. Like I think For (2), it's because for instance, you can have multiple MSVC toolchains, but IIRC compiletest currently tries to be "smart" and discover a Basically, I think I don't want to land this assertion but not because I feel it's wrong per se, but rather IMHO the current testing devex of the debuginfo test suite needs a redesign, and that needing this assertion to plug the situation where no tests get run is a symptom. |
I've run tests on some machine which for some reason missed any debuggers, and
x.py test tests/debuginfo
happily reported that it successfully run 0 of 0 test. That is bad.Added two asserts: that for debuginfo suite there actually found any debugger; and that for current config any (non zero) number of tests collected.
Feel free to suggest better wording for errors.