#13608 closed defect (fixed)
GitHub actions failure on Windows and Ubuntu
| Reported by: | Ryan J Ollos | Owned by: | Jun Omae |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.6 |
| Component: | general | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: |
Adapted functional tests to Selenium 4 and later. |
||
| API Changes: | |||
| Internal Changes: | |||
Description (last modified by )
https://github.com/edgewall/trac/actions/runs/5409015542/jobs/9829868654
D:\a\trac\trac\contrib\make_status.py:13: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
C:\Users\runneradmin\AppData\Local\venv\Lib\site-packages\_distutils_hack\__init__.py:33: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
Package Version
-----------------------------------------------------------------------------------------------
Python : 3.11.4 (tags/v3.11.4:d2340ef, Jun 7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)]
Setuptools : 68.0.0
Pip : 23.1.2
Wheel : not installed
Jinja2 : 3.1.2
multipart : 0.2.4
Babel : 2.9.1
sqlite3 : 2.6.0 (3.42.0)
PySqlite3 : not installed
PyMySQL : 1.4.6
Psycopg2 : 2.9.6 (dt dec pq3 ext lo64)
SVN bindings : 1.14.2 (r1899510)
Mercurial : not installed
Pygments : 2.15.1
Textile : 4.0.2
Pytz : 2023.3
Docutils : 0.20.1
aiosmtpd : 1.4.4.post2
Selenium : 4.10.0
PyTidyLib : 0.3.2 (5.9.14 C:\Users\runneradmin\AppData\Local\venv\Scripts\tidy.dll)
LXML : not installed
coverage : not installed
Variables:
PATH=/mingw64/bin:/usr/bin:/c/Users/runneradmin/bin:/c/Users/runneradmin/AppData/Local/venv/Scripts:/c/Users/runneradmin/AppData/Local/venv/Scripts/Scripts:/c/Users/runneradmin/AppData/Local/subversion-1.14.2/x64/bin:/c/Users/runneradmin/AppData/Local/subversion-1.14.2/x64/python/3.11/bin:/c/Users/runneradmin/AppData/Local/venv/Scripts:/c/Program Files/PowerShell/7:/c/Users/runneradmin/AppData/Roaming/Python/Python311/Scripts:/c/hostedtoolcache/windows/Python/3.11.4/x64/Scripts:/c/hostedtoolcache/windows/Python/3.11.4/x64:/c/Program Files/MongoDB/Server/5.0/bin:/c/aliyun-cli:/c/vcpkg:/c/Program Files (x86)/NSIS:/c/tools/zstd:/c/Program Files/Mercurial:/c/hostedtoolcache/windows/stack/2.11.1/x64:/c/cabal/bin:/c/ghcup/bin:/c/Program Files/dotnet:/c/mysql/bin:/c/Program Files/R/R-4.3.1/bin/x64:/c/SeleniumWebDrivers/GeckoDriver:/c/Program Files (x86)/sbt/bin:/c/Program Files (x86)/GitHub CLI:/bin:/c/Program Files (x86)/pipx_bin:/c/npm/prefix:/c/hostedtoolcache/windows/go/1.20.5/x64/bin:/c/hostedtoolcache/windows/Python/3.9.13/x64/Scripts:/c/hostedtoolcache/windows/Python/3.9.13/x64:/c/hostedtoolcache/windows/Ruby/3.0.6/x64/bin:/c/Program Files/OpenSSL/bin:/c/tools/kotlinc/bin:/c/hostedtoolcache/windows/Java_Temurin-Hotspot_jdk/8.0.372-7/x64/bin:/c/Program Files/ImageMagick-7.1.1-Q16-HDRI:/c/Program Files (x86)/Microsoft SDKs/Azure/CLI2/wbin:/c/ProgramData/kind:/c/Program Files/Microsoft/jdk-11.0.16.101-hotspot/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Windows/System32/OpenSSH:/c/Program Files/dotnet:/c/ProgramData/Chocolatey/bin:/c/Program Files/PowerShell/7:/c/Program Files/Microsoft/Web Platform Installer:/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/170/Tools/Binn:/c/Program Files/Microsoft SQL Server/150/Tools/Binn:/c/Strawberry/c/bin:/c/Strawberry/perl/site/bin:/c/Strawberry/perl/bin:/c/ProgramData/chocolatey/lib/pulumi/tools/Pulumi/bin:/c/Program Files/TortoiseSVN/bin:/c/Program Files/CMake/bin:/c/ProgramData/chocolatey/lib/maven/apache-maven-3.8.7/bin:/c/Program Files/Microsoft Service Fabric/bin/Fabric/Fabric.Code:/c/Program Files/Microsoft SDKs/Service Fabric/Tools/ServiceFabricLocalClusterManager:/c/Program Files/nodejs:/cmd:/mingw64/bin:/usr/bin:/c/Program Files/GitHub CLI:/c/tools/php:/c/Program Files (x86)/sbt/bin:/c/SeleniumWebDrivers/ChromeDriver:/c/SeleniumWebDrivers/EdgeDriver:/c/Program Files/Amazon/AWSCLIV2:/c/Program Files/Amazon/SessionManagerPlugin/bin:/c/Program Files/Amazon/AWSSAMCLI/bin:/c/Program Files/Microsoft SQL Server/130/Tools/Binn:/c/Program Files/LLVM/bin:/c/Users/runneradmin/.dotnet/tools:/c/Users/runneradmin/.cargo/bin:/c/Users/runneradmin/AppData/Local/Microsoft/WindowsApps
PYTHONPATH=.;C:\Users\runneradmin\AppData\Local\subversion-1.14.2\x64\python\3.11\lib;
TRAC_TEST_DB_URI=
server-options= -p 8000 -r -e
D:\a\trac\trac\trac\__init__.py:14: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import DistributionNotFound, get_distribution
External dependencies:
Git version: git version 2.41.0.windows.1
Subversion version: 1.14.2
python setup.py egg_info
C:\Users\runneradmin\AppData\Local\venv\Lib\site-packages\babel\messages\catalog.py:15: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
from cgi import parse_header
C:\Users\runneradmin\AppData\Local\venv\Lib\site-packages\setuptools\__init__.py:84: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!
********************************************************************************
Requirements should be satisfied by a PEP 517 installer.
If you are using pip, you can try `pip install --use-pep517`.
********************************************************************************
!!
dist.fetch_build_eggs(dist.setup_requires)
WARNING: The wheel package is not available.
running egg_info
D:\a\trac\trac\trac\__init__.py:14: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import DistributionNotFound, get_distribution
writing Trac.egg-info\PKG-INFO
writing dependency_links to Trac.egg-info\dependency_links.txt
writing entry points to Trac.egg-info\entry_points.txt
writing requirements to Trac.egg-info\requires.txt
writing top-level names to Trac.egg-info\top_level.txt
reading manifest file 'Trac.egg-info\SOURCES.txt'
adding license file 'COPYING'
adding license file 'AUTHORS'
writing manifest file 'Trac.egg-info\SOURCES.txt'
python -m unittest -v trac.tests.functional.test_suite
D:\a\trac\trac\trac\__init__.py:14: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import DistributionNotFound, get_distribution
C:\Users\runneradmin\AppData\Local\venv\Lib\site-packages\passlib\context.py:2251: DeprecationWarning: CryptContext.hash(): 'scheme' keyword is deprecated as of Passlib 1.7, and will be removed in Passlib 2.0
warn("CryptContext.hash(): 'scheme' keyword is deprecated as of "
D:\a\trac\trac\trac\__init__.py:14: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import DistributionNotFound, get_distribution
C:\Users\runneradmin\AppData\Local\venv\Lib\site-packages\passlib\context.py:2251: DeprecationWarning: CryptContext.hash(): 'scheme' keyword is deprecated as of Passlib 1.7, and will be removed in Passlib 2.0
warn("CryptContext.hash(): 'scheme' keyword is deprecated as of "
D:\a\trac\trac\trac\__init__.py:14: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import DistributionNotFound, get_distribution
C:\Users\runneradmin\AppData\Local\venv\Lib\site-packages\passlib\context.py:2251: DeprecationWarning: CryptContext.hash(): 'scheme' keyword is deprecated as of Passlib 1.7, and will be removed in Passlib 2.0
warn("CryptContext.hash(): 'scheme' keyword is deprecated as of "
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\hostedtoolcache\windows\Python\3.11.4\x64\Lib\unittest\__main__.py", line 18, in <module>
main(module=None)
File "C:\hostedtoolcache\windows\Python\3.11.4\x64\Lib\unittest\main.py", line 102, in __init__
self.runTests()
File "C:\hostedtoolcache\windows\Python\3.11.4\x64\Lib\unittest\main.py", line 274, in runTests
self.result = testRunner.run(self.test)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\hostedtoolcache\windows\Python\3.11.4\x64\Lib\unittest\runner.py", line 217, in run
test(result)
File "C:\hostedtoolcache\windows\Python\3.11.4\x64\Lib\unittest\suite.py", line 84, in __call__
return self.run(*args, **kwds)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\hostedtoolcache\windows\Python\3.11.4\x64\Lib\unittest\suite.py", line 122, in run
test(result)
File "C:\hostedtoolcache\windows\Python\3.11.4\x64\Lib\unittest\suite.py", line 84, in __call__
return self.run(*args, **kwds)
^^^^^^^^^^^^^^^^^^^^^^^
File "D:\a\trac\trac\trac\test.py", line 265, in run
self.setUp()
File "D:\a\trac\trac\trac\tests\functional\__init__.py", line 150, in setUp
tc.init(port, server_port)
File "D:\a\trac\trac\trac\tests\functional\better_twill.py", line 101, in init
self.driver = self._create_webdriver()
^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\a\trac\trac\trac\tests\functional\better_twill.py", line 145, in _create_webdriver
return webdriver.Firefox(options=options,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: WebDriver.__init__() got an unexpected keyword argument 'service_log_path'
sys:1: ResourceWarning: unclosed file <_io.FileIO name='D:\\a\\trac\\trac\\testenv\\testing.log' mode='wb' closefd=True>
mingw32-make: *** [makefile:480: functional-test] Error 1
WARNING: 'make.exe functional-test testopts=-v' exited with 2
Error: Process completed with exit code 1.
Attachments (0)
Change History (7)
comment:1 by , 2 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 2 years ago
| Summary: | GitHub actions failure on Windows → GitHub actions failure on Windows and Ubuntu |
|---|
comment:4 by , 2 years ago
Proposed changes are here, however geckodriver.log is empty even after running tests with Selenium 4.10.0. The logging works with Selenium 4.9.1. Something wrong is introduce in Selenium 4.10.0. So that I think we should use selenium!=4.10.0 (or selenium<4.10.0).
-
trac/tests/functional/better_twill.py
diff --git a/trac/tests/functional/better_twill.py b/trac/tests/functional/better_twill.py index f085c5db0..195bb7cc1 100755
a b if selenium: 137 137 options.log.level = 'info' 138 138 log_path = 'geckodriver.log' 139 139 open(log_path, 'wb').close() 140 service = webdriver.firefox.service.Service(log_path=log_path) 140 141 141 142 n = 1 142 143 startts = time.time() 143 144 while time.time() - startts < 60: 144 145 try: 145 return webdriver.Firefox(options=options, 146 service_log_path=log_path) 146 return webdriver.Firefox(options=options, service=service) 147 147 except TimeoutException: 148 148 if n >= 20: 149 149 raise
The following warning is shown on running tests. It means that selenium opens geckodriver.log file but the file is not used.
trac/tests/functional/better_twill.py:140: ResourceWarning: unclosed file <_io.TextIOWrapper name='geckodriver.log' mode='a+' encoding='utf-8'> service = webdriver.firefox.service.Service(log_path=log_path) ResourceWarning: Enable tracemalloc to get the object allocation traceback
We could avoid using Selenium 4.10.0.
-
.github/requirements-minimum.txt
diff --git a/.github/requirements-minimum.txt b/.github/requirements-minimum.txt index 3afbbe7c6..00c3c4cd1 100644
a b 1 1 Jinja2 2 2 multipart; python_version>='3.11' 3 3 aiosmtpd; python_version>='3.10' 4 selenium 4 selenium!=4.10.0 5 5 pytidylib 6 6 passlib; python_version>='3.11' or python_version<'3.7' or platform_system=='Darwin' or platform_system=='Windows' 7 7 bcrypt; python_version>='3.11' or python_version<'3.7' or platform_system=='Darwin' or platform_system=='Windows' -
.github/requirements.txt
diff --git a/.github/requirements.txt b/.github/requirements.txt index 14a1b8fe4..012369abb 100644
a b 1 1 Jinja2 2 2 multipart; python_version>='3.11' 3 3 aiosmtpd; python_version>='3.10' 4 selenium 4 selenium!=4.10.0 5 5 pytidylib 6 6 Babel<2.10 7 7 Pygments
comment:6 by , 2 years ago
| Release Notes: | modified (diff) |
|---|---|
| Resolution: | → fixed |
| Status: | new → closed |
Thanks for the reviewing. Applied the changes in [17714].
The issue in Selenium 4.10.0 was fixed in latest of Selenium repository, however the log_path argument of webdriver.firefox.service.Service() was deprecated….
trac/tests/functional/better_twill.py:140: DeprecationWarning: log_path has been deprecated, please use log_output service = webdriver.firefox.service.Service(log_path=log_path)
I'll try to avoid the deprecation warning after new Selenium release.
comment:7 by , 2 years ago
| Owner: | set to |
|---|



Removed the
service_log_pathargument in Selenium 4.10.0, https://github.com/SeleniumHQ/selenium/commit/9f5801c82fb3be3d5850707c46c3f8176e3ccd8e.Deprecated the argument in Selenium 4.0.0, https://github.com/SeleniumHQ/selenium/commit/0f13ed31d92cfdafcbfacc8b6d25eec0a0c2711b.