Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Rebuild tox environment after change requirements #149

Merged
merged 1 commit into from
Sep 1, 2020

Conversation

joepvd
Copy link
Contributor

@joepvd joepvd commented Sep 1, 2020

Tox does not detect changes in requirements, and will fail with missing
imports.
example
tox bug

This PR looks at the files that have changed in the last 5 commits, and
if one of the files that might contain requirements have changed, will
add the argument --recreate to the tox invocation.

The magical number 5 was chosen, as it is conceivable that there are
multiple commits locally which contain the change, and the change in
dependencies is not detected.

Alternative approaches are:

  • install a tox plugin
  • always recreate in Jenkins

Tox does not detect changes in requirements, and will fail with missing
imports.
[example](https://saml.buildvm.openshift.eng.bos.redhat.com:8888/job/art-tools/job/elliott/job/master/6/console)
[tox bug](tox-dev/tox#149)

This PR looks at the files that have changed in the last 5 commits, and
if one of the files that might contain requirements have changed, will
add the argument `--recreate` to the `tox` invocation.

The magical number 5 was chosen, as it is conceivable that there are
multiple commits locally which contain the change, and the change in
dependencies is not detected.

Alternative approaches are:
- install a tox plugin
- always recreate in Jenkins
@openshift-bot
Copy link

Build #2

GLOB sdist-make: /mnt/workspace/jenkins/working/art-tools_elliott_PR-149/setup.py
py3 create: /mnt/workspace/jenkins/working/art-tools_elliott_PR-149/.tox/py3
py3 installdeps: -rrequirements-dev.txt
py3 inst: /mnt/workspace/jenkins/working/art-tools_elliott_PR-149/.tox/.tmp/package/1/rh-elliott-1.0.9.zip
py3 installed: appdirs==1.4.4,astroid==2.4.2,attrs==20.1.0,autopep8==1.5.4,bashlex==0.15,cached-property==1.5.1,certifi==2020.6.20,cffi==1.14.2,chardet==3.0.4,click==7.1.2,coverage==5.2.1,cryptography==3.1,decorator==4.4.2,distlib==0.3.1,dockerfile-parse==1.0.0,docutils==0.16,errata-tool==1.21.0,filelock==3.0.12,flake8==3.8.3,flexmock==0.10.4,future==0.18.2,gssapi==1.6.9,idna==2.10,importlib-metadata==1.7.0,importlib-resources==3.0.0,iniconfig==1.0.1,isort==5.4.2,jsonpath-rw==1.4.0,kerberos==1.3.0,koji==1.22.0,lazy-object-proxy==1.4.3,mccabe==0.6.1,mock==4.0.2,more-itertools==8.5.0,packaging==20.4,pluggy==0.13.1,ply==3.11,py==1.9.0,pycodestyle==2.6.0,pycparser==2.20,pyflakes==2.2.0,pygit2==1.2.1,pykerberos==1.2.1,pylint==2.6.0,pyOpenSSL==19.1.0,pyparsing==2.4.7,pytest==6.0.1,python-bugzilla==2.5.0,python-dateutil==2.8.1,PyYAML==5.3.1,requests==2.24.0,requests-gssapi==1.2.2,requests-kerberos==0.12.0,rh-elliott @ file:///mnt/workspace/jenkins/working/art-tools_elliott_PR-149/.tox/.tmp/package/1/rh-elliott-1.0.9.zip,ruamel.yaml==0.16.10,ruamel.yaml.clib==0.2.0,six==1.15.0,toml==0.10.1,tox==3.19.0,typed-ast==1.4.1,typing==3.7.4.3,typing-extensions==3.7.4.3,urllib3==1.25.10,virtualenv==20.0.31,wrapt==1.12.1,zipp==3.1.0
py3 run-test-pre: PYTHONHASHSEED='4069900292'
py3 run-test: commands[0] | flake8
py3 run-test: commands[1] | coverage run --branch --source elliottlib -m unittest discover -t . -s tests/
...............................................................
----------------------------------------------------------------------
Ran 63 tests in 0.089s

OK
py3 run-test: commands[2] | coverage report
Name                                       Stmts   Miss Branch BrPart  Cover
----------------------------------------------------------------------------
elliottlib/__init__.py                         9      4      2      1    55%
elliottlib/assertion.py                       20      4      6      0    85%
elliottlib/brew.py                           155     54     66      4    57%
elliottlib/bzutil.py                         204    100     90      3    51%
elliottlib/cli/__init__.py                     0      0      0      0   100%
elliottlib/cli/__main__.py                   403    403    157      0     0%
elliottlib/cli/add_metadata_cli.py            33     33      4      0     0%
elliottlib/cli/advisory_images_cli.py         14     14      2      0     0%
elliottlib/cli/advisory_impetus_cli.py        22     22      6      0     0%
elliottlib/cli/change_state_cli.py            45     45     14      0     0%
elliottlib/cli/cli_opts.py                    12      0     13      0   100%
elliottlib/cli/common.py                      40     16      6      0    52%
elliottlib/cli/create_cli.py                  89     89     38      0     0%
elliottlib/cli/create_placeholder_cli.py      46     46     10      0     0%
elliottlib/cli/find_builds_cli.py            193    143    113      2    20%
elliottlib/cli/list_cli.py                    17     17      4      0     0%
elliottlib/cli/puddle_advisories_cli.py       37     37     10      0     0%
elliottlib/cli/rpmdiff_cli.py                101    101     34      0     0%
elliottlib/cli/tag_builds_cli.py             128    128     62      0     0%
elliottlib/cli/tarball_sources_cli.py         82     82     26      0     0%
elliottlib/cli/verify_cvp_cli.py             152    152     82      0     0%
elliottlib/constants.py                       39      0      0      0   100%
elliottlib/dotconfig.py                       55     44     32      0    13%
elliottlib/errata.py                         176    100     82      4    38%
elliottlib/exceptions.py                      13      0      0      0   100%
elliottlib/exectools.py                       50      3     18      2    93%
elliottlib/gitdata.py                        165    134     76      0    13%
elliottlib/imagecfg.py                        17      1      0      0    94%
elliottlib/logutil.py                         10      1      2      1    83%
elliottlib/metadata.py                        72     28     20      3    51%
elliottlib/model.py                          103     50     30      4    46%
elliottlib/openshiftclient.py                 42     42      8      0     0%
elliottlib/pushd.py                           21      0      2      0   100%
elliottlib/resultsdb.py                       18     18      4      0     0%
elliottlib/rpmdiff.py                         32      0      0      0   100%
elliottlib/runtime.py                        174    142     68      0    13%
elliottlib/tarball_sources.py                 91     61     34      0    30%
elliottlib/util.py                            79     47      6      0    38%
----------------------------------------------------------------------------
TOTAL                                       2959   2161   1127     24    23%
___________________________________ summary ____________________________________
  py3: commands succeeded
  congratulations :)

@codecov-commenter
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@7024be6). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #149   +/-   ##
=========================================
  Coverage          ?   26.15%           
=========================================
  Files             ?       37           
  Lines             ?     2959           
  Branches          ?      562           
=========================================
  Hits              ?      774           
  Misses            ?     2161           
  Partials          ?       24           
Impacted Files Coverage Δ
elliottlib/cli/tarball_sources_cli.py 0.00% <0.00%> (ø)
elliottlib/cli/advisory_impetus_cli.py 0.00% <0.00%> (ø)
elliottlib/util.py 40.50% <0.00%> (ø)
elliottlib/rpmdiff.py 100.00% <0.00%> (ø)
elliottlib/cli/tag_builds_cli.py 0.00% <0.00%> (ø)
elliottlib/cli/change_state_cli.py 0.00% <0.00%> (ø)
elliottlib/tarball_sources.py 32.96% <0.00%> (ø)
elliottlib/metadata.py 56.94% <0.00%> (ø)
elliottlib/exceptions.py 100.00% <0.00%> (ø)
elliottlib/cli/common.py 60.00% <0.00%> (ø)
... and 27 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7024be6...d642e92. Read the comment docs.

Copy link
Contributor

@thiagoalessio thiagoalessio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@thiagoalessio thiagoalessio merged commit 3cc5439 into openshift-eng:master Sep 1, 2020
@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 1, 2020
@joepvd joepvd deleted the rebuild-tox branch September 1, 2020 11:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants