Rust: who tests the tester?

Created on 20 Jan 2018  路  5Comments  路  Source: rust-lang/rust

So, by and large, compiletest is untested, as far as I know. That is -- there are no 'self tests' to make sure that it's acting as it should, invoking revisions the way we expect, and so forth. This could be a bit of a tricky thing to do, but it's definitely worth the effort.

For example, an early version of https://github.com/rust-lang/rust/pull/47605 had a subtle bug where it appeared to be working, but in fact was not passing the revision info through to the final test. I don't think this would have bothered travis one bit, as that would have happily run the same revision over and over.

cc @spastorino @oli-obk ... we need like a compiletest team, don't why? :)

A-testsuite C-enhancement T-compiler

Most helpful comment

I have some beef with compiletest in general.

While I don't disagree, I feel a bit wary here. I'm fine with making a new testing setup, but it feels like the kind of thing that will derail progress for a long time. And I'm not convinced that the compiler's needs (e.g., things like mir-opt tests) will be satisfied by a more generic setup.

Unless you have a clear candidate of what test runner we should adopt, I'd rather see us move towards simplifying and centralizing things gradually and then at some later point perhaps switch. (Centralizing run-pass, compile-fail, and ui seems like an example of something we can do to simplify things now.)

All 5 comments

I have some beef with compiletest in general. Instead of having this unstable (as in nightly) library that contains a somewhat random list of test kinds that all behave subtly different, we should probably write a stable extensible library that is distributed via crates.io, developed like any other library (so it has tests) and uses cargo instead of manually calling rustc and hoping for the best.

So, the list of issues off the top of my head:

  • nightly only
  • rustc submodules need to use the crates.io version, which breaks with rustc changes
  • using dependencies in tests frequently causes "multiple matching crates" because of old compilation artifacts in the target direcory
  • not extensible with new test kinds (cc @killercup for suggestion tests)

I'd be happy to work on a library like this if we can have a conversation about what is exactly needed :).

@spastorino I started working on a very simple version of this to test clippy's diagnostics output as well as that its suggestions work as intended (when applied by rustfix). I'll have something up in later today, and will ping you in the clippy PR :)

In the meantime, feel free to say hello in the #clippy channel on irc.mozilla.org :)

I have some beef with compiletest in general.

While I don't disagree, I feel a bit wary here. I'm fine with making a new testing setup, but it feels like the kind of thing that will derail progress for a long time. And I'm not convinced that the compiler's needs (e.g., things like mir-opt tests) will be satisfied by a more generic setup.

Unless you have a clear candidate of what test runner we should adopt, I'd rather see us move towards simplifying and centralizing things gradually and then at some later point perhaps switch. (Centralizing run-pass, compile-fail, and ui seems like an example of something we can do to simplify things now.)

Triage; Looks like Pietro has added a bit of testing, but it's "just a start"

Was this page helpful?
0 / 5 - 0 ratings