Skip to content

Commit

Permalink
feat: improve SQL performance of MapRunCoverage
Browse files Browse the repository at this point in the history
  • Loading branch information
isc-shuliu committed Nov 4, 2024
1 parent 181e2bb commit 2e97e33
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.0.5] - 2024-11-04

### Fixed
- #57: Improve SQL performance when mapping run coverage

## [4.0.4] - 2024-10-15

### Fixed
Expand Down
6 changes: 3 additions & 3 deletions cls/TestCoverage/Data/Run.cls
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ ClassMethod MapRunCoverage(pRunIndex As %Integer) As %Status
Set tSQLStatement = "INSERT OR UPDATE %NOLOCK %NOCHECK INTO TestCoverage_Data.Coverage_"_tMetric_" "_
"(Coverage,element_key,"_tMetric_") "_
"SELECT target.ID,map.ToLine,NVL(oldMetric."_tMetric_",0) + SUM(metric."_tMetric_") "_
"FROM TestCoverage_Data.Coverage source "_
"JOIN TestCoverage_Data.CodeUnitMap map "_
" ON source.Hash = map.FromHash "_
"FROM %INORDER TestCoverage_Data.Coverage source "_
"JOIN TestCoverage_Data.Coverage_"_tMetric_" metric "_
" ON metric.Coverage = source.ID "_
"JOIN TestCoverage_Data.CodeUnitMap map "_
" ON source.Hash = map.FromHash "_
" AND metric.element_key = map.FromLine "_
"JOIN TestCoverage_Data.Coverage target "_
" ON target.Run = source.Run "_
Expand Down
2 changes: 1 addition & 1 deletion module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Export generator="Cache" version="25">
<Document name="TestCoverage.ZPM"><Module>
<Name>TestCoverage</Name>
<Version>4.0.4</Version>
<Version>4.0.5</Version>
<Description>Run your typical ObjectScript %UnitTest tests and see which lines of your code are executed. Includes Cobertura-style reporting for use in continuous integration tools.</Description>
<Packaging>module</Packaging>
<Resource Name="TestCoverage.PKG" Directory="cls" />
Expand Down

0 comments on commit 2e97e33

Please sign in to comment.