|
| 1 | +import pytest |
| 2 | +from docker import APIClient |
| 3 | + |
| 4 | +from .utils import run_command_in_container |
| 5 | + |
| 6 | + |
| 7 | +@pytest.mark.image_master |
| 8 | +@pytest.mark.parametrize( |
| 9 | + 'command,expected_output', |
| 10 | + [ |
| 11 | + # python |
| 12 | + ('python2 --version', 'Python 2.7.18'), |
| 13 | + ('python3.5 --version', 'Python 3.5.10'), |
| 14 | + ('python3.6 --version', 'Python 3.6.12'), |
| 15 | + ('python3.7 --version', 'Python 3.7.9'), |
| 16 | + ('python3.8 --version', 'Python 3.8.6'), |
| 17 | + ('pypy3.5 --version', 'Python 3.5.3 (928a4f70d3de7d17449456946154c5da6e600162, Feb 09 2019, 11:50:43)\n[PyPy 7.0.0 with GCC 8.2.0]'), |
| 18 | + # pip |
| 19 | + ('python2 -m pip --version', "pip 20.0.1 from /home/docs/.pyenv/versions/2.7.18/lib/python2.7/site-packages/pip (python 2.7)"), |
| 20 | + ('python3.5 -m pip --version', "pip 20.0.1 from /home/docs/.pyenv/versions/3.5.10/lib/python3.5/site-packages/pip (python 3.5)"), |
| 21 | + ('python3.6 -m pip --version', "pip 20.0.1 from /home/docs/.pyenv/versions/3.6.12/lib/python3.6/site-packages/pip (python 3.6)"), |
| 22 | + ('python3.7 -m pip --version', "pip 20.0.1 from /home/docs/.pyenv/versions/3.7.9/lib/python3.7/site-packages/pip (python 3.7)"), |
| 23 | + ('python3.8 -m pip --version', "pip 20.0.1 from /home/docs/.pyenv/versions/3.8.6/lib/python3.8/site-packages/pip (python 3.8)"), |
| 24 | + # setuptools |
| 25 | + ('python2 -c "import setuptools; print(setuptools.__version__)"', "44.0.0"), |
| 26 | + ('python3.5 -c "import setuptools; print(setuptools.__version__)"', "45.1.0"), |
| 27 | + ('python3.6 -c "import setuptools; print(setuptools.__version__)"', "45.1.0"), |
| 28 | + ('python3.7 -c "import setuptools; print(setuptools.__version__)"', "45.1.0"), |
| 29 | + ('python3.8 -c "import setuptools; print(setuptools.__version__)"', "45.1.0"), |
| 30 | + # virtualenv |
| 31 | + ('python2 -m virtualenv --version', '16.7.9'), |
| 32 | + ('python3.5 -m virtualenv --version', '16.7.9'), |
| 33 | + ('python3.6 -m virtualenv --version', '16.7.9'), |
| 34 | + ('python3.7 -m virtualenv --version', '16.7.9'), |
| 35 | + ('python3.8 -m virtualenv --version', '16.7.9'), |
| 36 | + # others |
| 37 | + ('node --version', 'v10.19.0'), |
| 38 | + ('npm --version', '6.14.4'), |
| 39 | + ('conda --version', 'conda 4.6.14'), |
| 40 | + ('cargo --version', 'cargo 1.46.0 (149022b1d 2020-07-17)'), |
| 41 | + ('git --version', 'git version 2.25.1'), |
| 42 | + ] |
| 43 | +) |
| 44 | +def test_command_versions_image_master(command, expected_output): |
| 45 | + cmd_output = run_command_in_container('readthedocs/build:master', command) |
| 46 | + assert cmd_output == expected_output |
| 47 | + |
| 48 | + |
| 49 | +@pytest.mark.image_70 |
| 50 | +@pytest.mark.parametrize( |
| 51 | + 'command,expected_output', |
| 52 | + [ |
| 53 | + # python |
| 54 | + ('python2 --version', 'Python 2.7.18'), |
| 55 | + ('python3.5 --version', 'Python 3.5.10'), |
| 56 | + ('python3.6 --version', 'Python 3.6.12'), |
| 57 | + ('python3.7 --version', 'Python 3.7.9'), |
| 58 | + ('python3.8 --version', 'Python 3.8.6'), |
| 59 | + ('pypy3.5 --version', 'Python 3.5.3 (928a4f70d3de7d17449456946154c5da6e600162, Feb 09 2019, 11:50:43)\n[PyPy 7.0.0 with GCC 8.2.0]'), |
| 60 | + # pip |
| 61 | + ('python2 -m pip --version', "pip 20.0.2 from /home/docs/.pyenv/versions/2.7.18/lib/python2.7/site-packages/pip (python 2.7)"), |
| 62 | + ('python3.5 -m pip --version', "pip 20.0.2 from /home/docs/.pyenv/versions/3.5.10/lib/python3.5/site-packages/pip (python 3.5)"), |
| 63 | + ('python3.6 -m pip --version', "pip 20.0.2 from /home/docs/.pyenv/versions/3.6.12/lib/python3.6/site-packages/pip (python 3.6)"), |
| 64 | + ('python3.7 -m pip --version', "pip 20.0.2 from /home/docs/.pyenv/versions/3.7.9/lib/python3.7/site-packages/pip (python 3.7)"), |
| 65 | + ('python3.8 -m pip --version', "pip 20.0.2 from /home/docs/.pyenv/versions/3.8.6/lib/python3.8/site-packages/pip (python 3.8)"), |
| 66 | + # setuptools |
| 67 | + ('python2 -c "import setuptools; print(setuptools.__version__)"', "44.0.0"), |
| 68 | + ('python3.5 -c "import setuptools; print(setuptools.__version__)"', "45.2.0"), |
| 69 | + ('python3.6 -c "import setuptools; print(setuptools.__version__)"', "45.2.0"), |
| 70 | + ('python3.7 -c "import setuptools; print(setuptools.__version__)"', "45.2.0"), |
| 71 | + ('python3.8 -c "import setuptools; print(setuptools.__version__)"', "45.2.0"), |
| 72 | + # virtualenv |
| 73 | + ('python2 -m virtualenv --version', 'virtualenv 20.0.7 from /home/docs/.pyenv/versions/2.7.18/lib/python2.7/site-packages/virtualenv/__init__.pyc'), |
| 74 | + ('python3.5 -m virtualenv --version', 'virtualenv 20.0.7 from /home/docs/.pyenv/versions/3.5.10/lib/python3.5/site-packages/virtualenv/__init__.pyc'), |
| 75 | + ('python3.6 -m virtualenv --version', 'virtualenv 20.0.7 from /home/docs/.pyenv/versions/3.6.12/lib/python3.6/site-packages/virtualenv/__init__.pyc'), |
| 76 | + ('python3.7 -m virtualenv --version', 'virtualenv 20.0.7 from /home/docs/.pyenv/versions/3.7.9/lib/python3.7/site-packages/virtualenv/__init__.pyc'), |
| 77 | + ('python3.8 -m virtualenv --version', 'virtualenv 20.0.7 from /home/docs/.pyenv/versions/3.8.6/lib/python3.8/site-packages/virtualenv/__init__.pyc'), |
| 78 | + # others |
| 79 | + ('node --version', 'v8.10.0'), |
| 80 | + ('npm --version', '3.5.2'), |
| 81 | + ('conda --version', 'conda 4.6.14'), |
| 82 | + ('cargo --version', 'cargo 1.46.0 (149022b1d 2020-07-17)'), |
| 83 | + ('git --version', 'git version 2.17.1'), |
| 84 | + ] |
| 85 | +) |
| 86 | +def test_command_versions_image_70(command, expected_output): |
| 87 | + cmd_output = run_command_in_container('readthedocs/build:7.0', command) |
| 88 | + assert cmd_output == expected_output |
| 89 | + |
| 90 | + |
| 91 | +@pytest.mark.image_60 |
| 92 | +@pytest.mark.parametrize( |
| 93 | + 'command,expected_output', |
| 94 | + [ |
| 95 | + # python |
| 96 | + ('python2 --version', 'Python 2.7.18'), |
| 97 | + ('python3.5 --version', 'Python 3.5.10'), |
| 98 | + ('python3.6 --version', 'Python 3.6.12'), |
| 99 | + ('python3.7 --version', 'Python 3.7.9'), |
| 100 | + ('python3.8 --version', 'Python 3.8.6'), |
| 101 | + ('pypy3.5 --version', 'Python 3.5.3 (928a4f70d3de7d17449456946154c5da6e600162, Feb 09 2019, 11:50:43)\n[PyPy 7.0.0 with GCC 8.2.0]'), |
| 102 | + # pip |
| 103 | + ('python2 -m pip --version', "pip 20.0.1 from /home/docs/.pyenv/versions/2.7.18/lib/python2.7/site-packages/pip (python 2.7)"), |
| 104 | + ('python3.5 -m pip --version', "pip 20.0.1 from /home/docs/.pyenv/versions/3.5.10/lib/python3.5/site-packages/pip (python 3.5)"), |
| 105 | + ('python3.6 -m pip --version', "pip 20.0.1 from /home/docs/.pyenv/versions/3.6.12/lib/python3.6/site-packages/pip (python 3.6)"), |
| 106 | + ('python3.7 -m pip --version', "pip 20.0.1 from /home/docs/.pyenv/versions/3.7.9/lib/python3.7/site-packages/pip (python 3.7)"), |
| 107 | + ('python3.8 -m pip --version', "pip 20.0.1 from /home/docs/.pyenv/versions/3.8.6/lib/python3.8/site-packages/pip (python 3.8)"), |
| 108 | + # setuptools |
| 109 | + ('python2 -c "import setuptools; print(setuptools.__version__)"', "44.0.0"), |
| 110 | + ('python3.5 -c "import setuptools; print(setuptools.__version__)"', "45.1.0"), |
| 111 | + ('python3.6 -c "import setuptools; print(setuptools.__version__)"', "45.1.0"), |
| 112 | + ('python3.7 -c "import setuptools; print(setuptools.__version__)"', "45.1.0"), |
| 113 | + ('python3.8 -c "import setuptools; print(setuptools.__version__)"', "45.1.0"), |
| 114 | + # virtualenv |
| 115 | + ('python2 -m virtualenv --version', '16.7.9'), |
| 116 | + ('python3.5 -m virtualenv --version', '16.7.9'), |
| 117 | + ('python3.6 -m virtualenv --version', '16.7.9'), |
| 118 | + ('python3.7 -m virtualenv --version', '16.7.9'), |
| 119 | + ('python3.8 -m virtualenv --version', '16.7.9'), |
| 120 | + # others |
| 121 | + ('node --version', 'v8.10.0'), |
| 122 | + ('npm --version', '3.5.2'), |
| 123 | + ('conda --version', 'conda 4.6.14'), |
| 124 | + ('git --version', 'git version 2.17.1'), |
| 125 | + ] |
| 126 | +) |
| 127 | +def test_command_versions_image_60(command, expected_output): |
| 128 | + cmd_output = run_command_in_container('readthedocs/build:6.0', command) |
| 129 | + assert cmd_output == expected_output |
| 130 | + |
| 131 | + |
| 132 | +@pytest.mark.image_50 |
| 133 | +@pytest.mark.parametrize( |
| 134 | + 'command,expected_output', |
| 135 | + [ |
| 136 | + # python |
| 137 | + ('python2 --version', 'Python 2.7.18'), |
| 138 | + ('python3.6 --version', 'Python 3.6.12'), |
| 139 | + ('python3.7 --version', 'Python 3.7.9'), |
| 140 | + ('pypy3.5 --version', 'Python 3.5.3 (928a4f70d3de7d17449456946154c5da6e600162, Feb 09 2019, 11:50:43)\n[PyPy 7.0.0 with GCC 8.2.0]'), |
| 141 | + # pip |
| 142 | + ('python2 -m pip --version', "pip 19.1.1 from /home/docs/.pyenv/versions/2.7.18/lib/python2.7/site-packages/pip (python 2.7)"), |
| 143 | + ('python3.6 -m pip --version', "pip 19.1.1 from /home/docs/.pyenv/versions/3.6.12/lib/python3.6/site-packages/pip (python 3.6)"), |
| 144 | + ('python3.7 -m pip --version', "pip 19.1.1 from /home/docs/.pyenv/versions/3.7.9/lib/python3.7/site-packages/pip (python 3.7)"), |
| 145 | + # setuptools |
| 146 | + ('python2 -c "import setuptools; print(setuptools.__version__)"', "41.0.1"), |
| 147 | + ('python3.6 -c "import setuptools; print(setuptools.__version__)"', "41.0.1"), |
| 148 | + ('python3.7 -c "import setuptools; print(setuptools.__version__)"', "41.0.1"), |
| 149 | + # virtualenv |
| 150 | + ('python2 -m virtualenv --version', '16.6.0'), |
| 151 | + ('python3.6 -m virtualenv --version', '16.6.0'), |
| 152 | + ('python3.7 -m virtualenv --version', '16.6.0'), |
| 153 | + # others |
| 154 | + ('node --version', 'v8.10.0'), |
| 155 | + ('npm --version', '3.5.2'), |
| 156 | + ('conda --version', 'conda 4.6.14'), |
| 157 | + ('git --version', 'git version 2.17.1'), |
| 158 | + ] |
| 159 | +) |
| 160 | +def test_command_versions_image_50(command, expected_output): |
| 161 | + cmd_output = run_command_in_container('readthedocs/build:5.0', command) |
| 162 | + assert cmd_output == expected_output |
0 commit comments