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

Integration Tests fail to run on Alpine Linux 3.21.3 #171

Open
gdrosos opened this issue Mar 17, 2025 · 0 comments
Open

Integration Tests fail to run on Alpine Linux 3.21.3 #171

gdrosos opened this issue Mar 17, 2025 · 0 comments

Comments

@gdrosos
Copy link

gdrosos commented Mar 17, 2025

SUMMARY

We ran a cross-OS testing campaign for cloud.terraform, and specifically when testing the module terraform_output using the command: ansible-test integration terraform_output --allow-destructive --requirements --allow-root --continue-on-error, the tests run as expected on Ubuntu 20.04, 22.04, 24.04, 24.10 25.04, Fedora 34, 38, Arch Linux, and Debian (latest versions). However, on latest version of Alpine Linux (3.21.3) the tests fail to execute. Note that the same error occurs when running integratino tests of plan_stash

ISSUE TYPE
  • Bug Report
COMPONENT NAME

terraform_output & plan_stash

ANSIBLE VERSION

I used the latest version of ansible-test

OS / ENVIRONMENT

Error can be reproduced on Alpine Linux 3.21.3

STEPS TO REPRODUCE MINIMAL TEST CASE

On Alpine Linux 3.21.3 install Python using apk:

 apk add --no-cache \
    python3 \
    py3-pip \

Then install ansible-test or use directly the binary from the official repo of ansible-test and run the following command from the directory of the cloud.terraform repository:

ansible-test integration terraform_output --allow-destructive --requirements --allow-root --continue-on-error

EXPECTED RESULTS

In other operating systems or versions (e.g. Ubuntu versions 20.04, 22.04 24.04, 24.10, 25.04, Fedora 38, Fedora 34 , Arch Linux or Debian) tests can start properly without any dependency or setup issue:

....
PLAY [testhost] ****************************************************************

TASK [Gathering Facts] *********************************************************
ok: [testhost]

TASK [terraform_output : set_fact] *********************************************
ok: [testhost]

TASK [terraform_output : Copy terraform files to work space] *******************
changed: [testhost] => (item=outputs.tf)

TASK [terraform_output : Init terraform files] *********************************
fatal: [testhost]: FAILED! => {"changed": true, "cmd": "cd /ansible_collections/cloud/terraform/tests/output/.tmp/output_dir\nterraform init\nterraform apply -auto-approve\nterraform apply -auto-approve -state mycustomstate.tfstate\n", "delta": "0:00:00.002512", "end": "2025-03-17 18:19:44.824147", "msg": "non-zero return code", "rc": 127, "start": "2025-03-17 18:19:44.821635", "stderr": "/bin/sh: 2: terraform: not found\n/bin/sh: 3: terraform: not found\n/bin/sh: 4: terraform: not found", "stderr_lines": ["/bin/sh: 2: terraform: not found", "/bin/sh: 3: terraform: not found", "/bin/sh: 4: terraform: not found"], "stdout": "", "stdout_lines": []}

PLAY RECAP *********************************************************************
testhost                   : ok=3    changed=1    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   

ERROR: Command "ansible-playbook terraform_output-db3n_4sn.yml -i inventory" returned exit status 2.
FATAL: The 1 integration test(s) listed below (out of 1) failed. See error output above for details:
terraform_output
ACTUAL RESULTS

On Alpine Linux, we get:

Installing requirements for Python 3.12 (controller)
Collecting PyYAML>=5.1 (from -r requirements/ansible.txt (line 7))
  Downloading PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.1 kB)
Collecting cryptography (from -r requirements/ansible.txt (line 8))
  Downloading cryptography-44.0.2-cp39-abi3-manylinux_2_34_x86_64.whl.metadata (5.7 kB)
