You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added a new metric query parameter to the TeamCity coverage badge to allow users to specify which coverage type to display (e.g., line, block, method, class, branch).
Kept backward compatibility by setting the default metric to statement (which maps to S), so existing badge URLs will not break.
The metric codes (S, L, M, C, B, R) map directly to TeamCity's internal CodeCoverageAbs* statistical values. Reference: TeamCity Custom Chart Documentation.
Testing & Mocking Details:
I was unable to test against the live JetBrains TeamCity server (https://teamcity.jetbrains.com) because it now requires authentication to view statistics for the FileHelpersStable build (it returns a 401 Unauthorized / inaccessible error for guests).
Because I couldn't hit the actual API, I tested this logic entirely via the local mocked service tests in teamcity-coverage.tester.js. The tests intercept the outbound request and feed it mocked JSON responses to prove that the code correctly extracts the different metric values (like CodeCoverageAbsLCovered) and calculates the percentage accurately without needing a live, public TeamCity server.
I was unable to test against the live JetBrains TeamCity server (https://teamcity.jetbrains.com) because it now requires authentication to view statistics for the FileHelpersStable build (it returns a 401 Unauthorized / inaccessible error for guests).
Because I couldn't hit the actual API, I tested this logic entirely via the local mocked service tests in teamcity-coverage.tester.js. The tests intercept the outbound request and feed it mocked JSON responses to prove that the code correctly extracts the different metric values (like CodeCoverageAbsLCovered) and calculates the percentage accurately without needing a live, public TeamCity server.
We do have credentials configured in our CI and in production, but you won't have access to them through a fork (#8820). Did you try generating your own credentials and running the live test locally?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added a new
metricquery parameter to the TeamCity coverage badge to allow users to specify which coverage type to display (e.g.,line,block,method,class,branch).statement(which maps toS), so existing badge URLs will not break.S,L,M,C,B,R) map directly to TeamCity's internalCodeCoverageAbs*statistical values. Reference: TeamCity Custom Chart Documentation.Testing & Mocking Details:
I was unable to test against the live JetBrains TeamCity server (
https://teamcity.jetbrains.com) because it now requires authentication to view statistics for theFileHelpersStablebuild (it returns a401 Unauthorized/ inaccessible error for guests).Because I couldn't hit the actual API, I tested this logic entirely via the local mocked service tests in
teamcity-coverage.tester.js. The tests intercept the outbound request and feed it mocked JSON responses to prove that the code correctly extracts the differentmetricvalues (likeCodeCoverageAbsLCovered) and calculates the percentage accurately without needing a live, public TeamCity server.Closes #<#3111>