[hawkmoth] Re: [PATCH 2/2] test: discover test cases based on output files

  • From: Bruno Santos <brunomanuelsantos@xxxxxxxxxxxxxxxxxx>
  • To: Jani Nikula <jani@xxxxxxxxxx>
  • Date: Sat, 2 Feb 2019 18:01:27 +0100

On 17:59:46 2019-02-02, Jani Nikula wrote:

On Fri, 01 Feb 2019, Bruno Santos <brunomanuelsantos@xxxxxxxxxxxxxxxxxx> 
wrote:
Test sources are not the ideal way to automatically discover tests
because every test requires a source file. This would require extra
metadata to discriminate which tests should be performed on each file,
which would be a needless maintenance burden.

Discovering tests based on the files used to check their success means
that sources can be easily shared across different test types and the
tests that are actually executed are in fact encoded in the file system
itself.

This scheme has the advantage of allowing test cases to be introduced in
a phased manner or opted out entirely in case they're somehow redundant.

All previous tests are still executed: so far only two types of tests
are supported and they're both related to the same .rst files.

Maybe I'm dense, but I don't quite grasp what's the advantage
here. Perhaps it would be useful to get a concrete example what the next
steps would be.

Nah, I probably didn't explain it well myself. So this follows from a
proposal I made earlier that the presence of certain files should
control which tests are executed.

Say we introduce stdout tests (e.g. to test propagation of warnings).
Those tests should be discovered by searching for .stdout files. That
way we don't have to create files for all possible cases, or at least
not right away.

I'm happy to drop this one or letting it sit until it becomes relevant
somehow. Mostly I was looking into how it could work out and felt like
seeing what you thought of it. In hindsight I should have emailed it
separately as an RFC.

Thanks for the other merges by the way ;)

Cheers,
Bruno


BR,
Jani.

Other related posts: