- Issue created by @jonathan1055
- Merge request !22#3531065 PHPUnit matrix on @group, add @dataprovider, show deprecations in Next Minor → (Merged) created by jonathan1055
- 🇬🇧United Kingdom jonathan1055
The first commit splits the phpunit job into three parallel jobs, based on the
@group
All pass green
https://git.drupalcode.org/project/gitlab_templates_downstream/-/pipelin... - 🇬🇧United Kingdom jonathan1055
The second commit diaplays deprecations in the 'next minor' phpunit job. The jobs end amber due to phpunit deprections (some in this module, others in core files)
https://git.drupalcode.org/project/gitlab_templates_downstream/-/pipelin... - 🇬🇧United Kingdom jonathan1055
The third commit adds a
@dataprovider
and we get more deprecations in phpunit 'next minor'
Pipeline https://git.drupalcode.org/project/gitlab_templates_downstream/-/pipelin...Specifcally gtd3 before had
Tests: 1, Assertions: 3, PHPUnit Deprecations: 4
see log
but now hasTests: 2, Assertions: 6, PHPUnit Deprecations: 9.
see log - 🇬🇧United Kingdom jonathan1055
This is ready for review. It's needed to assist testing MR371 on 📌 Introduce PHPUNIT_FAIL_ON_PHPUNIT_DEPRECATION Active
- 🇬🇧United Kingdom jonathan1055
MR results show this problem with each of the phpstan jobs, but they ran OK. I don't really get it.
- 🇪🇸Spain fjgarlin
The MR looks good.
If you browse the artifacts for the
phpstan
, you can see the issue. See this: https://project.pages.drupalcode.org/-/gitlab_templates_downstream/-/job...The contents of the file are:
tests/src/FunctionalJavascript/GitlabTemplatesDownstreamThreeTest.php tests/src/Functional/GitlabTemplatesDownstreamTwoTest.php tests/src/Functional/GitlabTemplatesDownstreamOneTest.php src/form.inc gitlab_templates_downstream.module <?xml version="1.0" encoding="UTF-8"?><testsuite failures="0" name="phpstan" tests="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/junit-team/junit5/r5.5.1/platform-tests/src/test/resources/jenkins-junit.xsd"><testcase name="phpstan"></testcase></testsuite>
If you also see
phpstan-quality-report.json
, the contents are:tests/src/FunctionalJavascript/GitlabTemplatesDownstreamThreeTest.php tests/src/Functional/GitlabTemplatesDownstreamTwoTest.php tests/src/Functional/GitlabTemplatesDownstreamOneTest.php src/form.inc gitlab_templates_downstream.module []
So some output must be getting into the files.
- 🇬🇧United Kingdom jonathan1055
If it is the
--debug
flag then that sounds like a bug upstream? I re-ran without it and the results are different, but not totally clean. The junit.xml file no longer has the file names at the top - https://project.pages.drupalcode.org/-/gitlab_templates_downstream/-/job...
The test summary page is now green, but it still shows xml error
Base report parsing error: JUnit XML parsing failed: 1:1: FATAL: Start tag expected, '<' not found
Previously we had errors for 'Base report' and 'Head report' and I don't know if that is significant. Maybe that error has always been there.So in summary, adding
--debug
does not fail the job, but produces invalid junit.xml for viewing. That's poor! I think for these test jobs maybe we will just add thevariables: _PHPSTAN_EXTRA: --debug
in the job definition when working on PHPstan, and not have it committed permanently. - 🇪🇸Spain fjgarlin
The last run's artifact has a correct file: https://project.pages.drupalcode.org/-/gitlab_templates_downstream/-/job...
I assume that the reporting might aggregate data from other runs and just take the last results.
As for the
--debug
producing wrong formated data, yeah, it might be an upstream issue. When--error-format=junit
is present,--debug
should not change the format of the output, but it does.Maybe, on our end, we can replace
--debug
with empty string on this line:
- php $CI_PROJECT_DIR/vendor/bin/phpstan analyze . --autoload-file="$CI_PROJECT_DIR/vendor/autoload.php" $LEVEL $_PHPSTAN_EXTRA --no-progress --error-format=junit > $CI_PROJECT_DIR/junit.xml || true
. Also, probably in this line too:
- php $CI_PROJECT_DIR/vendor/bin/phpstan analyze . --autoload-file="$CI_PROJECT_DIR/vendor/autoload.php" $LEVEL $_PHPSTAN_EXTRA --no-progress --error-format=gitlab > $CI_PROJECT_DIR/phpstan-quality-report.json || true
That way, even if it's set, it will be ignored for the output file.
This issue looks good, hence the RTBC. But we should create a follow-up for the above case, as we know the reason and we have a potential fix.
-
jonathan1055 →
committed 8e935434 on d10-plus
Issue #3531065 by jonathan1055, fjgarlin: Add coverage for @group and @...
-
jonathan1055 →
committed 8e935434 on d10-plus
- 🇬🇧United Kingdom jonathan1055
That's a great idea! I have opened 📌 Avoid using PHPStan --debug when generating reports Active
Merged MR22. Thanks.