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

Unable to run sanity tests #342

Open
ocafebabe opened this issue Nov 25, 2021 · 2 comments
Open

Unable to run sanity tests #342

ocafebabe opened this issue Nov 25, 2021 · 2 comments

Comments

@ocafebabe
Copy link
Contributor

/kind bug

Description

It's still unclear to me if I'm doing something wrong but I'm unable to launch the sanity tests using ansible-test.

Steps to reproduce the issue:

  1. podman pull continuumio/miniconda3
  2. podman run -it --rm continuumio/miniconda3 /bin/bash
  3. pip install ansible-test
  4. git clone https://github.com/containers/ansible-podman-collections.git
  5. cd ansible-podman-collections
  6. ansible-test sanity

Describe the results you received:

Traceback (most recent call last):
  File "/opt/conda/bin/ansible-test", line 69, in <module>
    main(context)
  File "/opt/conda/bin/ansible-test", line 38, in main
    generate_dockerfile(context)
  File "/opt/conda/bin/ansible-test", line 16, in generate_dockerfile
    rendered_dockerfile_contents = Template(
  File "/opt/conda/lib/python3.9/site-packages/jinja2/environment.py", line 1195, in __new__
    return env.from_string(source, template_class=cls)
  File "/opt/conda/lib/python3.9/site-packages/jinja2/environment.py", line 1092, in from_string
    return cls.from_code(self, self.compile(source), gs, None)
  File "/opt/conda/lib/python3.9/site-packages/jinja2/environment.py", line 750, in compile
    source = self._generate(source, name, filename, defer_init=defer_init)
  File "/opt/conda/lib/python3.9/site-packages/jinja2/environment.py", line 678, in _generate
    return generate(  # type: ignore
  File "/opt/conda/lib/python3.9/site-packages/jinja2/compiler.py", line 112, in generate
    raise TypeError("Can't compile non template nodes")
TypeError: Can't compile non template nodes

Describe the results you expected:

No template error

@sshnaidm
Copy link
Member

You can look in CI code: https://github.com/sshnaidm/ansible-podman-collections/blob/master/.github/workflows/collection-continuous-integration.yml#L97-L105

To run it you need firstly to install collection somewhere, then go to this directory and run ansible-test there.

ansible-test sanity  --color --requirements --python python3 -vvv plugins/ tests/

@ocafebabe
Copy link
Contributor Author

The collection has already been installed (as shown in step 4 of my test), so that's not the issue here...

I think that the origin of the error is coming from the ansible-test version: on Ubuntu 20.04, this module isn't provided by the official ansible package so I need to install it using pip which clearly shows that this package is yanked:

pip install ansible-test
Collecting ansible-test
  Downloading ansible-test-1.0.1.tar.gz (3.0 kB)
Requirement already satisfied: Jinja2 in /usr/lib/python3.9/site-packages (from ansible-test) (2.11.3)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/lib64/python3.9/site-packages (from Jinja2->ansible-test) (1.1.1)
WARNING: The candidate selected for download or install is a yanked version: 'ansible-test' candidate (version 1.0.1 at https://files.pythonhosted.org/packages/f7/9c/ac9735c9590bb8279c6d66d1f76b43382b813939e87407e225eeebc5c534/ansible-test-1.0.1.tar.gz#sha256=337398f40306b412e055e27466a2dcadeb99ce0a6845c650c28deb9e3fad206e (from https://pypi.org/simple/ansible-test/))
Reason for being yanked: This was another project created by a different author long ago. Now, it'll have an official `ansible-test` from `ansible-core`.

I also looked at the CI code and it seems that you're not using the official ansible package, but instead you install the whole ansible distribution using pip: https://github.com/sshnaidm/ansible-podman-collections/blob/8829be323168d49e9283377db50bee3df647df45/.github/workflows/collection-continuous-integration.yml#L86

IMHO if this is a requirement, then it should be documented as such in the README.

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

2 participants