Page MenuHomePhabricator

Pin test dependencies in perf-team Python projects
Closed, ResolvedPublic

Description

Follow-up from https://gerrit.wikimedia.org/r/#/c/performance/navtiming/+/478577:

A new warning was introduced in flake8 and because we don't specify a version, it caused master to break without a change. We should pin dependencies so that upgrades are explicit, and tests are deterministic and identical between local development and Jenkins.

Repositories to check:

  • performance/navtiming
  • performance/coal
  • performance/arc-lamp

Event Timeline

Given that we mix and match using pip to manage python deps (which is good!), and using puppet to install them (which is bad!), I'd suggest using a VERY light hand with this.

Change 478998 had a related patch set uploaded (by Imarlier; owner: Imarlier):
[performance/navtiming@master] navtiming: pin flake8 dep for tests

https://gerrit.wikimedia.org/r/478998

Verified that tox.ini pinning works, by changing and then running locally:

(navtiming) imarlier@WMF2024 ~/dev/src/navtiming (test-dep)$ tox
GLOB sdist-make: /Users/imarlier/dev/src/navtiming/setup.py
flake8 recreate: /Users/imarlier/dev/src/navtiming/.tox/flake8
flake8 installdeps: flake8==3.6.0
flake8 inst: /Users/imarlier/dev/src/navtiming/.tox/dist/navtiming-1.0.zip
flake8 installed: configparser==3.5.0,dnspython==1.16.0,enum34==1.1.6,flake8==3.6.0,kafka-python==1.4.4,mccabe==0.6.1,navtiming==1.0,pycodestyle==2.4.0,pyflakes==2.0.0,python-etcd==0.4.5,PyYAML==3.13,urllib3==1.24.1
flake8 runtests: PYTHONHASHSEED='2676038953'
flake8 runtests: commands[0] | flake8
flake8-py3 recreate: /Users/imarlier/dev/src/navtiming/.tox/flake8-py3
flake8-py3 installdeps: flake8==3.6.0
flake8-py3 inst: /Users/imarlier/dev/src/navtiming/.tox/dist/navtiming-1.0.zip
flake8-py3 installed: dnspython==1.16.0,flake8==3.6.0,kafka-python==1.4.4,mccabe==0.6.1,navtiming==1.0,pycodestyle==2.4.0,pyflakes==2.0.0,python-etcd==0.4.5,PyYAML==3.13,urllib3==1.24.1
flake8-py3 runtests: PYTHONHASHSEED='2676038953'
flake8-py3 runtests: commands[0] | flake8
py27 inst-nodeps: /Users/imarlier/dev/src/navtiming/.tox/dist/navtiming-1.0.zip
py27 installed: You are using pip version 10.0.1, however version 18.1 is available.,You should consider upgrading via the 'pip install --upgrade pip' command.,dnspython==1.15.0,kafka-python==1.4.3,navtiming==1.0,python-etcd==0.4.5,PyYAML==3.12,urllib3==1.23
py27 runtests: PYTHONHASHSEED='2676038953'
py27 runtests: commands[0] | python navtiming_test.py
test_handlers (__main__.TestNavTiming) ... ok
test_is_compliant (__main__.TestNavTiming) ... 2018-12-11 17:25:49,708 [INFO] (is_compliant:453) Discarding event because fetchStart is out of order [None]
2018-12-11 17:25:49,708 [INFO] (is_compliant:453) Discarding event because fetchStart is out of order [None]
ok
test_parse_ua (__main__.TestNavTiming) ... ok

----------------------------------------------------------------------
Ran 3 tests in 0.449s

OK
py33 inst-nodeps: /Users/imarlier/dev/src/navtiming/.tox/dist/navtiming-1.0.zip
py33 installed: You are using pip version 10.0.1, however version 18.1 is available.,You should consider upgrading via the 'pip install --upgrade pip' command.,dnspython==1.15.0,kafka-python==1.4.2,navtiming==1.0,python-etcd==0.4.5,PyYAML==3.12,urllib3==1.22
py33 runtests: PYTHONHASHSEED='2676038953'
py33 runtests: commands[0] | python navtiming_test.py
test_handlers (__main__.TestNavTiming) ... ok
test_is_compliant (__main__.TestNavTiming) ... 2018-12-11 17:25:53,508 [INFO] (is_compliant:453) Discarding event because fetchStart is out of order [None]
2018-12-11 17:25:53,508 [INFO] (is_compliant:453) Discarding event because fetchStart is out of order [None]
ok
test_parse_ua (__main__.TestNavTiming) ... ok

----------------------------------------------------------------------
Ran 3 tests in 0.372s

OK
py34 create: /Users/imarlier/dev/src/navtiming/.tox/py34
SKIPPED:InterpreterNotFound: python3.4
py35 create: /Users/imarlier/dev/src/navtiming/.tox/py35
SKIPPED:InterpreterNotFound: python3.5
py36 inst-nodeps: /Users/imarlier/dev/src/navtiming/.tox/dist/navtiming-1.0.zip
py36 installed: You are using pip version 10.0.1, however version 18.1 is available.,You should consider upgrading via the 'pip install --upgrade pip' command.,dnspython==1.15.0,kafka-python==1.4.2,navtiming==1.0,python-etcd==0.4.5,PyYAML==3.12,urllib3==1.22
py36 runtests: PYTHONHASHSEED='2676038953'
py36 runtests: commands[0] | python navtiming_test.py
test_handlers (__main__.TestNavTiming) ... ok
test_is_compliant (__main__.TestNavTiming) ... 2018-12-11 17:25:56,903 [INFO] (is_compliant:453) Discarding event because fetchStart is out of order [None]
2018-12-11 17:25:56,903 [INFO] (is_compliant:453) Discarding event because fetchStart is out of order [None]
ok
test_parse_ua (__main__.TestNavTiming) ... ok

----------------------------------------------------------------------
Ran 3 tests in 0.362s

OK
____________________________________________________________________________________________________________________________________________________________ summary ____________________________________________________________________________________________________________________________________________________________
  flake8: commands succeeded
  flake8-py3: commands succeeded
  py27: commands succeeded
  py33: commands succeeded
SKIPPED:  py34: InterpreterNotFound: python3.4
SKIPPED:  py35: InterpreterNotFound: python3.5
  py36: commands succeeded
  congratulations :)
(navtiming) imarlier@WMF2024 ~/dev/src/navtiming (test-dep●)$

Change 479005 had a related patch set uploaded (by Imarlier; owner: Imarlier):
[performance/coal@master] coal: Pin flake8 dep

https://gerrit.wikimedia.org/r/479005

@Krinkle Opened CR's for coal and navtiming. arc-lamp is missing most of the scaffolding for a python package (tox.ini, setup.py, etc), so rather than add that as part of this ticket, I'd suggest that the tox.ini file be created with a pinned version whenever that happens.

Change 479005 merged by jenkins-bot:
[performance/coal@master] coal: Pin flake8 dep

https://gerrit.wikimedia.org/r/479005

Change 478998 merged by jenkins-bot:
[performance/navtiming@master] navtiming: pin flake8 dep for tests

https://gerrit.wikimedia.org/r/478998

Krinkle assigned this task to Imarlier.
Krinkle removed a project: Patch-For-Review.

Awesome. Thanks :)

I've also updated my WIP at https://gerrit.wikimedia.org/r/#/c/performance/arc-lamp/+/447555/, but no need to focus on that until we pick that up for T200108 and swift storing etc.