Skip to content

Scaffolded integration test target name doesn't match the plugin it tests #588

Description

@leogallego

Summary

When scaffolding a new collection with ansible-creator init collection, the generated Molecule integration test target is named hello_world (with scenario integration_hello_world), but it actually tests the sample_filter plugin — not a plugin called hello_world.

This breaks the naming convention that Molecule's shared converge.yml relies on (scenario integration_X → target X → tests plugin X), and creates confusion when users add new plugins.

Steps to reproduce

ansible-creator init collection mynamespace.mycollection /tmp/mynamespace.mycollection

Expected behavior

The integration test target name should match the plugin it tests. Either:

  • Option A: Rename the test target to sample_filter and the scenario to integration_sample_filter to match the scaffolded sample_filter.py plugin
  • Option B: Rename the scaffolded plugin from sample_filter.py to hello_world.py to match the test target

Actual behavior

  • Scaffolded plugin: plugins/filter/sample_filter.py
  • Molecule scenario: extensions/molecule/integration_hello_world
  • Test target: tests/integration/targets/hello_world/tasks/main.yml
  • The test target calls mynamespace.mycollection.sample_filter, not hello_world

Why this matters

  1. Users assume the test validates a hello_world plugin based on the naming
  2. If a user creates a new plugin called hello_world (e.g., via ansible-creator add plugin filter hello_world), the existing test still passes — but it's validating sample_filter, not the new plugin
  3. The inconsistency makes it harder for users learning Molecule to understand the scenario-to-target-to-plugin mapping

Environment

  • ansible-creator 26.4.2
  • ansible-core 2.20.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions