Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating report not working with output from allure-phpunit (version attibute problem) #8

Closed
OndraM opened this issue Aug 9, 2014 · 3 comments

Comments

@OndraM
Copy link
Contributor

OndraM commented Aug 9, 2014

Hi,
when generating report with allure based on output files from allure-phpunit adapter, allure fails with some XSLT errors. I suspect the allure-phpunit as a cause, because when using files generated from junit example project, the report generating works.

Steps to reproduce:

  1. install allure from https://github.com/allure-framework/allure-cli-zip/releases (I tried both 1.3.9 and 2.0 versions - there is no difference)
  2. clone allure-phpunit-example
  3. run ./vendor/bin/phpunit in allure-phpunit-example to generate output
  4. run allure /tmp/allure-phpunit-example/allure-report-data/
  5. generating fails:
/tmp/allure-phpunit-example $ allure /tmp/allure-phpunit-example/allure-report-data/
Error on line 215 
  XTDE0410: An attribute node (version) cannot be created after the children of the containing element
  at xsl:call-template name="copy-all-without-namespace" (#211)
  at xsl:apply-templates (#27)
     processing /alr:allure-test-run/test-suites[1]/test-suite[1]/@version
  at xsl:apply-templates (#216)
     processing /alr:allure-test-run/test-suites[1]/test-suite[1]
  at xsl:call-template name="copy-all-without-namespace" (#211)
  at xsl:apply-templates (#14)
     processing /alr:allure-test-run/test-suites[1]
  in built-in template rule
Exception in thread "main" java.lang.RuntimeException: ru.yandex.qatools.allure.report.AllureReportBuilderException: java.lang.reflect.InvocationTargetException
        at ru.yandex.qatools.allure.AllureCli.generate(AllureCli.java:119)
        at ru.yandex.qatools.allure.AllureCli.run(AllureCli.java:82)
        at ru.yandex.qatools.allure.AllureCli.main(AllureCli.java:73)
Caused by: ru.yandex.qatools.allure.report.AllureReportBuilderException: java.lang.reflect.InvocationTargetException
        at ru.yandex.qatools.allure.report.AllureReportBuilder.processResults(AllureReportBuilder.java:113)
        at ru.yandex.qatools.allure.AllureCli.generate(AllureCli.java:104)
        ... 2 more
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at ru.yandex.qatools.allure.report.AllureReportBuilder.processResults(AllureReportBuilder.java:111)
        ... 3 more
Caused by: ru.yandex.qatools.allure.data.ReportGenerationException: net.sf.saxon.event.NoOpenStartTagException: An attribute node (version) cannot be created after the children of the containing element
        at ru.yandex.qatools.allure.data.utils.XslTransformationUtils.applyTransformation(XslTransformationUtils.java:55)
        at ru.yandex.qatools.allure.data.utils.XslTransformationUtils.applyTransformation(XslTransformationUtils.java:44)
        at ru.yandex.qatools.allure.data.utils.XslTransformationUtils.applyTransformation(XslTransformationUtils.java:35)
        at ru.yandex.qatools.allure.data.utils.XslTransformationUtils.applyTransformations(XslTransformationUtils.java:29)
        at ru.yandex.qatools.allure.data.TestRunGenerator.generate(TestRunGenerator.java:64)
        at ru.yandex.qatools.allure.data.AllureReportGenerator.generate(AllureReportGenerator.java:45)
        ... 8 more
Caused by: net.sf.saxon.event.NoOpenStartTagException: An attribute node (version) cannot be created after the children of the containing element
        at net.sf.saxon.event.NoOpenStartTagException.makeNoOpenStartTagException(NoOpenStartTagException.java:49)
        at net.sf.saxon.event.ComplexContentOutputter.attribute(ComplexContentOutputter.java:296)
        at net.sf.saxon.instruct.CopyOf.copyAttribute(CopyOf.java:572)
        at net.sf.saxon.instruct.Copy.processLeavingTail(Copy.java:221)
        at net.sf.saxon.instruct.Template.expand(Template.java:220)
        at net.sf.saxon.instruct.CallTemplate$CallTemplatePackage.processLeavingTail(CallTemplate.java:440)
        at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:317)
        at net.sf.saxon.instruct.ApplyTemplates.apply(ApplyTemplates.java:210)
        at net.sf.saxon.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:174)
        at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)
        at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)
        at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:296)
        at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:203)
        at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:345)
        at net.sf.saxon.instruct.ApplyTemplates.apply(ApplyTemplates.java:210)
        at net.sf.saxon.instruct.ApplyTemplates.process(ApplyTemplates.java:170)
        at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:296)
        at net.sf.saxon.instruct.Copy.processLeavingTail(Copy.java:217)
        at net.sf.saxon.instruct.Template.expand(Template.java:220)
        at net.sf.saxon.instruct.CallTemplate$CallTemplatePackage.processLeavingTail(CallTemplate.java:440)
        at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:317)
        at net.sf.saxon.instruct.ApplyTemplates.apply(ApplyTemplates.java:210)
        at net.sf.saxon.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:174)
        at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)
        at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)
        at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:296)
        at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:203)
        at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:345)
        at net.sf.saxon.instruct.ApplyTemplates.defaultAction(ApplyTemplates.java:378)
        at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:333)
        at net.sf.saxon.Controller.transformDocument(Controller.java:1807)
        at net.sf.saxon.Controller.transform(Controller.java:1621)
        at ru.yandex.qatools.allure.data.utils.XslTransformationUtils.applyTransformation(XslTransformationUtils.java:52)
        ... 13 more

I discovered that the version attribute in the XML generated by allure-phpunit adapted is causing the problem:

<alr:test-suite xmlns:alr="urn:model.allure.qatools.yandex.ru" start="1407619730453" stop="1407619746445" version="1.4.0">

If i remove the version attribute, the report generating works fine.

@vania-pooh
Copy link
Contributor

This is because PHPUnit was from the beginning implemented for Allure 1.4.0. Allure CLI for compatibility reasons is by default using version 1.3.9 of the report. So to make it work you need to explicitly specify any 1.4.x version of Allure (in fact chances are very high that 1.4.0.RC9 is the final 1.4.0 release), e.g.:

$ allure -v 1.4.0.RC9 path/to/xml

Does it help?

@vania-pooh
Copy link
Contributor

Added a small note about version to README.md.

@OndraM
Copy link
Contributor Author

OndraM commented Aug 10, 2014

Thanks for help, it is working like this. I actually tried using -v 1.4.0 before reporting the issue, but it was not working (for obvious reasons), so I was a bit confused.

@OndraM OndraM closed this as completed Aug 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants