Skip to content

Test Report: Nested: File name too long #36996

@sellmair

Description

@sellmair

Current Behavior

Upgrading the JetBrains/kotlin project to Gradle 9.4 caused build failures when generating test reports.

File name too long: '/opt/buildAgent/work/17e640964edd2053/kotlin/native/native.tests/klib-ir-inliner/build/reports/tests/test/org.jetbrains.kotlin.konan.test.blackbox.NativeCodegenBoxWithInlinedFunInKlibTestGenerated/org.jetbrains.kotlin.konan.test.blackbox.NativeCodegenBoxWithInlinedFunInKlibTestGenerated$Box/org.jetbrains.kotlin.konan.test.blackbox.NativeCodegenBoxWithInlinedFunInKlibTestGenerated$Box$Ranges/org.jetbra-8UB7PO1MP775A.kotlin.konan.test.blackbox.NativeCodegenBoxWithInlinedFunInKlibTestGenerated$Box$Ranges$Stepped/o-U8GQRQ01FA18E.kotlin.konan.test.blackbox.NativeCodegenBoxWithInlinedFunInKlibTestGenerated$Box$Ranges$Stepped$Unsigned/org-8GQH5QGA24K4S.test.blackbox.NativeCodegenBoxWithInlinedFunInKlibTestGenerated$Box$Ranges$Stepped$Unsigned$Expression/o-L2QJDBRKVDRF2.blackbox.NativeCodegenBoxWithInlinedFunInKlibTestGenerated$Box$Ranges$Stepped$Unsigned$Expression$DownTo/o-24H6DVU76EQE0.NativeCodegenBoxWithInlinedFunInKlibTestGenerated$Box$Ranges$Stepped$Unsigned$Expression$DownTo$Reversed/testStepThenReversedThenStepThenReversed().html'.

The very long pathname can be observed by using @Nested tests

class SampleTest {
    @Nested
    inner class ThisIsAVeryLongClassName {
        @Nested
        inner class ThisIsAVeryLongClassName1 {
            @Nested
            inner class ThisIsAVeryLongClassName2 {
                @Nested
                inner class ThisIsAVeryLongClassName3 {

                    @Nested
                    inner class ThisIsAVeryLongClassName4 {
                        @Test
                        fun thisIsAlsoARatherLongMethodName() {
                            println("Hello, world!")
                        }
                    }
                }
            }
        }
    }
}

Nested tests will create a folder for each nesting with the FQN of the nested class. This can exceed the maximum path length.

Expected Behavior

I expect that @Nested tests, similar to static nested classes, generated a single filepath within bounds.

Context (optional)

No response

Self-contained Reproducer Project

reproducer.zip

Gradle version

9.4.0

Build scan URL (optional)

https://ge.jetbrains.com/s/6ccrtufthkfi4

Your Environment (optional)

No response

Metadata

Metadata

Assignees

Labels

a:regressionThis used to workin:test-reportingTestEventReporter, test report aggregation, HTML test reports, XML test reports

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions