molecule: Multiple platforms support (--platform option not working)

$ molecule --version
1.5.1

I would assume that Molecule would run molecule test for each platform listed in platforms but that doesn’t seem to be the case. Below is my molecule.yml file.

vagrant:
  raw_config_args:
    - "ssh.insert_key = false"

  platforms:
    - name: trusty64
      box: ubuntu/trusty64
    - name: precise64
      box: ubuntu/precise64

  providers:
    - name: virtualbox
      type: virtualbox
      options:
        memory: 1024
        cpus: 2

  instances:
    - name: s1
      options:
        append_platform_to_hostname: no

When running molecule test:

Only trusty64 platform is tested in Vagrant. I would expect Molecule to run tests for each platform listed in platforms.

When running molecule test --platform=precise64:

Still trusty64 is being used… --platform option doesn’t change behaviour.

Bringing machine 's1' up with 'virtualbox' provider...
==> s1: Cloning VM...
==> s1: Matching MAC address for NAT networking...
==> s1: Checking if box 'ubuntu/trusty64' is up to date...

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 3
  • Comments: 18 (15 by maintainers)

Commits related to this issue

Most upvoted comments

I am confused.

  • The first post claims --platform argument is ignored when running module test.
  • The title mentions two things “Multiple platforms support (–platform option not working)”.
  • The merge added all option which tangentially addresses first part of the title.

Why was this closed?

The issue described (--platform ignored when running test) is still a problem in current 1.7.0.

Ditching the --platform flag would be a substantial change, and might surprise folks unnecessarily. It would also contradict the approach in #147, requiring that we instead default to appending platforms to hostname (which is test-kitchen’s approach).

At the risk of sounding overly cautious, I’d say let’s support a magic --platform=all var as a first step in migrating away from the single-platform-only approach Molecule currently espouses. If folks still find that too problematic, we can rather simply update it to be even more similar to test-kitchen, but I don’t think that’s necessary right now.