Skip to content

Commit 1bf7f03

Browse files
Merge pull request #244 from LeireAbarrategui/v6.1-dev
V6.1 dev
2 parents 101c2c9 + c129f18 commit 1bf7f03

11 files changed

Lines changed: 343 additions & 48 deletions

File tree

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
^LICENSE.md$
55
^azure-pipelines\.yml$
66
^azure-pipelines_site\.pp$
7+
^azure-pipelines_site-dsdanger\.pp$
78
^azure-pipelines_check\.Rout$
89
^azure-pipelines_test\.Rout$
910
^checkDocumentationUpdated\.sh$

.Rd2pdf14688/Rd2.tex

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
\documentclass[a4paper]{book}
2+
\usepackage[times,inconsolata,hyper]{Rd}
3+
\usepackage{makeidx}
4+
\usepackage[latin1]{inputenc} % @SET ENCODING@
5+
% \usepackage{graphicx} % @USE GRAPHICX@
6+
\makeindex{}
7+
\begin{document}
8+
\chapter*{}
9+
\begin{center}
10+
{\textbf{\huge \R{} documentation}} \par\bigskip{{\Large of \file{ds.skewness.Rd}}}
11+
\par\bigskip{\large \today}
12+
\end{center}

.Rd2pdf7124/Rd2.tex

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
\documentclass[a4paper]{book}
2+
\usepackage[times,inconsolata,hyper]{Rd}
3+
\usepackage{makeidx}
4+
\usepackage[latin1]{inputenc} % @SET ENCODING@
5+
% \usepackage{graphicx} % @USE GRAPHICX@
6+
\makeindex{}
7+
\begin{document}
8+
\chapter*{}
9+
\begin{center}
10+
{\textbf{\huge \R{} documentation}} \par\bigskip{{\Large of \file{skewness.Rd}}}
11+
\par\bigskip{\large \today}
12+
\end{center}

azure-pipelines.yml

Lines changed: 135 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ resources:
4242
endpoint: datashield-testing
4343
name: datashield/testStatus
4444
ref: master
45-
45+
4646
- repository: datashield-infrastructureRepo
4747
type: github
4848
endpoint: datashield-testing
49-
name: datashield/datashield-infrastructure
50-
ref: v6.1-dev
49+
name: StuartWheater/datashield-infrastructure
50+
ref: v6.1-dev_dsdanger
5151

5252

5353
#########################################################################################
@@ -123,15 +123,19 @@ jobs:
123123
# Install R and all the dependencies dsBaseClient requires.
124124
# If previous steps have failed then don't run.
125125
- bash: |
126-
126+
127127
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
128128
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran40/"
129129
sudo apt-get update
130-
130+
131131
sudo apt-get install -qq libxml2-dev libcurl4-openssl-dev libssl-dev libgsl-dev r-base -y
132132
sudo R -q -e "install.packages(c('devtools','metafor','fields','covr'), dependencies=TRUE, repos='https://cloud.r-project.org')"
133133
sudo R -q -e "install.packages(c('DSI','DSOpal','DSLite'), dependencies=TRUE, repos='https://cloud.r-project.org')"
134-
sudo R -q -e "install.packages(c('e1071'), dependencies=TRUE, repos='https://cloud.r-project.org')"
134+
135+
sudo R -q -e "install.packages(c('DescTools','e1071'), dependencies=TRUE, repos='https://cloud.r-project.org')"
136+
137+
# XML grep for coverage report merging
138+
sudo apt-get install -qq xml-twig-tools -y
135139
136140
displayName: 'Install all dependencies for dsBaseClient'
137141
condition: succeeded()
@@ -158,10 +162,10 @@ jobs:
158162
echo "Run devtools::document() locally then commit again."
159163
exit 1
160164
else
161-
echo "Documentation up to date."
162-
exit 0
165+
echo "Documentation up to date."
166+
exit 0
163167
fi
164-
168+
165169
workingDirectory: $(Pipeline.Workspace)/dsBaseClient
166170
displayName: 'Check manual updated before being committed'
167171
condition: succeeded()
@@ -173,7 +177,7 @@ jobs:
173177
# If previous steps have failed then don't run.
174178
# If this step fails still mark as failed, but don't stop the rest of the steps running.
175179
- bash: |
176-
180+
177181
R -q -e "library('devtools'); devtools::check(args = c('--no-examples'))" | tee azure-pipelines_check.Rout
178182
grep --quiet "^0 errors" azure-pipelines_check.Rout && grep --quiet " 0 warnings" azure-pipelines_check.Rout && grep --quiet " 0 notes" azure-pipelines_check.Rout
179183
@@ -187,7 +191,7 @@ jobs:
187191
# Install dsBase. This uses the datashield-infrastructure repo (and its dependencies) to do the install with puppet.
188192
# If previous steps have failed then don't run.
189193
- bash: |
190-
194+
191195
# Set up puppet and r10k
192196
wget -nv https://apt.puppetlabs.com/puppet5-release-xenial.deb
193197
sudo dpkg -i puppet5-release-xenial.deb
@@ -197,11 +201,11 @@ jobs:
197201
198202
sudo apt-get install puppet-agent -y
199203
sudo /opt/puppetlabs/puppet/bin/gem install r10k
200-
204+
201205
pushd puppet/environments/datashield_azurepipelines
202206
sudo /opt/puppetlabs/puppet/bin/r10k puppetfile install
203207
popd
204-
208+
205209
sudo /opt/puppetlabs/bin/puppet apply $(Pipeline.Workspace)/dsBaseClient/azure-pipelines_site.pp --environment datashield_azurepipelines --environmentpath puppet/environments
206210
207211
workingDirectory: $(Pipeline.Workspace)/datashield-infrastructure
@@ -217,62 +221,152 @@ jobs:
217221
# TODO: Tidy up variable names - use timestamps here.
218222
# TODO: Why is DSLite needed for this to run?!
219223
- bash: |
220-
224+
221225
# There is an issue with the way we are using packages. The wrapped up test command
222226
# below fails in a way that implies that it is not installed. I cannot figure out
223227
# why this is case. As a work around we can run some of the functions below. My
224228
# best guess is that there is an implicit build or similar that happens. Although
225229
# I cannot replicate that directly with build etc directly.
226-
230+
227231
# None of the below make the tests run
228232
#sudo R -e 'devtools::reload(".")'
229233
#sudo R -e 'library(dsBaseClient)'
230234
#sudo R -e 'devtools::check_built()'
231235
#sudo R --verbose -e 'devtools::build()'
232-
236+
233237
# Any of the below makes the tests work.
234238
#sudo R --verbose -e 'devtools::test()'
235239
#sudo R --verbose -e 'devtools::install()'
236240
sudo R --verbose -e 'devtools::check()'
237-
241+
238242
pwd
239243
mkdir $(Pipeline.Workspace)/logs
240244
241245
# run the coverage tool and output to coveragelist.csv
242246
# testthat::testpackage uses a MultiReporter, comprised of a ProgressReporter and JunitReporter
243247
# R output and messages are redirected by sink() to test_console_output.txt
244248
# junit reporter output is to test_results.xml
249+
#
250+
# "_-|arg-|smk-|datachk-|disc-|math-|expt-|expt_smk-"
245251
sudo R -q -e '
246252
library(covr);
253+
dsbase.res <- covr::package_coverage(
254+
type = c("none"),
255+
code = c(
256+
'"'"'
257+
library(testthat);
258+
output_file <- file("test_console_output_dsbase.txt");
259+
sink(output_file);
260+
sink(output_file, type = "message");
261+
library(testthat);
262+
junit_rep <- JunitReporter$new(file = "test_results_dsbase.xml");
263+
progress_rep <- ProgressReporter$new(max_failures = 999999);
264+
multi_rep <- MultiReporter$new(reporters = list(progress_rep, junit_rep));
265+
testthat::test_package("$(projectName)", filter = "_-", reporter = multi_rep, stop_on_failure = FALSE)
266+
'"'"'
267+
)
268+
);
269+
base::saveRDS(dsbase.res, "test_results_dsbase.rds")'
270+
271+
# display the test console output
272+
cat test_console_output_dsbase.txt
273+
274+
grep --quiet "Failed: 0" test_console_output_dsbase.txt
275+
276+
workingDirectory: $(Pipeline.Workspace)/dsBaseClient
277+
displayName: 'Code coverage and JUnit report output, with dsBase'
278+
condition: succeeded()
279+
280+
281+
#####################################################################################
282+
# Install dsDanger on server
283+
# If previous steps have failed then don't run
284+
- bash: |
285+
286+
sudo /opt/puppetlabs/bin/puppet apply $(Pipeline.Workspace)/dsBaseClient/azure-pipelines_site-dsdanger.pp --environment datashield_azurepipelines --environmentpath puppet/environments
287+
288+
workingDirectory: $(Pipeline.Workspace)/datashield-infrastructure
289+
displayName: 'Install dsDanger DataSHIELD package on server'
290+
condition: succeeded()
291+
292+
293+
#####################################################################################
294+
# Install dsDangerClient.
295+
# If previous steps have failed then don't run
296+
- bash: |
297+
298+
sudo R -q -e 'devtools::install()'
299+
sudo R -q -e "library('devtools'); devtools::install_github(repo='datashield/dsDangerClient', ref='v6.1-dev', dependencies = TRUE)"
300+
301+
workingDirectory: $(Pipeline.Workspace)/dsBaseClient
302+
displayName: 'Install dsDangerClient DataSHIELD package'
303+
condition: succeeded()
304+
305+
306+
#####################################################################################
307+
# Essentially run devtools::test() on the checked out code. This is wrapped up with
308+
# code coverage. The actual command is vary convoluted as it had to do some things
309+
# which are not default behaviour: output the results to a JUnit xml file, not stop
310+
# when a small number of errors have happened, run through the code coverage tool.
311+
# TODO: Tidy up variable names - use timestamps here.
312+
- bash: |
313+
314+
# See, 'Code coverage and JUnit report output' for issues with the approach and improvement needed.
315+
sudo R --verbose -e 'devtools::check()'
316+
317+
pwd
318+
mkdir $(Pipeline.Workspace)/logs
319+
320+
# run the coverage tool and output to coveragelist.csv
321+
# testthat::testpackage uses a MultiReporter, comprised of a ProgressReporter and JunitReporter
322+
# R output and messages are redirected by sink() to test_console_output.txt
323+
# junit reporter output is to test_results.xml
324+
sudo R -q -e '
325+
library(covr);
326+
dsdanger.res <- covr::package_coverage(
327+
type = c("none"),
328+
code = c(
329+
'"'"'
330+
library(testthat);
331+
output_file <- file("test_console_output_dsdanger.txt");
332+
sink(output_file);
333+
sink(output_file, type = "message");
334+
library(testthat);
335+
junit_rep <- JunitReporter$new(file = "test_results_dsdanger.xml");
336+
progress_rep <- ProgressReporter$new(max_failures = 999999);
337+
multi_rep <- MultiReporter$new(reporters = list(progress_rep, junit_rep));
338+
testthat::test_package("$(projectName)", filter = "smk_dgr-",reporter = multi_rep, stop_on_failure = FALSE)
339+
'"'"'
340+
)
341+
);
342+
base::saveRDS(dsdanger.res, "test_results_dsdanger.rds")'
343+
344+
# Merge coverage results
345+
cat test_results_dsbase.txt test_results_dsdanger.txt > $(Pipeline.Workspace)/logs/test_console_output.txt
346+
xml_grep --pretty_print indented --wrap "testsuites" --descr "" --cond "testsuite" test_results_dsbase.xml test_results_dsdanger.xml > test_results.xml
347+
348+
# Create 'coveragelist.csv'
349+
sudo R -q -e '
350+
library(covr);
351+
dsbase.res <- base::readRDS("test_results_dsbase.rds")
352+
dsdanger.res <- base::readRDS("test_results_dsdanger.rds")
247353
write.csv(
248-
coverage_to_list(
249-
covr::package_coverage(
250-
type = c("none"),
251-
code = c(
252-
'"'"'library(testthat);
253-
output_file <- file("test_console_output.txt");
254-
sink(output_file);
255-
sink(output_file, type = "message");
256-
library(testthat);
257-
junit_rep <- JunitReporter$new(file = "test_results.xml");
258-
progress_rep <- ProgressReporter$new(max_failures = 999999);
259-
multi_rep <- MultiReporter$new(reporters = list(progress_rep, junit_rep));
260-
testthat::test_package("$(projectName)", filter = "$(test_filter)",reporter = multi_rep, stop_on_failure = FALSE)'"'"')
261-
)
262-
),
263-
"coveragelist.csv"
264-
)'
265-
354+
coverage_to_list(
355+
c(dsbase.res, dsdanger.res)
356+
"coveragelist.csv"
357+
)
358+
)'
359+
266360
# display the test console output
267-
cat test_console_output.txt
361+
cat test_console_output_dsdanger.txt
362+
268363
mv coveragelist.csv $(Pipeline.Workspace)/logs
269364
mv test_results.xml $(Pipeline.Workspace)/logs
270-
mv test_console_output.txt $(Pipeline.Workspace)/logs
271-
272-
grep --quiet "Failed: 0" $(Pipeline.Workspace)/logs/test_console_output.txt
365+
366+
grep --quiet "Failed: 0" test_console_output_dsdanger.txt
273367
274368
workingDirectory: $(Pipeline.Workspace)/dsBaseClient
275-
displayName: 'Code coverage and JUnit report output'
369+
displayName: 'Code coverage and JUnit report output, with dsBase and dsDanger'
276370
condition: succeeded()
277371
278372
@@ -281,7 +375,7 @@ jobs:
281375
# echo them so finding bugs should be easier.
282376
# This should run even if previous steps have failed.
283377
- bash: |
284-
378+
285379
# Strip out when error and failure = 0 and count the number of times it does not.
286380
issue_count=$(sed 's/failures="0" errors="0"//' test_results.xml | grep --count errors=)
287381
echo "Number of testsuites with issues: "$issue_count

azure-pipelines_site-dsdanger.pp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Datashield for Azure Pipelines testing.
2+
#
3+
# Install mysql and mongodb, include test data but don't install the firewall.
4+
# This is an example please change to meet the needs of your install. Consider changing any passwords in this file!
5+
#
6+
7+
class { ::datashield:
8+
opal_password => 'datashield_test&',
9+
opal_password_hash => '$shiro1$SHA-256$500000$gcnVxdEmOjaN+NfsK/1NsA==$UOobbhJsBBojnbsfzIBX9GTWjWQFi8aJZxFvFKmOiSE=',
10+
11+
test_data => true, # Install the test data
12+
firewall => false, # Do not install the firewall
13+
mysql => true, # Install mysql server
14+
mongodb => true, # Install mongodb server
15+
remote_mongodb => false, # There is not a remote mongodb server
16+
remote_mysql => false, # There is not a remote mysql server
17+
18+
dsbase_githubusername => 'datashield',
19+
dsbase_ref => 'v6.1-dev',
20+
dsdanger_githubusername => 'datashield',
21+
dsdanger_ref => 'v6.1-dev'
22+
}

azure-pipelines_site.pp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717

1818
dsbase_githubusername => 'datashield',
1919
dsbase_ref => 'v6.1-dev',
20-
dsstats_githubusername => 'datashield',
21-
dsstats_ref => '',
22-
dsgraphics_githubusername => 'datashield',
23-
dsgraphics_ref => '',
24-
dsmodelling_githubusername => 'datashield',
25-
dsmodelling_ref => ''
20+
dsdanger_githubusername => 'datashield',
21+
dsdanger_ref => ''
2622
}

man/.Rd2pdf7520/Rd2.tex

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
\documentclass[a4paper]{book}
2+
\usepackage[times,inconsolata,hyper]{Rd}
3+
\usepackage{makeidx}
4+
\usepackage[latin1]{inputenc} % @SET ENCODING@
5+
% \usepackage{graphicx} % @USE GRAPHICX@
6+
\makeindex{}
7+
\begin{document}
8+
\chapter*{}
9+
\begin{center}
10+
{\textbf{\huge \R{} documentation}} \par\bigskip{{\Large of \file{skewness.Rd}}}
11+
\par\bigskip{\large \today}
12+
\end{center}

0 commit comments

Comments
 (0)