Automatic generation of example index

71 views Asked by At

A common case is to have examples organized in a file hierarchy and a top-level index, that results in a report summary.

Currently we write this index file by hand, making it easy to forget to add a new example file.

Is there a way to generate this index file from the example file hierarchy ?

2

There are 2 answers

0
Nigel Charman On

I'm aware that some companies have done this, but nothing exists in the Concordion project to do this currently.

One option I've been considering is a runAll command that would run all children of an index. Would something like this work for you?

We'd need to consider what to actually run. Different patterns are:

1) We have just a top-level index specification that should run all descendants. 2) We have an index specification at each level and should run siblings and immediate child index specifications. 3) Maybe we have an index specification at each level and should run all immediate children including index specifications.

This could result in multiple commands, eg. runSiblings, runChildren, runChildIndexes, runDescendants.

What do you think?

1
Vlad Gheorghe On

I don't think we need to introduce a new file type as an index file. In the current state, we have a md file as a module of specification, and the run command that can invoke other module. The problem we have is that in using run we have for each subordinate module to write a title and the relative path.

This can be avoided with a variant of the run command that

  • takes a glob expression that will evaluate to a list of modules to be run
  • is replaced in the report with the list of the sub-modules' titles, decorated information on the pass or fail status of their respective executions

The resulting report would be equivalent to one resulting from a hand-written index module.