Molecule: Remove scenario name configuration option

Created on 12 Nov 2019  路  4Comments  路  Source: ansible-community/molecule

Proposal: Remove scenario name configuration option

Author: Tadej Borov拧ak <@tadeboro>

Date: 2019-11-12

  • Status: New
  • Proposal type: core configuration
  • Estimated time to implement: a week

Motivation

Because Molecule allows scenario name to be different from the name of the folder that contains the scenario files, it must load all scenario configurations before it can do anything.

Problems

What problems exist that this proposal will solve?

  • In situations where many scenarios exist, loading all of them can take a significant amount of time. All this time is wasted in most situations where we are executing a single scenario.
  • If we have a single scenario with broken (invalid config for example), we cannot run anything else until we fix it. This is almost as annoying as go compiler's insistence on removing unused variables during development.

Solution proposal

  • Molecule should always name the scenario after the folder that contains a molecule.yml file. This would allow us to skip the initial scenario loading since we know exactly where the scenario in question is located on the disk by simply looking at the scenario name.

Documentation

We must document this new behavior thoroughly.

Anything else?

Because this is an obvious API break, we can only do this during the major version bump.

enhancement help wanted proposal

Most helpful comment

Molecule should always name the scenario after the folder that contains a molecule.yml file.

This is precisely what I meant but failed to communicate it properly. I will copy your wording into the proposal.

As for the PR, I can prepare something, but unfortunately, not until next week (I am stuck with some other, higher priority work currently).

All 4 comments

I didn't even know this was possible until I very recently moved a scenario and spent a long time trying to figure out why the new name was not recognised and the old one still in use... and found out that the name was configured in every single scenario (after the folder name, non-sense !)

I do not see any good reason why you would like the scenario name to be different from the folder name containing it. Moreover, if this is a possible performance booster +100 !

Thanks for raising this. I'm +1 on and I think the change to making it optional was part of moving ahead to removing it in the end but we just never had the extra time to make it happen.

To clarify though:

Molecule should always name the scenario after the folder that contains a molecule.yml file.

You mean, molecule should always expect that the name of the scenario is the folder that contains the molecule.yml file? Or something else?

I'll happily see a PR for this.

Molecule should always name the scenario after the folder that contains a molecule.yml file.

This is precisely what I meant but failed to communicate it properly. I will copy your wording into the proposal.

As for the PR, I can prepare something, but unfortunately, not until next week (I am stuck with some other, higher priority work currently).

@tadeboro I support your proposal. Can you make a quick PR for it as we are getting close to v3 and if we miss it, we will have to live with old behavior for a very long time.

Was this page helpful?
0 / 5 - 0 ratings