Welcome to the Linux Foundation Forum!

Lesson 8 labs: Can't run tests inside dinamically provisioned agent

Posts: 1
edited September 2020 in LFD254 Class Forum

Seems like the labs are out of date, I get this error when trying to run the tests for the RSVP app in the container Jenkins agents

  1. + virtualenv rsvpapp --system-site-packages -v
  2. Traceback (most recent call last):
  3. File "/usr/local/bin/virtualenv", line 7, in <module>
  4. from virtualenv.__main__ import run_with_catch
  5. File "/usr/local/lib/python2.7/dist-packages/virtualenv/__init__.py", line 3, in <module>
  6. from .run import cli_run, session_via_cli
  7. File "/usr/local/lib/python2.7/dist-packages/virtualenv/run/__init__.py", line 11, in <module>
  8. from .plugin.activators import ActivationSelector
  9. File "/usr/local/lib/python2.7/dist-packages/virtualenv/run/plugin/activators.py", line 6, in <module>
  10. from .base import ComponentBuilder
  11. File "/usr/local/lib/python2.7/dist-packages/virtualenv/run/plugin/base.py", line 9, in <module>
  12. from importlib_metadata import entry_points
  13. File "/usr/local/lib/python2.7/dist-packages/importlib_metadata/__init__.py", line 9, in <module>
  14. import zipp
  15. ImportError: No module named zipp
  16. Build step 'Execute shell' marked buld as failure
  17.  
  18. Finished: FAILURE

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Comments

  • Posts: 2,434

    Hi @mtuli0,

    Thank you for your feedback. The lab exercise and repository will be corrected as needed in a future course update release.

    Regards,
    -Chris

  • Posts: 8
    edited December 2020

    @mtuli0 I encountered the same problem. After some debugging it turns out that the pip should be upgraded and after that the virtualenv should be installed.

    Update the shell script as:

    pip install --upgrade pip #additional line
    pip install virtualenv #additional line
    virtualenv rsvpapp --system-site-packages -v
    source rsvpapp/bin/activate
    pip install -r requirements.txt
    pytest tests/test_rsvpapp.py
    >

    Alternatively this could be done in the Dockerfile at 8.1 at section:

    >
    RUN apt-get install -y python-pip
    RUN pip install --upgrade pip #additional line
    RUN pip install virtualenv
    >

    In this case the two additional lines in the shell script won't be needed.

  • Hi @mtuli0
    I encountered the same problem and after some debugging found that pip must be updated before installing virtualenv

    This can be done in two different ways:
    In the shell script:
    pip install --upgrade pip ## additional line
    pip install virtualenv ## additional line
    virtualenv rsvpapp --system-site-packages -v
    source rsvpapp/bin/activate
    pip install -r requirements.txt
    pytest tests/test_rsvpapp.py

    In the Dockerfile in the 8.1 section:
    '#Install python related package
    RUN apt-get install -y python-pip
    RUN pip install --upgrade pip ## additional line
    RUN pip install virtualenv

  • Thank you for your input @GeorgiYadkov. The additional steps will be included in a future course update release to reflect the updated installation process.

    Regards ,
    -Chris

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training