Page MenuHomePhabricator

jenkins problem with code coverage calculation in PageTriage
Closed, DuplicatePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • download PageTriage codebase
  • write a patch that adds a unit test to something
  • upload it to gerrit

What happens?:

  • jenkins-bot replies with a comment that "PHP test coverage decreased", then gives a link to something similar to...
Start backends
Hide Details

06:47:14 INFO:quibble.commands:>>> Start: Start backends, <ExternalWebserver http://127.0.0.1:9413 /workspace/src> <Xvfb :94> <ChromeWebDriver :94>
06:47:14 INFO:backend.ExternalWebserver:Not starting a webserver.
06:47:14 INFO:backend.Xvfb:Starting Xvfb on display :94
06:47:14 INFO:backend.ChromeWebDriver:Starting Chromedriver
06:47:14 INFO:quibble.use_headless:Display: :94
06:47:14 DEBUG:quibble.chromium_flags:Flags: ['', '--autoplay-policy=no-user-gesture-required', '--disable-pushstate-throttle', '--no-sandbox']
06:47:14 INFO:quibble.commands:<<< Finish: Start backends, <ExternalWebserver http://127.0.0.1:9413 /workspace/src> <Xvfb :94> <ChromeWebDriver :94>, in 0.015 s
User commands: mwext-phpunit-coverage-patch
Hide Details

06:47:14 INFO:quibble.commands:>>> Start: User commands: mwext-phpunit-coverage-patch
06:47:14 INFO:quibble.commands:User commands, working directory: /workspace/src
06:47:14 INFO:quibble.commands:mwext-phpunit-coverage-patch
06:47:14 ++ basename mediawiki/extensions/PageTriage
06:47:14 WARNING:backend.ChromeWebDriver:[1668869234.314][SEVERE]: bind() failed: Cannot assign requested address (99)
06:47:14 + EXT_NAME=PageTriage
06:47:14 + cd /workspace/src/extensions/PageTriage
06:47:14 + phpunit-suite-edit /workspace/src/tests/phpunit/suite.xml --cover-extension PageTriage
06:47:14 + exec phpunit-patch-coverage check --command 'php -d extension=pcov.so -d pcov.enabled=1 -d pcov.directory=/workspace/src/extensions/PageTriage -d pcov.exclude='\''@(tests|vendor)@'\'' -d pcov.initial.files=3000 "$MW_INSTALL_PATH"/tests/phpunit/phpunit.php' --html /workspace/log/coverage.html
06:47:14 Finding coverage difference in 189a4cf0157402a95e2a09d352166b4aff06ea26
06:47:14 $ 'php -d extension=pcov.so -d pcov.enabled=1 -d pcov.directory=/workspace/src/extensions/PageTriage -d pcov.exclude='\''@(tests|vendor)@'\'' -d pcov.initial.files=3000 "$MW_INSTALL_PATH"/tests/phpunit/phpunit.php' '--coverage-clover /tmp/cloverAZjQdA' '--filter '\''/ApiPageTriageListTest|ApiPageTriageStatsTest|PageTriageUtilTest|PageTriageUtilTest/'\'''
06:47:14 sh: 1: exec: php -d extension=pcov.so -d pcov.enabled=1 -d pcov.directory=/workspace/src/extensions/PageTriage -d pcov.exclude='@(tests|vendor)@' -d pcov.initial.files=3000 "$MW_INSTALL_PATH"/tests/phpunit/phpunit.php: not found
06:47:14 
06:47:14 In CloverXml.php line 69:
06:47:14                                      
06:47:14   String could not be parsed as XML  
06:47:14                                      
06:47:14 
06:47:14 check [--sha1 [SHA1]] [--test-dir TEST-DIR] [--html [HTML]] [--command COMMAND]
06:47:14 
06:47:14 INFO:quibble.commands:<<< Finish: User commands: mwext-phpunit-coverage-patch, in 0.288 s
06:47:14 INFO:backend.ChromeWebDriver:Terminating ChromeWebDriver
06:47:14 INFO:backend.Xvfb:Terminating Xvfb
06:47:14 INFO:backend.MySQL:Terminating MySQL
06:47:16 Traceback (most recent call last):
06:47:16   File "/usr/local/bin/quibble", line 10, in <module>
06:47:16     sys.exit(main())
06:47:16   File "/usr/local/lib/python3.7/dist-packages/quibble/cmd.py", line 803, in main
06:47:16     cmd.execute(plan, dry_run=args.dry_run)
06:47:16   File "/usr/local/lib/python3.7/dist-packages/quibble/cmd.py", line 514, in execute
06:47:16     quibble.commands.execute_command(command)
06:47:16   File "/usr/local/lib/python3.7/dist-packages/quibble/commands.py", line 26, in execute_command
06:47:16     command.execute()
06:47:16   File "/usr/local/lib/python3.7/dist-packages/quibble/commands.py", line 971, in execute
06:47:16     env=userscripts_env,
06:47:16   File "/usr/lib/python3.7/subprocess.py", line 347, in check_call
06:47:16     raise CalledProcessError(retcode, cmd)
06:47:16 subprocess.CalledProcessError: Command 'mwext-phpunit-coverage-patch' returned non-zero exit status 1.
06:47:17 Build step 'Execute shell' marked build as failure
06:47:17 [PostBuildScript] - [INFO] Executing post build scripts.
06:47:17 [mwext-phpunit-coverage-patch-docker] $ /bin/bash /tmp/jenkins14184798316242306387.sh
06:47:17 + set -o pipefail
06:47:17 ++ pwd
06:47:17 + exec docker run --entrypoint=/bin/rm --volume /srv/jenkins/workspace/mwext-phpunit-coverage-patch-docker/log:/log --security-opt seccomp=unconfined --init --rm --label jenkins.job=mwext-phpunit-coverage-patch-docker --label jenkins.build=75369 --env-file /dev/fd/63 docker-registry.wikimedia.org/buster:latest -fR /log/rawSeleniumVideoGrabs
06:47:17 ++ /usr/bin/env
06:47:17 ++ egrep -v '^(HOME|SHELL|PATH|LOGNAME|MAIL)='
06:47:18 [PostBuildScript] - [INFO] Executing post build scripts.
06:47:18 [mwext-phpunit-coverage-patch-docker] $ /bin/bash -xe /tmp/jenkins16474422139849553648.sh
06:47:18 + find log/ -name 'mw-debug-*.log' -exec gzip '{}' +

What should have happened instead?:

  • jenkins gives a message that code coverage increased

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

  • I see it's trying to load up Selenium WebDriver. Is this needed for a coverage test?
  • The actual error message appears to be In CloverXml.php line 69: String could not be parsed as XML