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

Exception in thread "main" java.lang.NumberFormatException: For input string: "" #6

Closed
simonwilbert opened this issue Feb 28, 2017 · 10 comments

Comments

@simonwilbert
Copy link

simonwilbert commented Feb 28, 2017

i ran "allure generate allure-results", generating the following error after 30 seconds of processing.

c:\Source\e2etests>allure generate allure-results
Exception in thread "main" java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Long.parseLong(Unknown Source)
at java.lang.Long.valueOf(Unknown Source)
at com.sun.xml.internal.bind.DatatypeConverterImpl._parseLong(Unknown Source)
at ru.yandex.qatools.allure.model.TestCaseResult_JaxbXducedAccessor_stop.parse(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StructureLoader.startElement(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(Unknown Source)
at javax.xml.bind.JAXB.unmarshal(Unknown Source)
at ru.yandex.qatools.allure.commons.AllureFileUtils.unmarshal(AllureFileUtils.java:59)
at ru.yandex.qatools.allure.commons.AllureFileUtils.unmarshal(AllureFileUtils.java:50)
at ru.yandex.qatools.allure.commons.AllureFileUtils.unmarshal(AllureFileUtils.java:40)
at ru.yandex.qatools.allure.data.io.TestSuiteReader$TestSuiteResultIterator.next(TestSuiteReader.java:48)
at ru.yandex.qatools.allure.data.io.TestSuiteReader$TestSuiteResultIterator.next(TestSuiteReader.java:1)
at ru.yandex.qatools.allure.data.io.TestCaseReader$TestCaseResultIterator.nextSuite(TestCaseReader.java:46)
at ru.yandex.qatools.allure.data.io.TestCaseReader$TestCaseResultIterator.hasNext(TestCaseReader.java:56)
at ru.yandex.qatools.allure.data.AllureReportGenerator.generate(AllureReportGenerator.java:63)
at ru.yandex.qatools.allure.data.AllureReportGenerator.generate(AllureReportGenerator.java:53)
at ru.yandex.qatools.allure.AllureMain.main(AllureMain.java:48)
Command aborted due to exception {}.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:153)
at ru.yandex.qatools.allure.command.ReportGenerate.runUnsafe(ReportGenerate.java:48)
at ru.yandex.qatools.allure.command.AbstractCommand.run(AbstractCommand.java:52)
at ru.yandex.qatools.allure.CommandLine.main(CommandLine.java:46)

the allure-results folder zips to 47mb so not sure how to send to you?

Do I need to raise this on an allure specific project instead of allure npm wrapper?

@just-boris
Copy link
Collaborator

Stacktrace is the same as webdriverio-boneyard/wdio-allure-reporter#26
Do you use Cucumber?

@simonwilbert
Copy link
Author

Hi, yes, Cucumber is used. So short-term fix is for us to maybe hack the allure-results' json files or medium-term solution is to wait for next release containing that stale PR?

@simonwilbert
Copy link
Author

For now we're using work-around on string-replace json files

status="" to status="broken"
stop="" to stop="1488360005476" where 1488360005476 is controlled number

@just-boris
Copy link
Collaborator

This is not a solution because then your report will become not true.
As I mentioned in the above ticket, the problem is that for some reason (possibly, when test fails), cucumber doesn't provide enough data for Allure.

The current version of Allure 1.5.x requires test times as required values, so report can't be built without them. Maybe we could make a more user-friendly error message, but instead, we are working on Allure v2, that will not have this problem.

@GeoffreyBooth
Copy link

GeoffreyBooth commented Mar 8, 2017

In case it helps anyone else, here’s my implementation of @simonwilbert’s workaround:

# If the Allure test results folder has files, generate a report from those files
if [ "$(ls -A ./allure-report)" ]; then
  # Monkey-patch workaround for https://github.com/allure-framework/allure-npm/issues/6#issuecomment-283311586
  # Replacement code via http://stackoverflow.com/a/19457213/223225
  LC_ALL=C # http://stackoverflow.com/a/23584470/223225
  find ./allure-report -type f -print0 | xargs -0 sed -i '' -e 's/status=""/status="broken"/g'
  find ./allure-report -type f -print0 | xargs -0 sed -i '' -e "s/stop=\"\"/stop=\"$(date +%s)000\"/g"

  allure generate ./allure-report
fi

@tiffanywilson
Copy link

tiffanywilson commented Mar 14, 2017

@just-boris If you aren't going to fix this problem in v1, how soon can we get access to v2? I am able to get results when I run single specs, but not when I run my entire suite, even though the suite passes and has no timeouts.

Also, is it possible for allure to show a history of test results, or does it only present the most recent set of results?

@just-boris
Copy link
Collaborator

Redirecting the last question to @baev

@baev
Copy link
Member

baev commented Mar 14, 2017

history is only available when using Jenkins plugin (v2.13+) and latest Allure commandline (2.0-BETA5). It is fully backward compatible with old adapters

@tiffanywilson
Copy link

Thanks for the quick responses @just-boris and @baev.

But what about v2 and the errors Exception in thread "main" java.lang.NumberFormatException: For input string: ""?

@just-boris
Copy link
Collaborator

Allure 2.0 is already released and published. Please, check

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

5 participants