Skip to content

Install the allure-pytest package globally in sonic-mgmt docker#10216

Merged
wangxin merged 1 commit intosonic-net:masterfrom
xwjiang-ms:nightly_fail
Mar 12, 2022
Merged

Install the allure-pytest package globally in sonic-mgmt docker#10216
wangxin merged 1 commit intosonic-net:masterfrom
xwjiang-ms:nightly_fail

Conversation

@xwjiang-ms
Copy link
Contributor

@xwjiang-ms xwjiang-ms commented Mar 11, 2022

Why I did it

This fix is to address issue: sonic-net/sonic-mgmt#5280

In the sonic-mgmt Dockerfile, python package allure-pytest is installed after ENV USER $user.
Consequently the package is installed to path /home/$user/.local and is only available to the $user
account. If we use root account in sonic-mgmt docker container to run tests, any script importing
the allure package will fail with ImportError. We need to install the allure-pytest package to global
directory instead of user local directory.

How I did it

Update the sonic-mgmt Dockerfile to ensure that the allure-pytest package is installed to global directory

How to verify it

  1. Build a new sonic-mgmt docker image based on the changes.
  2. Use sonic-mgmt docker container of the newly built image to run test scripts that depend on the
    allure-pytest package. No ImportError is raised.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

Why I did it
User install position caused the fail on nightly test

How I did it
Change the install position globally

How to verify it
Import allure in docker/ run nightly test
@xwjiang-ms xwjiang-ms requested a review from lguohan as a code owner March 11, 2022 09:50
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

Successfully merging this pull request may close these issues.

2 participants