Skip to content

Commit 079a067

Browse files
Merge pull request #449 from StuartWheater/v6.3.5-dev
Reworking of performance profiles
2 parents 5ae71ec + 2b201d6 commit 079a067

7 files changed

Lines changed: 17 additions & 4 deletions

File tree

azure-pipelines.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ variables:
2727
branchName: $(Build.SourceBranchName)
2828
test_filter: '*'
2929
_r_check_system_clock_: 0
30+
PERF_PROFILE: 'azure-pipeline'
3031

3132

3233

@@ -188,6 +189,7 @@ jobs:
188189
# testthat::testpackage uses a MultiReporter, comprised of a ProgressReporter and JunitReporter
189190
# R output and messages are redirected by sink() to test_console_output.txt
190191
# junit reporter output is to test_results.xml
192+
191193
sudo R -q -e '
192194
library(covr);
193195
write.csv(
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/testthat/perf_tests/perf_rate.R

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#-------------------------------------------------------------------------------
2-
# Copyright (c) 2024-2025 Arjuna Technologies, Newcastle upon Tyne. All rights reserved.
2+
# Copyright (c) 2024-2026 Arjuna Technologies, Newcastle upon Tyne. All rights reserved.
33
#
44
# This program and the accompanying materials
55
# are made available under the terms of the GNU Public License v3.0.
@@ -8,13 +8,24 @@
88
# along with this program. If not, see <http://www.gnu.org/licenses/>.
99
#-------------------------------------------------------------------------------
1010

11-
.perf.reference.filename <- 'perf_files/default_perf_profile.csv'
12-
.perf.reference.save.filename <- NULL
11+
.perf.reference.filename.base.prefix <- 'perf_files/'
12+
.perf.reference.filename.base.postfix <- '_perf-profile.csv'
13+
.perf.reference.save.filename <- NULL
1314

1415
.perf.reference <- NULL
1516

1617
.load.pref <- function() {
17-
.perf.reference <<- read.csv(.perf.reference.filename, header = TRUE, sep = ",")
18+
perf.profile = base::Sys.getenv("PERF_PROFILE")
19+
if (nchar(perf.profile) > 0)
20+
perf.reference.filename.platform.infix <- base::tolower(perf.profile)
21+
else
22+
{
23+
perf.reference.filename.platform.infix <- "default"
24+
warning("Unknown performance profile platform, using 'default'")
25+
}
26+
27+
perf.reference.filename <- paste(.perf.reference.filename.base.prefix, perf.reference.filename.platform.infix, .perf.reference.filename.base.postfix, sep = "")
28+
.perf.reference <<- read.csv(perf.reference.filename, header = TRUE, sep = ",")
1829
}
1930

2031
perf.reference.save <- function(perf.ref.name, rate, tolerance.lower, tolerance.upper) {

0 commit comments

Comments
 (0)