Skip to content

Could not read test result file #378

Closed

Description

@Ljancek

Describe the bug
Allure generate report failing on error "Could not read test result file"

To Reproduce
Steps to reproduce the behavior:

  1. Run test
  2. try generate report

Expected behavior
Report should be generated

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Allure version 2.10.0
Test framework behave@1.2.7 -e git+git://github.com/xrg/behave-parallel.git@eparallel#egg=behave-parallel
Allure adaptor allure-behave@2.6.0
allure-python-commons@2.6.0

Additional context
Could not read test result file allure-results/d98b4e96-3fd8-4497-9cb5-d6e506006390-result.json com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of java.lang.String out of START_ARRAY token at [Source: (sun.nio.ch.ChannelInputStream); line: 1, column: 194] (through reference chain: io.qameta.allure.model.TestResult["statusDetails"]->io.qameta.allure.model.StatusDetails["trace"]) at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:63) at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1343) at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1139) at com.fasterxml.jackson.databind.deser.std.StdDeserializer._deserializeFromArray(StdDeserializer.java:675) at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:40) at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:10) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4013) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3070) at io.qameta.allure.allure2.Allure2Plugin.readTestResult(Allure2Plugin.java:344) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) at io.qameta.allure.allure2.Allure2Plugin.readResults(Allure2Plugin.java:104) at io.qameta.allure.ReportGenerator.lambda$readResults$0(ReportGenerator.java:47) at java.util.ArrayList.forEach(ArrayList.java:1257) at io.qameta.allure.ReportGenerator.readResults(ReportGenerator.java:47) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:69) at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:58) at io.qameta.allure.Commands.generate(Commands.java:105) at io.qameta.allure.CommandLine.run(CommandLine.java:152) at java.util.Optional.orElseGet(Optional.java:267) at io.qameta.allure.CommandLine.main(CommandLine.java:88)

Activity

  1. Ljancek commented on Mar 27, 2019

    @Ljancek
    Author

    Any update?

  2. ervuks commented on Apr 8, 2019

    @ervuks

    Looks like there is unsuccessful deserialization which leads to this issue.
    I've found a possible line of the cause: https://github.com/allure-framework/allure2/blob/master/allure-generator/src/main/java/io/qameta/allure/allure2/Allure2Plugin.java#L342

  3. Ljancek commented on Apr 10, 2019

    @Ljancek
    Author

    Do you have any idea when will be fixed it?

  4. ervuks commented on Apr 11, 2019

    @ervuks

    Do you have any idea when will be fixed it?

    I could try to fix this, but I will need an example of a report file to reproduce this issue, write tests and verify.

  5. Ljancek commented on May 19, 2019

    @Ljancek
    Author

    @ervuks sry for very late reaction.

    here is the result of failing to generate a report (rename txt to json :-) )
    21c0dd3a-a8b6-48a1-8a55-8f6ee1e91fec-result.txt

    and screen (blank page)
    0443dd14-5300-4f60-9160-e21fbacfaabd-attachment

    Thank you

  6. baev commented on May 20, 2019

    @baev
    Member

    @sseliverstov invalid file is generated. trace supposed to be string, not an array

  7. Ljancek commented on May 20, 2019

    @Ljancek
    Author

    @sseliverstov invalid file is generated. trace supposed to be string, not an array

    Thanks for your investigation. When we know what is wrong is it possible to fix it? @baev @sseliverstov

  8. sseliverstov commented on May 29, 2019

    @sseliverstov
    Contributor

    @Ljancek It was fixed some versions ago, can you check it with last version?
    5e9128b

  9. Ljancek commented on May 29, 2019

    @Ljancek
    Author

    @sseliverstov

    allure-behave            2.6.3
    allure-python-commons    2.6.3
    

    same issue :-(

  10. Ljancek commented on May 29, 2019

    @Ljancek
    Author

    and

    allure --version
    2.11.0
    
  11. Ljancek commented on May 29, 2019

    @Ljancek
    Author

    with allure@2.12.1 works :-)

  12. sseliverstov commented on May 29, 2019

    @sseliverstov
    Contributor

    Guess you forgot delete some old result before check 2.6.3. But if it finally works im happy.

  13. added a commit that references this issue on May 30, 2019
    dae377f
  14. volnoboyblazemeter commented on Jan 15, 2020

    @volnoboyblazemeter

    After update from allure 1 to allure 2 (2.8.6) I had the same exception. Tried many things including deleting old reports. Didn't work lacally and on Jenkins. Got it to work by adding explicitly two requirements:
    allure-python-commons-test==2.8.6
    allure-python-commons==2.8.6
    besides two I had before:
    allure-pytest==2.8.6
    allure-behave==2.8.6

  15. added a commit that references this issue on Mar 19, 2024
    f1533b3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions