ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
820 stars 1.5k forks source link

gem: integration test fails out of the box #7394

Open interfan7 opened 12 months ago

interfan7 commented 12 months ago

Summary

I'm ramping-up on testing and contributing a PR on module gem.

Reading the doc on how to test, I've attempted to execute an integration test from a clean clone, but it has yielded errors.

Issue Type

Bug Report

Component Name

gem

Ansible Version

ansible [core 2.15.2]
  config file = None
  configured module search path = ['/Users/leonidbrandes/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/homebrew/Cellar/ansible/8.2.0/libexec/lib/python3.11/site-packages/ansible
  ansible collection location = /Users/leonidbrandes/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/homebrew/bin/ansible
  python version = 3.11.4 (main, Jun 20 2023, 17:23:00) [Clang 14.0.3 (clang-1403.0.22.14.1)] (/opt/homebrew/Cellar/ansible/8.2.0/libexec/bin/python3.11)
  jinja version = 3.1.2
  libyaml = True

Community.general Version

# /opt/homebrew/Cellar/ansible/8.2.0/libexec/lib/python3.11/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 7.2.0

Configuration

OS / Environment

Host OS is MacOS. The docker-desktop is running a VM on which Docker engine is executed.

Steps to Reproduce

Run:

ansible-test integration gem --docker -v

Expected Results

I'm not sure what is the exact expected output (errors, OK's, changes, skipped etc...). Is it documented? But I guess it shall be a successfull Ansible execution?

Actual Results

... {removed for brevity} ...
TASK [gem : Install a gem] *****************************************************
fatal: [testhost]: FAILED! => {"changed": false, "msg": "Failed to find required executable \"gem\" in paths: /tmp/ansible-test-l4w6tm5m-injector:/tmp/python-shkjxhuf-ansible:/root/ansible/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"}
...ignoring
... {removed for brevity} ...
TASK [gem : Install a gem with --no-user-install] ******************************
fatal: [testhost]: FAILED! => {"changed": false, "msg": "Failed to find required executable \"gem\" in paths: /tmp/ansible-test-l4w6tm5m-injector:/tmp/python-shkjxhuf-ansible:/root/ansible/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"}
... {removed for brevity} ...

Code of Conduct

ansibullbot commented 12 months ago

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 12 months ago

cc @None @johanwiren click here for bot help

felixfontein commented 12 months ago

You need to supply an OS image to --docker (like fedora38 or ubuntu2204); the default image won't work for this integration test.

felixfontein commented 12 months ago

like: ansible-test integration gem --docker fedora38 -v

interfan7 commented 12 months ago

Thanks @felixfontein !

It works.

What is your suggestion if I need to install a few apps upon that clean image (Ubuntu) for my tests to run? It may be as large as 200-250 MB of apps. Isn't it a waste of BW to d/l it every time the integration test runs? The Ubuntu image is cached, but installing the packages upon each run is executed every run.

felixfontein commented 11 months ago

@interfan7 you might want to look for very small apps then.