jenkinsci / code-coverage-api-plugin

Deprecated Jenkins Code Coverage Plugin
https://plugins.jenkins.io/code-coverage-api/
MIT License
111 stars 77 forks source link

Timeout for tree chart for large project files (80 MByte) #762

Open kabirkhaan opened 12 months ago

kabirkhaan commented 12 months ago

Describe your use-case which is not covered by existing documentation.

We are integrating the code coverage tool in Jenkins using cobetura xml with the following.

recordCoverage(
            tools: [[
              parser: 'COBERTURA',
              pattern: 'cobertura/cobertura.xml'
            ]],
            name: 'Code Coverage',
            sourceCodeRetention: 'LAST_BUILD', 
            sourceDirectories: [
              [path: 'Project/Sources/'],
              [path: 'regex:libraries/abc/*/Sources/'],
              [path: 'regex:libraries/xyz/*/Sources/']
            ]
          )

I tried to look at all the documents but could not find documentation that would guide me in this issue.

Jenkins out [Cobertura] Recording coverage results [Cobertura] Searching for all files in '/opt/agent/workspace/team/project/main-ef636600-133a-49f8-a4b7-e07612124959' that match the pattern 'cobertura/cobertura.xml' [Cobertura] Traversing of symbolic links: disabled [Cobertura] -> found 1 file [Cobertura] Successfully parsed file '/opt/agent/workspace/team/project/main-ef636600-133a-49f8-a4b7-e07612124959/cobertura/cobertura.xml' [Cobertura] MODULE: 100.00% (1/1) [Cobertura] PACKAGE: 77.34% (2157/2789) [Cobertura] FILE: 56.95% (5202/9134) [Cobertura] CLASS: 56.95% (5202/9134) [Cobertura] LINE: 51.15% (563549/1101766) [Cobertura] COMPLEXITY: 0 [Cobertura] COMPLEXITY_DENSITY: 0/1101766 [Cobertura] LOC: 1101766 [Cobertura] Successfully processed file 'cobertura/cobertura.xml' [Coverage] [-ERROR-] Errors while recording code coverage: [Coverage] [-ERROR-] Errors during source path resolving: [Coverage] [-ERROR-] Errors while resolving source files on agent: [Coverage] [-ERROR-] Removing non-workspace source directory '/Users/myuser/actions-runner/_work/project/project' - it has not been approved in Jenkins' global configuration. [Coverage] [-ERROR-] - Source file 'l [Coverage] [-ERROR-] - Source file 'libraries/xyz/abc/Sources/Mocks.generated.swift' not found [Coverage] [-ERROR-] - Source file 'libraries/xyz/abc/Sources/Mocks.generated.swift' not found [Coverage] [-ERROR-] - Source file 'libraries/xyz/abc/Mocks.generated.swift' not found [Coverage] [-ERROR-] - Source file 'Derived/xyz1/abc.swift' not found [Coverage] [-ERROR-] - Source file 'libraries/xyz/abcMocks.generated.swift' not found [Coverage] [-ERROR-] - Source file 'libraries/xyz/abc/Sources/Mocks.generated.swift' not found [Coverage] [-ERROR-] - Source file 'libraries/abc/abc/Mocks.generated.swift' not found [Coverage] [-ERROR-] ... skipped logging of 262 additional errors ... [Coverage] [-ERROR-] ... skipped logging of 262 additional errors ... [Coverage] [-ERROR-] ... skipped logging of 262 additional errors ... [Coverage] Recording coverage results [Coverage] Searching for all files in '/opt/agent/workspace/team/project/main-ef636600-133a-49f8-a4b7-e07612124959' that match the pattern 'cobertura/cobertura.xml' [Coverage] Traversing of symbolic links: disabled [Coverage] -> found 1 file [Coverage] Successfully parsed file '/opt/agent/workspace/team/project/main-ef636600-133a-49f8-a4b7-e07612124959/cobertura/cobertura.xml' [Coverage] MODULE: 100.00% (1/1) [Coverage] PACKAGE: 77.34% (2157/2789) [Coverage] FILE: 56.95% (5202/9134) [Coverage] CLASS: 56.95% (5202/9134) [Coverage] LINE: 51.15% (563549/1101766) [Coverage] COMPLEXITY: 0 [Coverage] COMPLEXITY_DENSITY: 0/1101766 [Coverage] LOC: 1101766 [Coverage] Successfully processed file 'cobertura/cobertura.xml' [Coverage] Resolving source code files... [Coverage] Searching for source code files in: [Coverage] -> /opt/agent/workspace/team/project/main-ef636600-133a-49f8-a4b7-e07612124959/apps/project/Sources/ [Coverage] -> /opt/agent/workspace/team/project/main-ef636600-133a-49f8-a4b7-e07612124959/src/main/java [Coverage] -> finished resolving of absolute paths (found: 8853, not found: 281) [Coverage] Obtaining action of reference build [Coverage] Reference build recorder is not configured [Coverage] -> No reference build defined, falling back to previous build: '#2' [Coverage] -> Found reference result in build '#2' [Coverage] Calculating the code delta... [Coverage] -> No delta calculator installed yet. You need to install the 'git-forensics' plugin to enable it for Git. [Coverage] Calculating coverage deltas... [Coverage] No quality gates have been set - skipping [Coverage] Executing source code painting... [Coverage] Painting 9134 source files on agent [Coverage] -> finished painting (8853 files have been painted, 281 files failed) [Coverage] -> zipping sources from folder '/opt/agent/workspace/team/project/main-ef636600-133a-49f8-a4b7-e07612124959/coverage' as '/opt/agent/workspace/team/project/main-ef636600-133a-49f8-a4b7-e07612124959/coverage-sources.zip' [Coverage] Copying painted sources from agent to build folder [Coverage] -> extracting... [Coverage] -> done [Coverage] Deleting source code files of build #2 [Coverage] Finished coverage processing - adding the action to the build... [Checks API] No suitable checks publisher found

Can you please help me understand the issue?

Reference any relevant documentation, other materials, or issues/pull requests that can be used for inspiration.

After integration this tool for our swift project we are getting the following white screen on the Line coverage tree view graph Screenshot 2023-09-07 at 16 14 48 Screenshot 2023-09-07 at 16 14 26 Screenshot 2023-09-07 at 16 13 26

kabirkhaan commented 12 months ago

We indented the issue, it is related to timeout as out xml size is around 80mb and when the tool calls getCoverageTree we received 504 timeout issue. Screenshot 2023-09-08 at 12 29 38

uhafner commented 11 months ago

It would make sense to prune large trees (or at least add an option).