Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 33 additions & 34 deletions .github/workflows/dsBaseClient_test_suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
timeout-minutes: 180
permissions:
contents: read

# These should all be constant, except TEST_FILTER. This can be used to test
# subsets of test files in the testthat directory. Options are like:
# '*' <- Run all tests.
Expand All @@ -33,7 +33,7 @@ jobs:
_r_check_system_clock_: 0
WORKFLOW_ID: ${{ github.run_id }}-${{ github.run_attempt }}
PROJECT_NAME: dsBaseClient
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
REPO_OWNER: ${{ github.repository_owner }}
R_KEEP_PKG_SOURCE: yes
GITHUB_TOKEN: ${{ github.token || 'placeholder-token' }}
Expand All @@ -53,7 +53,7 @@ jobs:
path: testStatus
persist-credentials: false
token: ${{ env.GITHUB_TOKEN }}

- name: Uninstall default MySQL
run: |
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
Expand All @@ -63,7 +63,7 @@ jobs:
sudo apt-get autoremove -y
sudo apt-get autoclean -y
sudo rm -rf /var/lib/mysql/

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
Expand All @@ -83,29 +83,29 @@ jobs:
sudo apt-get install -qq libharfbuzz-dev libfribidi-dev libmagick++-dev xml-twig-tools -y
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')"
sudo R -q -e "devtools::install_github(repo='datashield/dsDangerClient', ref=Sys.getenv('BRANCH_NAME'))"

- uses: r-lib/actions/setup-r-dependencies@v2
with:
dependencies: 'c("Imports")'
extra-packages: |
any::rcmdcheck
cran::devtools
cran::git2r
cran::RCurl
cran::readr
cran::magrittr
cran::xml2
cran::purrr
cran::dplyr
cran::stringr
cran::tidyr
cran::quarto
cran::knitr
cran::kableExtra
cran::rmarkdown
cran::downlit
extra-packages: |
any::rcmdcheck
cran::devtools
cran::git2r
cran::RCurl
cran::readr
cran::magrittr
cran::xml2
cran::purrr
cran::dplyr
cran::stringr
cran::tidyr
cran::quarto
cran::knitr
cran::kableExtra
cran::rmarkdown
cran::downlit
needs: check

- name: Check manual updated
run: |
orig_sum=$(find man -type f | sort -u | xargs cat | md5sum)
Expand All @@ -124,7 +124,7 @@ jobs:
grep --quiet "^0 errors" azure-pipelines_check.Rout && grep --quiet " 0 warnings" azure-pipelines_check.Rout && grep --quiet " 0 notes" azure-pipelines_check.Rout
working-directory: dsBaseClient
continue-on-error: true

- name: Start Armadillo docker-compose
run: docker compose -f docker-compose_armadillo.yml up -d --build
working-directory: dsBaseClient
Expand All @@ -144,7 +144,7 @@ jobs:
sleep 30
curl -u admin:admin -X POST http://localhost:8080/whitelist/dsBase
working-directory: dsBaseClient

- name: Run tests with coverage & JUnit report
run: |
mkdir -p logs
Expand All @@ -168,11 +168,11 @@ jobs:
),
"coveragelist.csv"
)'

mv coveragelist.csv logs/
mv test_* logs/
working-directory: dsBaseClient

- name: Check for JUnit errors
run: |
issue_count=$(sed 's/failures="0" errors="0"//' test_results.xml | grep -c errors= || true)
Expand All @@ -190,7 +190,7 @@ jobs:
echo "R:$(R --version | head -n1)" >> ${{ env.WORKFLOW_ID }}.txt
Rscript --vanilla -e 'sessionInfo()' >> session_info_${{ env.WORKFLOW_ID }}.txt
working-directory: dsBaseClient/logs

- name: Parse results from testthat and covr
run: |
Rscript --verbose --vanilla ../testStatus/source/parse_test_report.R logs/ logs/ https://github.com/datashield/${{ env.PROJECT_NAME }}/blob/${{ env.BRANCH_NAME }} '([^:]+)' '(?<=::)[^:]+(?=::)'
Expand All @@ -202,24 +202,24 @@ jobs:
- name: Render report
run: |
cd testStatus

mkdir -p new/logs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/
mkdir -p new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/
mkdir -p new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/latest/

# Copy logs to new logs directory location
cp -rv ../dsBaseClient/logs/* new/logs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/
cp -rv ../dsBaseClient/logs/${{ env.WORKFLOW_ID }}.txt new/logs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/

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))'
mv source/test_report.html new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/index.html
cp -r new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/* new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/latest

env:
PROJECT_NAME: ${{ env.PROJECT_NAME }}
BRANCH_NAME: ${{ env.BRANCH_NAME }}
WORKFLOW_ID: ${{ env.WORKFLOW_ID }}

- name: Upload test logs
uses: actions/upload-artifact@v4
with:
Expand All @@ -245,4 +245,3 @@ jobs:
R -e 'sessionInfo()'
sudo apt install tree -y
tree .

2 changes: 1 addition & 1 deletion opal_azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ jobs:
# Install dsBase.
# If previous steps have failed then don't run.
- bash: |
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)"
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)"

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)"

Expand Down
11 changes: 9 additions & 2 deletions tests/testthat/perf_tests/perf_rate.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------

.perf.reference.filename <- 'perf_files/default_perf_profile.csv'
.perf.reference.filename <- 'perf_files/default_perf_profile.csv'
.perf.reference.save.filename <- NULL

.perf.reference <- NULL

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

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

write.csv(.perf.reference, .perf.reference.filename, row.names = FALSE)
if (is.null(.perf.reference.save.filename))
{
.perf.reference.save.filename <<- base::tempfile(pattern = "perf_file_", fileext = ".csv")
message(paste0("Additional perf record added to '", .perf.reference.save.filename, "'"))
}

write.csv(.perf.reference, .perf.reference.save.filename, row.names = FALSE)

.perf.reference <<- .perf.reference
}
Expand Down