openclover / clover

This repository contains source code of OpenClover Core as well as its integrations: Clover-for-Ant, Clover-for-Eclipse and Clover-for-IDEA plugins. Sources are licensed under Apache 2.0 license.
Other
57 stars 14 forks source link

HTML report generation fails for Spock-based tests with 'File name too long' IOException #230

Closed marek-parfianowicz closed 5 months ago

marek-parfianowicz commented 5 months ago

Problem originally reported for version 4.5.1.

A file name picked for a test result page might exceed Linux/Windows file name limit of 255 characters. This in particular happens for Spock-based tests, where a runtime test name contains all input arguments, both types and values.

java.nio.file.FileSystemException:  <very long path> File name too long
     at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
     at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
     at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
     at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)
     at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:484)
     at java.base/java.nio.file.Files.newOutputStream(Files.java:228)
     at com.atlassian.clover.reporters.html.HtmlReportUtil.mergeTemplateToFile(HtmlReportUtil.java:61)
     at com.atlassian.clover.reporters.html.HtmlReportUtil.mergeTemplateToFile(HtmlReportUtil.java:86)