uclahs-cds / Ligare

GNU General Public License v2.0
0 stars 0 forks source link

The "test" module in ligare-scaffold does not create database tests depending on CLI arguments #149

Open aholmes opened 1 week ago

aholmes commented 1 week ago

ligare-scaffold contains a module for both "test" and "database." The test module is supposed to create database tests when the database module is specified. When database is specified before test, it works as expected; however, the inverse does not work as expected and no database tests are created.

Works:

ligare-scaffold create -n foo -e foo -e bar -m database -m test

Does not work:

ligare-scaffold create -n foo -e foo -e bar -m test -m database
aholmes commented 6 days ago

This is likely caused by how the Test module template determines whether the Database module was selected. The template executes {% if module.database %}, which only passes if the Database module has already executed. This is because the Database module is responsible for setting module.database in the template Jinja2 Environment, which occurs here.

A solution may be to have the Test module template check a different variable to determine whether the Database module was selected (maybe modules?).