Skip to content

Commit 5f5c197

Browse files
Merge pull request #271 from StuartWheater/ci-phase-iii
CI for bugs setup, transfer more tests to 'bug's class
2 parents 2526ae8 + 320f2ca commit 5f5c197

63 files changed

Lines changed: 507 additions & 102 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

R/ds.glmPredict.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,13 @@ if(obj.name.exists.in.all.sources && obj.non.null.in.all.sources){ #
229229
#
230230
if(no.errors){ #
231231
validity.check<-paste0("<",test.obj.name, "> appears valid in all sources") #
232-
print(list(is.object.created=return.message,validity.check=validity.check)) #
232+
# print(list(is.object.created=return.message,validity.check=validity.check)) #
233233
} #
234234
#
235235
if(!no.errors){ #
236236
validity.check<-paste0("<",test.obj.name,"> invalid in at least one source. See studyside.messages:") #
237-
print(list(is.object.created=return.message,validity.check=validity.check, #
238-
studyside.messages=studyside.message)) #
237+
# print(list(is.object.created=return.message,validity.check=validity.check, #
238+
# studyside.messages=studyside.message)) #
239239
} #
240240
#
241241
#END OF CHECK OBJECT CREATED CORECTLY MODULE #

azure-pipelines.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,59 @@ jobs:
401401
condition: succeededOrFailed()
402402
403403
404+
#####################################################################################
405+
# Essentially run devtools::test() on the checked out code for bug reporting.
406+
# The actual command is vary convoluted as it had to do some things
407+
# which are not default behaviour: output the results to a JUnit xml file, not stop
408+
# when a small number of errors have happened, run through the code coverage tool.
409+
# TODO: Tidy up variable names - use timestamps here.
410+
- bash: |
411+
412+
# junit reporter output is to test_results_bug.xml
413+
sudo R -q -e '
414+
library(testthat);
415+
output_file <- file("test_console_output_bug.txt");
416+
sink(output_file);
417+
sink(output_file, type = "message");
418+
junit_rep <- JunitReporter$new(file = "test_results_bug.xml");
419+
progress_rep <- ProgressReporter$new(max_failures = 999999);
420+
multi_rep <- MultiReporter$new(reporters = list(progress_rep, junit_rep));
421+
testthat::test_package("$(projectName)", filter = "__bug-|datachk_bug-|smk_bug-|arg_bug-|disc_bug-|smk_expt_bug-|expt_bug-|math_bug-", reporter = multi_rep, stop_on_failure = FALSE)'
422+
423+
cat test_console_output_bug.txt
424+
425+
mv test_results_bug.xml $(Pipeline.Workspace)/logs
426+
427+
workingDirectory: $(Pipeline.Workspace)/dsBaseClient
428+
displayName: 'Bug report output'
429+
condition: succeededOrFailed()
430+
431+
432+
#####################################################################################
433+
# Parse the JUnit file to see if there are any errors/warnings. If there are then
434+
# echo them so finding bugs should be easier.
435+
# This should run even if previous steps have failed.
436+
- bash: |
437+
438+
# Strip out when error and failure = 0 and count the number of times it does not.
439+
issue_count=$(sed 's/failures="0" errors="0"//' test_results_bug.xml | sed 's/errors="0" failures="0"//' | grep --count errors=)
440+
echo "Number of testsuites with issues: "$issue_count
441+
echo "Testsuites with issues:"
442+
sed 's/failures="0" errors="0"//' test_results_bug.xml | sed 's/errors="0" failures="0"//' | grep errors= > issues.log
443+
cat issues.log
444+
no_issue_count=$(sed 's/failures="0" errors="0"//' test_results_bug.xml | sed 's/errors="0" failures="0"//' | grep -v --count errors=)
445+
echo
446+
echo "Number of testsuites with no issues: "$no_issue_count
447+
echo "Testsuites with issues:"
448+
sed 's/failures="0" errors="0"//' test_results_bug.xml | sed 's/errors="0" failures="0"//' | grep "<testsuite " | grep -v errors= > no_issues.log
449+
cat no_issues.log
450+
exit 0
451+
452+
workingDirectory: $(Pipeline.Workspace)/logs
453+
displayName: 'Bug summary report output'
454+
condition: succeededOrFailed()
455+
456+
404457
#####################################################################################
405458
# Output some important version numbers to file. This gets added to the testStatus
406459
# commit so it can be parsed and used on the status table.
8.87 KB
Binary file not shown.
8.36 KB
Binary file not shown.
2.75 KB
Binary file not shown.
23 KB
Binary file not shown.
21.8 KB
Binary file not shown.
23.8 KB
Binary file not shown.
111 KB
Binary file not shown.
110 KB
Binary file not shown.

0 commit comments

Comments
 (0)