From bcfb6ae6892151ee42aaa8d8446ec6185715691e Mon Sep 17 00:00:00 2001 From: Stuart Wheater Date: Tue, 6 Jan 2026 13:17:49 +0000 Subject: [PATCH 1/2] Reworking of performance profiles --- azure-pipelines.yml | 1 + ...ne.csv => azure-pipeline_perf-profile.csv} | 0 ...circleci.csv => circleci_perf-profile.csv} | 0 ..._check.cvs => cran-check_perf-profile.cvs} | 0 ...f_profile.csv => default_perf-profile.csv} | 0 ...ay.csv => hp-laptop-quay_perf-profile.csv} | 0 tests/testthat/perf_tests/perf_rate.R | 19 +++++++++++++++---- 7 files changed, 16 insertions(+), 4 deletions(-) rename tests/testthat/perf_files/{azure-pipeline.csv => azure-pipeline_perf-profile.csv} (100%) rename tests/testthat/perf_files/{circleci.csv => circleci_perf-profile.csv} (100%) rename tests/testthat/perf_files/{cran_check.cvs => cran-check_perf-profile.cvs} (100%) rename tests/testthat/perf_files/{default_perf_profile.csv => default_perf-profile.csv} (100%) rename tests/testthat/perf_files/{hp-laptop_quay.csv => hp-laptop-quay_perf-profile.csv} (100%) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index abbcc444..2d3bc950 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -188,6 +188,7 @@ jobs: # testthat::testpackage uses a MultiReporter, comprised of a ProgressReporter and JunitReporter # R output and messages are redirected by sink() to test_console_output.txt # junit reporter output is to test_results.xml + export PERF_PROFILE="azure-pipeline" sudo R -q -e ' library(covr); write.csv( diff --git a/tests/testthat/perf_files/azure-pipeline.csv b/tests/testthat/perf_files/azure-pipeline_perf-profile.csv similarity index 100% rename from tests/testthat/perf_files/azure-pipeline.csv rename to tests/testthat/perf_files/azure-pipeline_perf-profile.csv diff --git a/tests/testthat/perf_files/circleci.csv b/tests/testthat/perf_files/circleci_perf-profile.csv similarity index 100% rename from tests/testthat/perf_files/circleci.csv rename to tests/testthat/perf_files/circleci_perf-profile.csv diff --git a/tests/testthat/perf_files/cran_check.cvs b/tests/testthat/perf_files/cran-check_perf-profile.cvs similarity index 100% rename from tests/testthat/perf_files/cran_check.cvs rename to tests/testthat/perf_files/cran-check_perf-profile.cvs diff --git a/tests/testthat/perf_files/default_perf_profile.csv b/tests/testthat/perf_files/default_perf-profile.csv similarity index 100% rename from tests/testthat/perf_files/default_perf_profile.csv rename to tests/testthat/perf_files/default_perf-profile.csv diff --git a/tests/testthat/perf_files/hp-laptop_quay.csv b/tests/testthat/perf_files/hp-laptop-quay_perf-profile.csv similarity index 100% rename from tests/testthat/perf_files/hp-laptop_quay.csv rename to tests/testthat/perf_files/hp-laptop-quay_perf-profile.csv diff --git a/tests/testthat/perf_tests/perf_rate.R b/tests/testthat/perf_tests/perf_rate.R index 64b638db..8de658c3 100644 --- a/tests/testthat/perf_tests/perf_rate.R +++ b/tests/testthat/perf_tests/perf_rate.R @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------- -# Copyright (c) 2024-2025 Arjuna Technologies, Newcastle upon Tyne. All rights reserved. +# Copyright (c) 2024-2026 Arjuna Technologies, Newcastle upon Tyne. All rights reserved. # # This program and the accompanying materials # are made available under the terms of the GNU Public License v3.0. @@ -8,13 +8,24 @@ # along with this program. If not, see . #------------------------------------------------------------------------------- -.perf.reference.filename <- 'perf_files/default_perf_profile.csv' -.perf.reference.save.filename <- NULL +.perf.reference.filename.base.prefix <- 'perf_files/' +.perf.reference.filename.base.postfix <- '_perf-profile.csv' +.perf.reference.save.filename <- NULL .perf.reference <- NULL .load.pref <- function() { - .perf.reference <<- read.csv(.perf.reference.filename, header = TRUE, sep = ",") + perf.profile = base::Sys.getenv("PERF_PROFILE") + if (nchar(perf.profile) > 0) + perf.reference.filename.platform.infix <- base::tolower(perf.profile) + else + { + perf.reference.filename.platform.infix <- "default" + warning("Unknown performance profile platform, using 'default'") + } + + perf.reference.filename <- paste(.perf.reference.filename.base.prefix, perf.reference.filename.platform.infix, .perf.reference.filename.base.postfix, sep = "") + .perf.reference <<- read.csv(perf.reference.filename, header = TRUE, sep = ",") } perf.reference.save <- function(perf.ref.name, rate, tolerance.lower, tolerance.upper) { From 2b201d6930e56433b0149712297cfd6ceec0e74f Mon Sep 17 00:00:00 2001 From: Stuart Wheater Date: Tue, 6 Jan 2026 14:14:46 +0000 Subject: [PATCH 2/2] Rework setting of variable --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2d3bc950..79a26fbe 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -27,6 +27,7 @@ variables: branchName: $(Build.SourceBranchName) test_filter: '*' _r_check_system_clock_: 0 + PERF_PROFILE: 'azure-pipeline' @@ -188,7 +189,7 @@ jobs: # testthat::testpackage uses a MultiReporter, comprised of a ProgressReporter and JunitReporter # R output and messages are redirected by sink() to test_console_output.txt # junit reporter output is to test_results.xml - export PERF_PROFILE="azure-pipeline" + sudo R -q -e ' library(covr); write.csv(