Skip to content

Commit e941ad3

Browse files
Merge pull request #637 from StuartWheater/v6.3.5-dev
Update 'perf' support and fix typo in variable name
2 parents 9a77a9b + f31f694 commit e941ad3

3 files changed

Lines changed: 43 additions & 37 deletions

File tree

.github/workflows/dsBaseClient_test_suite.yaml

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
timeout-minutes: 180
2323
permissions:
2424
contents: read
25-
25+
2626
# These should all be constant, except TEST_FILTER. This can be used to test
2727
# subsets of test files in the testthat directory. Options are like:
2828
# '*' <- Run all tests.
@@ -33,7 +33,7 @@ jobs:
3333
_r_check_system_clock_: 0
3434
WORKFLOW_ID: ${{ github.run_id }}-${{ github.run_attempt }}
3535
PROJECT_NAME: dsBaseClient
36-
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
36+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
3737
REPO_OWNER: ${{ github.repository_owner }}
3838
R_KEEP_PKG_SOURCE: yes
3939
GITHUB_TOKEN: ${{ github.token || 'placeholder-token' }}
@@ -53,7 +53,7 @@ jobs:
5353
path: testStatus
5454
persist-credentials: false
5555
token: ${{ env.GITHUB_TOKEN }}
56-
56+
5757
- name: Uninstall default MySQL
5858
run: |
5959
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
@@ -63,7 +63,7 @@ jobs:
6363
sudo apt-get autoremove -y
6464
sudo apt-get autoclean -y
6565
sudo rm -rf /var/lib/mysql/
66-
66+
6767
- uses: r-lib/actions/setup-pandoc@v2
6868

6969
- uses: r-lib/actions/setup-r@v2
@@ -83,29 +83,29 @@ jobs:
8383
sudo apt-get install -qq libharfbuzz-dev libfribidi-dev libmagick++-dev xml-twig-tools -y
8484
sudo R -q -e "install.packages(c('devtools','covr','fields','meta','metafor','ggplot2','gridExtra','data.table','DSI','DSOpal','DSLite','MolgenisAuth','MolgenisArmadillo','DSMolgenisArmadillo','DescTools','e1071'), repos='https://cloud.r-project.org')"
8585
sudo R -q -e "devtools::install_github(repo='datashield/dsDangerClient', ref=Sys.getenv('BRANCH_NAME'))"
86-
86+
8787
- uses: r-lib/actions/setup-r-dependencies@v2
8888
with:
8989
dependencies: 'c("Imports")'
90-
extra-packages: |
91-
any::rcmdcheck
92-
cran::devtools
93-
cran::git2r
94-
cran::RCurl
95-
cran::readr
96-
cran::magrittr
97-
cran::xml2
98-
cran::purrr
99-
cran::dplyr
100-
cran::stringr
101-
cran::tidyr
102-
cran::quarto
103-
cran::knitr
104-
cran::kableExtra
105-
cran::rmarkdown
106-
cran::downlit
90+
extra-packages: |
91+
any::rcmdcheck
92+
cran::devtools
93+
cran::git2r
94+
cran::RCurl
95+
cran::readr
96+
cran::magrittr
97+
cran::xml2
98+
cran::purrr
99+
cran::dplyr
100+
cran::stringr
101+
cran::tidyr
102+
cran::quarto
103+
cran::knitr
104+
cran::kableExtra
105+
cran::rmarkdown
106+
cran::downlit
107107
needs: check
108-
108+
109109
- name: Check manual updated
110110
run: |
111111
orig_sum=$(find man -type f | sort -u | xargs cat | md5sum)
@@ -124,7 +124,7 @@ jobs:
124124
grep --quiet "^0 errors" azure-pipelines_check.Rout && grep --quiet " 0 warnings" azure-pipelines_check.Rout && grep --quiet " 0 notes" azure-pipelines_check.Rout
125125
working-directory: dsBaseClient
126126
continue-on-error: true
127-
127+
128128
- name: Start Armadillo docker-compose
129129
run: docker compose -f docker-compose_armadillo.yml up -d --build
130130
working-directory: dsBaseClient
@@ -144,7 +144,7 @@ jobs:
144144
sleep 30
145145
curl -u admin:admin -X POST http://localhost:8080/whitelist/dsBase
146146
working-directory: dsBaseClient
147-
147+
148148
- name: Run tests with coverage & JUnit report
149149
run: |
150150
mkdir -p logs
@@ -168,11 +168,11 @@ jobs:
168168
),
169169
"coveragelist.csv"
170170
)'
171-
171+
172172
mv coveragelist.csv logs/
173173
mv test_* logs/
174174
working-directory: dsBaseClient
175-
175+
176176
- name: Check for JUnit errors
177177
run: |
178178
issue_count=$(sed 's/failures="0" errors="0"//' test_results.xml | grep -c errors= || true)
@@ -190,7 +190,7 @@ jobs:
190190
echo "R:$(R --version | head -n1)" >> ${{ env.WORKFLOW_ID }}.txt
191191
Rscript --vanilla -e 'sessionInfo()' >> session_info_${{ env.WORKFLOW_ID }}.txt
192192
working-directory: dsBaseClient/logs
193-
193+
194194
- name: Parse results from testthat and covr
195195
run: |
196196
Rscript --verbose --vanilla ../testStatus/source/parse_test_report.R logs/ logs/ https://github.com/datashield/${{ env.PROJECT_NAME }}/blob/${{ env.BRANCH_NAME }} '([^:]+)' '(?<=::)[^:]+(?=::)'
@@ -202,24 +202,24 @@ jobs:
202202
- name: Render report
203203
run: |
204204
cd testStatus
205-
205+
206206
mkdir -p new/logs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/
207207
mkdir -p new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/
208208
mkdir -p new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/latest/
209-
209+
210210
# Copy logs to new logs directory location
211211
cp -rv ../dsBaseClient/logs/* new/logs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/
212212
cp -rv ../dsBaseClient/logs/${{ env.WORKFLOW_ID }}.txt new/logs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/
213-
213+
214214
R -e 'input_dir <- file.path("../new/logs", Sys.getenv("PROJECT_NAME"), Sys.getenv("BRANCH_NAME"), Sys.getenv("WORKFLOW_ID")); quarto::quarto_render("source/test_report.qmd", execute_params = list(input_dir = input_dir))'
215215
mv source/test_report.html new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/index.html
216216
cp -r new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/* new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/latest
217-
217+
218218
env:
219219
PROJECT_NAME: ${{ env.PROJECT_NAME }}
220220
BRANCH_NAME: ${{ env.BRANCH_NAME }}
221221
WORKFLOW_ID: ${{ env.WORKFLOW_ID }}
222-
222+
223223
- name: Upload test logs
224224
uses: actions/upload-artifact@v4
225225
with:
@@ -245,4 +245,3 @@ jobs:
245245
R -e 'sessionInfo()'
246246
sudo apt install tree -y
247247
tree .
248-

opal_azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ jobs:
233233
# Install dsBase.
234234
# If previous steps have failed then don't run.
235235
- bash: |
236-
R -q -e "library(opalr); opal <- opal.login(username = 'administrator', password = 'datashield_test&', url = 'https://localhost:8443', opts = list(ssl_verifyhost=0, ssl_verifypeer=0)); opal.put(opal, 'system', 'conf', 'general', '_rPackage'); opal.logout(o)"
236+
R -q -e "library(opalr); opal <- opal.login(username = 'administrator', password = 'datashield_test&', url = 'https://localhost:8443', opts = list(ssl_verifyhost=0, ssl_verifypeer=0)); opal.put(opal, 'system', 'conf', 'general', '_rPackage'); opal.logout(opal)"
237237
238238
R -q -e "library(opalr); opal <- opal.login('administrator','datashield_test&', url='https://localhost:8443/', opts = list(ssl_verifyhost=0, ssl_verifypeer=0)); dsadmin.install_github_package(opal, 'dsBase', username = 'datashield', ref = 'v6.3.5-dev'); opal.logout(opal)"
239239

tests/testthat/perf_tests/perf_rate.R

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
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'
11+
.perf.reference.filename <- 'perf_files/default_perf_profile.csv'
12+
.perf.reference.save.filename <- NULL
1213

1314
.perf.reference <- NULL
1415

@@ -22,7 +23,13 @@ perf.reference.save <- function(perf.ref.name, rate, tolerance.lower, tolerance.
2223

2324
.perf.reference[nrow(.perf.reference)+1,] <- c(perf.ref.name, rate, tolerance.lower, tolerance.upper)
2425

25-
write.csv(.perf.reference, .perf.reference.filename, row.names = FALSE)
26+
if (is.null(.perf.reference.save.filename))
27+
{
28+
.perf.reference.save.filename <<- base::tempfile(pattern = "perf_file_", fileext = ".csv")
29+
message(paste0("Additional perf record added to '", .perf.reference.save.filename, "'"))
30+
}
31+
32+
write.csv(.perf.reference, .perf.reference.save.filename, row.names = FALSE)
2633

2734
.perf.reference <<- .perf.reference
2835
}

0 commit comments

Comments
 (0)