...
...
Downloading hyperframe-6.1.0-py3-none-any.whl (13 kB)
Downloading sniffio-1.3.1-py3-none-any.whl (10 kB)
Downloading wrapt-1.17.2-cp312-cp312-musllinux_1_2_x86_64.whl (87 kB)
Downloading zipp-3.21.0-py3-none-any.whl (9.6 kB)
Building wheels for collected packages: psutil, uamqp
  Building wheel for psutil (pyproject.toml): started
  Building wheel for psutil (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error
  
  × Building wheel for psutil (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [42 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build/lib.linux-x86_64-cpython-312/psutil
      copying psutil/_common.py -> build/lib.linux-x86_64-cpython-312/psutil
      copying psutil/_compat.py -> build/lib.linux-x86_64-cpython-312/psutil
      copying psutil/_pslinux.py -> build/lib.linux-x86_64-cpython-312/psutil
      copying psutil/__init__.py -> build/lib.linux-x86_64-cpython-312/psutil
      copying psutil/_psposix.py -> build/lib.linux-x86_64-cpython-312/psutil
      copying psutil/_psbsd.py -> build/lib.linux-x86_64-cpython-312/psutil
      copying psutil/_pswindows.py -> build/lib.linux-x86_64-cpython-312/psutil
      copying psutil/_psaix.py -> build/lib.linux-x86_64-cpython-312/psutil
      copying psutil/_pssunos.py -> build/lib.linux-x86_64-cpython-312/psutil
      copying psutil/_psosx.py -> build/lib.linux-x86_64-cpython-312/psutil
      creating build/lib.linux-x86_64-cpython-312/psutil/tests
      copying psutil/tests/test_contracts.py -> build/lib.linux-x86_64-cpython-312/psutil/tests
      copying psutil/tests/test_sunos.py -> build/lib.linux-x86_64-cpython-312/psutil/tests
      copying psutil/tests/test_osx.py -> build/lib.linux-x86_64-cpython-312/psutil/tests
      copying psutil/tests/test_process_all.py -> build/lib.linux-x86_64-cpython-312/psutil/tests
      copying psutil/tests/test_memleaks.py -> build/lib.linux-x86_64-cpython-312/psutil/tests
      copying psutil/tests/test_aix.py -> build/lib.linux-x86_64-cpython-312/psutil/tests
      copying psutil/tests/__init__.py -> build/lib.linux-x86_64-cpython-312/psutil/tests
      copying psutil/tests/test_bsd.py -> build/lib.linux-x86_64-cpython-312/psutil/tests
      copying psutil/tests/test_misc.py -> build/lib.linux-x86_64-cpython-312/psutil/tests
      copying psutil/tests/test_connections.py -> build/lib.linux-x86_64-cpython-312/psutil/tests
      copying psutil/tests/__main__.py -> build/lib.linux-x86_64-cpython-312/psutil/tests
      copying psutil/tests/runner.py -> build/lib.linux-x86_64-cpython-312/psutil/tests
      copying psutil/tests/test_linux.py -> build/lib.linux-x86_64-cpython-312/psutil/tests
      copying psutil/tests/test_process.py -> build/lib.linux-x86_64-cpython-312/psutil/tests
      copying psutil/tests/test_windows.py -> build/lib.linux-x86_64-cpython-312/psutil/tests
      copying psutil/tests/test_unicode.py -> build/lib.linux-x86_64-cpython-312/psutil/tests
      copying psutil/tests/test_testutils.py -> build/lib.linux-x86_64-cpython-312/psutil/tests
      copying psutil/tests/test_system.py -> build/lib.linux-x86_64-cpython-312/psutil/tests
      copying psutil/tests/test_posix.py -> build/lib.linux-x86_64-cpython-312/psutil/tests
      running build_ext
      building 'psutil._psutil_linux' extension
      creating build/temp.linux-x86_64-cpython-312/psutil
      creating build/temp.linux-x86_64-cpython-312/psutil/arch/linux
      gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=598 -DPy_LIMITED_API=0x03060000 -DPSUTIL_ETHTOOL_MISSING_TYPES=1 -DPSUTIL_LINUX=1 -I/usr/include/python3.12 -c psutil/_psutil_common.c -o build/temp.linux-x86_64-cpython-312/psutil/_psutil_common.o
      psutil could not be installed from sources because gcc is not installed. Try running:
        sudo apk add gcc python3-dev musl-dev linux-headers
      error: command 'gcc' failed: No such file or directory
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for psutil
  Building wheel for uamqp (pyproject.toml): started
  Building wheel for uamqp (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error
  
  × Building wheel for uamqp (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [116 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build/lib.linux-x86_64-cpython-312/uamqp
      copying uamqp/message.py -> build/lib.linux-x86_64-cpython-312/uamqp
      copying uamqp/connection.py -> build/lib.linux-x86_64-cpython-312/uamqp
      copying uamqp/sender.py -> build/lib.linux-x86_64-cpython-312/uamqp
      copying uamqp/utils.py -> build/lib.linux-x86_64-cpython-312/uamqp
      copying uamqp/session.py -> build/lib.linux-x86_64-cpython-312/uamqp
      copying uamqp/receiver.py -> build/lib.linux-x86_64-cpython-312/uamqp
      copying uamqp/__init__.py -> build/lib.linux-x86_64-cpython-312/uamqp
      copying uamqp/constants.py -> build/lib.linux-x86_64-cpython-312/uamqp
      copying uamqp/compat.py -> build/lib.linux-x86_64-cpython-312/uamqp
      copying uamqp/address.py -> build/lib.linux-x86_64-cpython-312/uamqp
      copying uamqp/errors.py -> build/lib.linux-x86_64-cpython-312/uamqp
      copying uamqp/types.py -> build/lib.linux-x86_64-cpython-312/uamqp
      copying uamqp/client.py -> build/lib.linux-x86_64-cpython-312/uamqp
      copying uamqp/mgmt_operation.py -> build/lib.linux-x86_64-cpython-312/uamqp
      creating build/lib.linux-x86_64-cpython-312/uamqp/async_ops
      copying uamqp/async_ops/utils.py -> build/lib.linux-x86_64-cpython-312/uamqp/async_ops
      copying uamqp/async_ops/client_async.py -> build/lib.linux-x86_64-cpython-312/uamqp/async_ops
      copying uamqp/async_ops/connection_async.py -> build/lib.linux-x86_64-cpython-312/uamqp/async_ops
      copying uamqp/async_ops/__init__.py -> build/lib.linux-x86_64-cpython-312/uamqp/async_ops
      copying uamqp/async_ops/sender_async.py -> build/lib.linux-x86_64-cpython-312/uamqp/async_ops
      copying uamqp/async_ops/session_async.py -> build/lib.linux-x86_64-cpython-312/uamqp/async_ops
      copying uamqp/async_ops/mgmt_operation_async.py -> build/lib.linux-x86_64-cpython-312/uamqp/async_ops
      copying uamqp/async_ops/receiver_async.py -> build/lib.linux-x86_64-cpython-312/uamqp/async_ops
      creating build/lib.linux-x86_64-cpython-312/uamqp/authentication
      copying uamqp/authentication/cbs_auth_async.py -> build/lib.linux-x86_64-cpython-312/uamqp/authentication
      copying uamqp/authentication/cbs_auth.py -> build/lib.linux-x86_64-cpython-312/uamqp/authentication
      copying uamqp/authentication/__init__.py -> build/lib.linux-x86_64-cpython-312/uamqp/authentication
      copying uamqp/authentication/common.py -> build/lib.linux-x86_64-cpython-312/uamqp/authentication
      running egg_info
      writing uamqp.egg-info/PKG-INFO
      writing dependency_links to uamqp.egg-info/dependency_links.txt
      writing requirements to uamqp.egg-info/requires.txt
      writing top-level names to uamqp.egg-info/top_level.txt
      reading manifest file 'uamqp.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE'
      writing manifest file 'uamqp.egg-info/SOURCES.txt'
      copying uamqp/c_uamqp.c -> build/lib.linux-x86_64-cpython-312/uamqp
      running build_ext
      will build uamqp in build/temp.linux-x86_64-cpython-312/cmake
      Building with generator flags: -G "Unix Makefiles"
      calling cmake /tmp/pip-install-ydmijiki/uamqp_499b15a69f634fdd916e4a78c8a43d01/src/vendor/azure-uamqp-c/ -G "Unix Makefiles" -Duse_openssl:bool=ON -Duse_default_uuid:bool=ON  -Duse_builtin_httpapi:bool=ON  -Dskip_samples:bool=ON -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -DCMAKE_BUILD_TYPE=Release
      CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required):
        Compatibility with CMake < 3.10 will be removed from a future version of
        CMake.
      
        Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
        to tell CMake that the project requires at least <min> but has been updated
        to work with policies introduced by <max> or earlier.
      
      
      CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
      CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
      CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
      -- Configuring incomplete, errors occurred!
      Traceback (most recent call last):
        File "/usr/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-xpesdv7r/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 438, in build_wheel
          return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-xpesdv7r/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 426, in _build
          return self._build_with_temp_dir(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-xpesdv7r/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 407, in _build_with_temp_dir
          self.run_setup()
        File "/tmp/pip-build-env-xpesdv7r/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 522, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-xpesdv7r/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
        File "<string>", line 260, in <module>
        File "/tmp/pip-build-env-xpesdv7r/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 117, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-xpesdv7r/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 186, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-xpesdv7r/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-xpesdv7r/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 1002, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-xpesdv7r/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 999, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-xpesdv7r/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-xpesdv7r/overlay/lib/python3.12/site-packages/setuptools/command/bdist_wheel.py", line 369, in run
          self.run_command("build")
        File "/tmp/pip-build-env-xpesdv7r/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-xpesdv7r/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 999, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-xpesdv7r/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-xpesdv7r/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/build.py", line 140, in run
          self.run_command(cmd_name)
        File "/tmp/pip-build-env-xpesdv7r/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-xpesdv7r/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 999, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-xpesdv7r/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
          cmd_obj.run()
        File "<string>", line 134, in run
        File "<string>", line 183, in build_cmake
        File "/usr/lib/python3.12/subprocess.py", line 415, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command 'cmake /tmp/pip-install-ydmijiki/uamqp_499b15a69f634fdd916e4a78c8a43d01/src/vendor/azure-uamqp-c/ -G "Unix Makefiles" -Duse_openssl:bool=ON -Duse_default_uuid:bool=ON  -Duse_builtin_httpapi:bool=ON  -Dskip_samples:bool=ON -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -DCMAKE_BUILD_TYPE=Release' returned non-zero exit status 1.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for uamqp
Failed to build psutil uamqp
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (psutil, uamqp)
A command failed with status 1: /usr/bin/python3 /tmp/ansible-test-ph9qcd2a-pip.py install --disable-pip-version-check -r tests/integration/requirements.txt -c requirements/constraints.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant