Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tox-ansible fails in driver detection when using a shared molecule config file in the project level #88

Closed
strider opened this issue Apr 21, 2021 · 0 comments · Fixed by #89
Labels
bug This issue/PR relates to a bug.

Comments

@strider
Copy link
Contributor

strider commented Apr 21, 2021

Tox-ansible doesn't seem to take in consideration molecule scenarios with empty molecule.yml inheriting from .config/molecule/config.yml file.

    $ tox -vla
    using tox.ini: /home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations/tox.ini (pid 3608)
    could not satisfy requires MissingDependency(<Requirement('tox-ansible>=1.4.0')>,)
    using tox-3.23.0 from /home/vagrant/.local/lib/python3.6/site-packages/tox/__init__.py (pid 3608)
    .tox cannot reuse: attr base_resolved_python_sha256 '80dba85793c708ee7c32ee8ee464ba4d4ac91086647c593ddd3ba284335155c9'!='33093341d63462e899499c51091f152c14e98f1200842217500858ef9265a278'
    .tox recreate: /home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations/.tox/.tox
    [3611] /home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations/.tox$ /usr/bin/python3 -m virtualenv --no-download --python /usr/bin/python3 .tox >.tox/log/.tox-0.log
    .tox installdeps: tox-ansible >= 1.4.0, tox >= 3.2.0
    [3618] /home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations$ /home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations/.tox/.tox/bin/python -m pip install 'tox-ansible >= 1.4.0' 'tox >= 3.2.0' >.tox/.tox/log/.tox-1.log
    write config to /home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations/.tox/.tox/.tox-config1 as '33093341d63462e899499c51091f152c14e98f1200842217500858ef9265a278 /usr/bin/python3\n3.23.0 0 1 0\n00000000000000000000000000000000 tox-ansible >= 1.4.0\n00000000000000000000000000000000 tox >= 3.2.0'
    [3624] /home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations$ /home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations/.tox/.tox/bin/python -m tox -vla
    using tox.ini: /home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations/tox.ini (pid 3624)
    Traceback (most recent call last):
      File "/usr/lib64/python3.6/runpy.py", line 193, in _run_module_as_main
        "__main__", mod_spec)
      File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "/home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations/.tox/.tox/lib/python3.6/site-packages/tox/__main__.py", line 4, in <module>
        tox.cmdline()
      File "/home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations/.tox/.tox/lib/python3.6/site-packages/tox/session/__init__.py", line 44, in cmdline
        main(args)
      File "/home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations/.tox/.tox/lib/python3.6/site-packages/tox/session/__init__.py", line 65, in main
        config = load_config(args)
      File "/home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations/.tox/.tox/lib/python3.6/site-packages/tox/session/__init__.py", line 81, in load_config
        config = parseconfig(args)
      File "/home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations/.tox/.tox/lib/python3.6/site-packages/tox/config/__init__.py", line 285, in parseconfig
        pm.hook.tox_configure(config=config)  # post process config object
      File "/home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations/.tox/.tox/lib/python3.6/site-packages/pluggy/hooks.py", line 286, in __call__
        return self._hookexec(self, self.get_hookimpls(), kwargs)
      File "/home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations/.tox/.tox/lib/python3.6/site-packages/pluggy/manager.py", line 93, in _hookexec
        return self._inner_hookexec(hook, methods, kwargs)
      File "/home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations/.tox/.tox/lib/python3.6/site-packages/pluggy/manager.py", line 87, in <lambda>
        firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
      File "/home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations/.tox/.tox/lib/python3.6/site-packages/pluggy/callers.py", line 208, in _multicall
        return outcome.get_result()
      File "/home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations/.tox/.tox/lib/python3.6/site-packages/pluggy/callers.py", line 80, in get_result
        raise ex[1].with_traceback(ex[2])
      File "/home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations/.tox/.tox/lib/python3.6/site-packages/pluggy/callers.py", line 187, in _multicall
        res = hook_impl.function(*args)
      File "/home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations/.tox/.tox/lib/python3.6/site-packages/tox_ansible/hooks.py", line 63, in tox_configure
        tox.add_envconfigs(tox_cases, options)
      File "/home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations/.tox/.tox/lib/python3.6/site-packages/tox_ansible/tox_helper.py", line 98, in add_envconfigs
        self.customize_envconfig(config, options)
      File "/home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations/.tox/.tox/lib/python3.6/site-packages/tox_ansible/tox_helper.py", line 116, in customize_envconfig
        processed_deps = do.postprocess(config, tox_case.get_dependencies())
      File "/home/vagrant/devel/tripleo/UPSTREAM/tripleo-validations/.tox/.tox/lib/python3.6/site-packages/tox_ansible/tox_molecule_case.py", line 81, in get_dependencies
        dependencies.append("molecule-" + driver)
    TypeError: must be str, not NoneType`
@ssbarnea ssbarnea added the bug This issue/PR relates to a bug. label Apr 22, 2021
strider added a commit to strider/tox-ansible that referenced this issue May 6, 2021
This patch adds the support for global molecule configuration at the
project level. It detects if a `.config/molecule/config.yml` file exists
at the root of the project and allows us to determine the driver name if
the scenarios configuration files didn't override the default one coming
from the global one.

Fixes ansible#88

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
strider added a commit to strider/tox-ansible that referenced this issue May 6, 2021
This patch adds the support for global molecule configuration at the
project level. It detects if a `.config/molecule/config.yml` file exists
at the root of the project and allows us to determine the driver name if
the scenarios configuration files didn't override the default one coming
from the global one.

Fixes ansible#88

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
openstack-mirroring pushed a commit to openstack-archive/validations-common that referenced this issue May 6, 2021
This patch adds a molecule configuration file at the repository
level (validations-common/.config/molecule/config.yml) which defines
all the default values for molecule.yml files in all roles.

This patch also introduces a common Dockerfile (UBI8 image) shared
between all the role molecule tests. This Dockerfile will install the
CentOS 8.x Linux Repos and GPG Keys during the image build.

This Dockerfile is located in validations-common/.config/molecule
directory and it is shared through a relative symbolic link between all
the molecule directories.

NOTE: tox-ansible doesn't manage shared molecule configuration at the
project level (see [1]). To be able to use it, we have to explicitly add
the driver name in each molecule.yml file in the roles level. Once [1]
will be fixed, these will be removed.

[1] - ansible/tox-ansible#88).

Change-Id: I907e2a13a3ba3b152ad7036fa1bb249bec980b76
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
openstack-mirroring pushed a commit to openstack/openstack that referenced this issue May 6, 2021
* Update validations-common from branch 'master'
  to a22b0ccaaffe8b60ec7f4e28a7725957b7b7ba3b
  - Merge "Add shared configuration for all molecule test"
  - Add shared configuration for all molecule test
    
    This patch adds a molecule configuration file at the repository
    level (validations-common/.config/molecule/config.yml) which defines
    all the default values for molecule.yml files in all roles.
    
    This patch also introduces a common Dockerfile (UBI8 image) shared
    between all the role molecule tests. This Dockerfile will install the
    CentOS 8.x Linux Repos and GPG Keys during the image build.
    
    This Dockerfile is located in validations-common/.config/molecule
    directory and it is shared through a relative symbolic link between all
    the molecule directories.
    
    NOTE: tox-ansible doesn't manage shared molecule configuration at the
    project level (see [1]). To be able to use it, we have to explicitly add
    the driver name in each molecule.yml file in the roles level. Once [1]
    will be fixed, these will be removed.
    
    [1] - ansible/tox-ansible#88).
    
    Change-Id: I907e2a13a3ba3b152ad7036fa1bb249bec980b76
    Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
strider added a commit to strider/tox-ansible that referenced this issue May 7, 2021
This patch adds the support for molecule base configuration. It will
allow us to use a global molecule configuration file[1] or to pass one
or multiple base configuration file(s) according to ansible-molecule
through the tox.ini file.

By default, if not passing base configuration file(s) in the tox.ini
file but if there is a global configuration file[1], this will be the
reference to determine the driver name if the scenarios configuration
files didn't override the default one coming from the global one[1].

If there is [1] at the project level and passing base configuration
file(s) in the tox.ini file, those latter will take precedence over the
global one[1].

Note that tox-ansible will now raise a RuntimeError if it finds out
multiple driver name declaration when using multiple molecule base
configuration.

[1] - <PROJECT_ABSPATH>/.config/molecule/config.yml

Fixes ansible#88

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
strider added a commit to strider/tox-ansible that referenced this issue May 7, 2021
This patch adds the support for molecule base configuration. It will
allow us to use a global molecule configuration file[1] or to pass one
or multiple base configuration file(s) according to ansible-molecule
through the tox.ini file.

By default, if not passing base configuration file(s) in the tox.ini
file but if there is a global configuration file[1], this will be the
reference to determine the driver name if the scenarios configuration
files didn't override the default one coming from the global one[1].

If there is [1] at the project level and passing base configuration
file(s) in the tox.ini file, those latter will take precedence over the
global one[1].

Note that tox-ansible will now raise a RuntimeError if it finds out
multiple driver name declaration when using multiple molecule base
configuration.

[1] - <PROJECT_ABSPATH>/.config/molecule/config.yml

Fixes ansible#88

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
strider added a commit to strider/tox-ansible that referenced this issue May 10, 2021
This patch adds the support for molecule base configuration. It will
allow us to use a global molecule configuration file[1] or to pass one
or multiple base configuration file(s) according to ansible-molecule
through the tox.ini file.

By default, if not passing base configuration file(s) in the tox.ini
file but if there is a global configuration file[1], this will be the
reference to determine the driver name if the scenarios configuration
files didn't override the default one coming from the global one[1].

If there is [1] at the project level and passing base configuration
file(s) in the tox.ini file, those latter will take precedence over the
global one[1].

Note that tox-ansible will now raise a RuntimeError if it finds out
multiple driver name declaration when using multiple molecule base
configuration.

[1] - <PROJECT_ABSPATH>/.config/molecule/config.yml

Fixes ansible#88

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
strider added a commit to strider/tox-ansible that referenced this issue May 14, 2021
This patch adds the support for molecule base configuration. It will
allow us to use a global molecule configuration file[1] or to pass one
or multiple base configuration file(s) according to ansible-molecule
through the tox.ini file and the `molecule_config_files` option.

By default, if not passing base configuration file(s) in the tox.ini
file but if there is a global configuration file[1], this will be the
reference to determine the driver name if the scenarios configuration
files didn't override the default one coming from the global one[1].

If there is [1] at the project level and passing base configuration
file(s) in the tox.ini file, those latter will take precedence over the
global one[1].

Note that tox-ansible will now raise a RuntimeError if it finds out
multiple driver name declaration when using multiple molecule base
configuration.

[1] - <PROJECT_ABSPATH>/.config/molecule/config.yml

Fixes ansible#88

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
strider added a commit to strider/tox-ansible that referenced this issue May 14, 2021
This patch adds the support for molecule base configuration. It will
allow us to use a global molecule configuration file[1] or to pass one
or multiple base configuration file(s) according to ansible-molecule
through the tox.ini file and the `molecule_config_files` option.

By default, if not passing base configuration file(s) in the tox.ini
file but if there is a global configuration file[1], this will be the
reference to determine the driver name if the scenarios configuration
files didn't override the default one coming from the global one[1].

If there is [1] at the project level and passing base configuration
file(s) in the tox.ini file, those latter will take precedence over the
global one[1].

Note that tox-ansible will now raise a RuntimeError if it finds out
multiple driver name declaration when using multiple molecule base
configuration.

[1] - <PROJECT_ABSPATH>/.config/molecule/config.yml

Fixes ansible#88

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
openstack-mirroring pushed a commit to openstack-archive/tripleo-validations that referenced this issue May 15, 2021
This patch adds a molecule configuration file at the repository
level (tripleo-validations/.config/molecule/config.yml) which defines
all the default values for molecule.yml files in all roles.

This patch also introduces a common Dockerfile (UBI8 image) shared
between all the role molecule tests. This Dockerfile will install the
CentOS 8.x Linux Repos and GPG Keys during the image build.

This Dockerfile is located in tripleo-validations/.config/molecule
directory and it is shared through a relative symbolic link between all
the molecule directories.

NOTE: tox-ansible doesn't manage shared molecule configuration at the
project level (see [1]). To be able to use it, we have to explicitly add
the driver name in each molecule.yml file in the roles level. Once [1]
will be fixed, these will be removed.

[1] - ansible/tox-ansible#88).

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
Change-Id: I4717825e2767dc55016a30fb62aa6a5541f26cfd
openstack-mirroring pushed a commit to openstack/openstack that referenced this issue May 15, 2021
* Update tripleo-validations from branch 'master'
  to 66193a69b79a51d436f132d30b0d530e0f1139ac
  - Add shared configuration for all molecule test
    
    This patch adds a molecule configuration file at the repository
    level (tripleo-validations/.config/molecule/config.yml) which defines
    all the default values for molecule.yml files in all roles.
    
    This patch also introduces a common Dockerfile (UBI8 image) shared
    between all the role molecule tests. This Dockerfile will install the
    CentOS 8.x Linux Repos and GPG Keys during the image build.
    
    This Dockerfile is located in tripleo-validations/.config/molecule
    directory and it is shared through a relative symbolic link between all
    the molecule directories.
    
    NOTE: tox-ansible doesn't manage shared molecule configuration at the
    project level (see [1]). To be able to use it, we have to explicitly add
    the driver name in each molecule.yml file in the roles level. Once [1]
    will be fixed, these will be removed.
    
    [1] - ansible/tox-ansible#88).
    
    Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
    Change-Id: I4717825e2767dc55016a30fb62aa6a5541f26cfd
openstack-mirroring pushed a commit to openstack-archive/tripleo-validations that referenced this issue Jun 3, 2021
This patch adds a molecule configuration file at the repository
level (tripleo-validations/.config/molecule/config.yml) which defines
all the default values for molecule.yml files in all roles.

This patch also introduces a common Dockerfile (UBI8 image) shared
between all the role molecule tests. This Dockerfile will install the
CentOS 8.x Linux Repos and GPG Keys during the image build.

This Dockerfile is located in tripleo-validations/.config/molecule
directory and it is shared through a relative symbolic link between all
the molecule directories.

NOTE: tox-ansible doesn't manage shared molecule configuration at the
project level (see [1]). To be able to use it, we have to explicitly add
the driver name in each molecule.yml file in the roles level. Once [1]
will be fixed, these will be removed.

[1] - ansible/tox-ansible#88).

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
Change-Id: I4717825e2767dc55016a30fb62aa6a5541f26cfd
(cherry picked from commit 66193a6)
openstack-mirroring pushed a commit to openstack-archive/tripleo-validations that referenced this issue Jun 23, 2021
This patch adds a molecule configuration file at the repository
level (tripleo-validations/.config/molecule/config.yml) which defines
all the default values for molecule.yml files in all roles.

This patch also introduces a common Dockerfile (UBI8 image) shared
between all the role molecule tests. This Dockerfile will install the
CentOS 8.x Linux Repos and GPG Keys during the image build.

This Dockerfile is located in tripleo-validations/.config/molecule
directory and it is shared through a relative symbolic link between all
the molecule directories.

NOTE: tox-ansible doesn't manage shared molecule configuration at the
project level (see [1]). To be able to use it, we have to explicitly add
the driver name in each molecule.yml file in the roles level. Once [1]
will be fixed, these will be removed.

[1] - ansible/tox-ansible#88).

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
Change-Id: I4717825e2767dc55016a30fb62aa6a5541f26cfd
(cherry picked from commit 66193a6)
(cherry picked from commit 6a3081b)
(cherry picked from commit 8bd52a2)
openstack-mirroring pushed a commit to openstack-archive/tripleo-validations that referenced this issue Jun 23, 2021
This patch adds a molecule configuration file at the repository
level (tripleo-validations/.config/molecule/config.yml) which defines
all the default values for molecule.yml files in all roles.

This patch also introduces a common Dockerfile (UBI8 image) shared
between all the role molecule tests. This Dockerfile will install the
CentOS 8.x Linux Repos and GPG Keys during the image build.

This Dockerfile is located in tripleo-validations/.config/molecule
directory and it is shared through a relative symbolic link between all
the molecule directories.

NOTE: tox-ansible doesn't manage shared molecule configuration at the
project level (see [1]). To be able to use it, we have to explicitly add
the driver name in each molecule.yml file in the roles level. Once [1]
will be fixed, these will be removed.

[1] - ansible/tox-ansible#88).

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
Change-Id: I4717825e2767dc55016a30fb62aa6a5541f26cfd
(cherry picked from commit 66193a6)
(cherry picked from commit 6a3081b)
openstack-mirroring pushed a commit to openstack-archive/tripleo-validations that referenced this issue Jul 6, 2021
This patch adds a molecule configuration file at the repository
level (tripleo-validations/.config/molecule/config.yml) which defines
all the default values for molecule.yml files in all roles.

This patch also introduces a common Dockerfile (UBI8 image) shared
between all the role molecule tests. This Dockerfile will install the
CentOS 8.x Linux Repos and GPG Keys during the image build.

This Dockerfile is located in tripleo-validations/.config/molecule
directory and it is shared through a relative symbolic link between all
the molecule directories.

NOTE: tox-ansible doesn't manage shared molecule configuration at the
project level (see [1]). To be able to use it, we have to explicitly add
the driver name in each molecule.yml file in the roles level. Once [1]
will be fixed, these will be removed.

[1] - ansible/tox-ansible#88).

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
Change-Id: I4717825e2767dc55016a30fb62aa6a5541f26cfd
(cherry picked from commit 66193a6)
(cherry picked from commit 6a3081b)
(cherry picked from commit 8bd52a2)
(cherry picked from commit f2f322c1ea195905d080b303a0e97c905f9592f3)
greg-hellings pushed a commit to greg-hellings/tox-ansible that referenced this issue Sep 3, 2021
This patch adds the support for molecule base configuration. It will
allow us to use a global molecule configuration file[1] or to pass one
or multiple base configuration file(s) according to ansible-molecule
through the tox.ini file and the `molecule_config_files` option.

By default, if not passing base configuration file(s) in the tox.ini
file but if there is a global configuration file[1], this will be the
reference to determine the driver name if the scenarios configuration
files didn't override the default one coming from the global one[1].

If there is [1] at the project level and passing base configuration
file(s) in the tox.ini file, those latter will take precedence over the
global one[1].

Note that tox-ansible will now raise a RuntimeError if it finds out
multiple driver name declaration when using multiple molecule base
configuration.

[1] - <PROJECT_ABSPATH>/.config/molecule/config.yml

Fixes ansible#88

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants