[TeamCity] Add 'metric' query parameter to TeamCity coverage badge - #12147
Open
Filipot2 wants to merge 2 commits into
Open
[TeamCity] Add 'metric' query parameter to TeamCity coverage badge#12147Filipot2 wants to merge 2 commits into
Filipot2 wants to merge 2 commits into
Conversation
Contributor
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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>