From 75fcf0ed6f617b6987fa5b392b5422e861b2c8d1 Mon Sep 17 00:00:00 2001 From: Florian Angerer <florian.angerer@oracle.com> Date: Thu, 7 Sep 2017 18:00:09 +0200 Subject: [PATCH] Inserted printing of time stamps in package tests. --- .../analyzer/parser/LogFileParser.java | 21 ++++++++++++++++++- .../r/install.packages.R | 5 +++++ mx.fastr/mx_fastr_pkgs.py | 6 ++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/com.oracle.truffle.r.test.packages.analyzer/src/com/oracle/truffle/r/test/packages/analyzer/parser/LogFileParser.java b/com.oracle.truffle.r.test.packages.analyzer/src/com/oracle/truffle/r/test/packages/analyzer/parser/LogFileParser.java index a54286695d..57ddf81a2a 100644 --- a/com.oracle.truffle.r.test.packages.analyzer/src/com/oracle/truffle/r/test/packages/analyzer/parser/LogFileParser.java +++ b/com.oracle.truffle.r.test.packages.analyzer/src/com/oracle/truffle/r/test/packages/analyzer/parser/LogFileParser.java @@ -233,6 +233,8 @@ public class LogFileParser { } installTest.setMode(mode); + timestamp(); + Section installationTask = parseInstallationTask(); installTest.addSection(installationTask); if ("FastR".equals(mode)) { @@ -244,15 +246,17 @@ public class LogFileParser { installTest.addSection(testing); installTest.setSuccess(testing.isSuccess() && success); expect(Token.END_INSTALL_TEST); + timestamp(); return installTest; } private Section parseTesting() throws IOException { expect(Token.BEGIN_PACKAGE_TESTS); - Section packageTests = new Section(logFile, Token.BEGIN_PACKAGE_TESTS.linePrefix, curLine.lineNr); + timestamp(); + if (("install failed, not testing: " + getPkgName()).equals(trim(la.text))) { consumeLine(); packageTests.setSuccess(false); @@ -263,6 +267,7 @@ public class LogFileParser { packageTests.setSuccess(true); } expect(Token.END_PACKAGE_TESTS); + timestamp(); return packageTests; } @@ -338,17 +343,21 @@ public class LogFileParser { private Section parseInstallationTask() throws IOException { expect(Token.BEGIN_INSTALLATION); Section installation = new Section(logFile, Token.BEGIN_INSTALLATION.linePrefix, curLine.lineNr); + timestamp(); Section processing = parseProcessingTask(); installation.addSection(processing); expect(Token.END_INSTALLATION); + timestamp(); return installation; } private Section parseProcessingTask() throws IOException { expect(Token.BEGIN_PROCESSING); Section installation = new Section(logFile, Token.BEGIN_PROCESSING.linePrefix, curLine.lineNr); + timestamp(); installation.problems = applyDetectors(Token.BEGIN_PROCESSING, logFile.path, collectBody(Token.END_PROCESSING)); expect(Token.END_PROCESSING); + timestamp(); return installation; } @@ -382,12 +391,15 @@ public class LogFileParser { expect(Token.BEGIN_SUGGESTS_INSTALL); Section section = new Section(logFile, Token.BEGIN_SUGGESTS_INSTALL.linePrefix, curLine.lineNr); + timestamp(); + // collect body of this section Collection<Problem> problems = applyDetectors(Token.BEGIN_SUGGESTS_INSTALL, logFile.path, collectBody(Token.END_SUGGESTS_INSTALL)); section.problems = problems; expect(Token.END_SUGGESTS_INSTALL); + timestamp(); return section; } @@ -528,6 +540,12 @@ public class LogFileParser { } } + void timestamp() throws IOException { + if (laMatches(Token.TIMESTAMP)) { + consumeLine(); + } + } + LogFileParseException parseError(String message) { throw new LogFileParseException(message, pkg, getCurrentLocation()); } @@ -646,6 +664,7 @@ public class LogFileParser { MISSING_OUTPUT_FILE("FastR is missing output file:"), CONTENT_MALFORMED("content malformed: "), OUTPUT_MISMATCH_FASTR("FastR output mismatch: "), + TIMESTAMP("timestamp: "), TESTING_EXAMPLES("Testing examples for package"), RUNNING_SPECIFIC_TESTS("Running specific tests for package"), diff --git a/com.oracle.truffle.r.test.packages/r/install.packages.R b/com.oracle.truffle.r.test.packages/r/install.packages.R index f0ae104d39..27dea0522e 100644 --- a/com.oracle.truffle.r.test.packages/r/install.packages.R +++ b/com.oracle.truffle.r.test.packages/r/install.packages.R @@ -509,6 +509,7 @@ install.pkgs <- function(pkgnames, dependents.install=F, log=T) { for (pkgname in pkgnames) { if (log) { cat("BEGIN processing:", pkgname, "\n") + cat("timestamp: ", Sys.time(), "\n") } dependent.install.ok <- T if (install.dependents.first && !dependents.install) { @@ -558,6 +559,7 @@ install.pkgs <- function(pkgnames, dependents.install=F, log=T) { } if (should.install) { cat("installing:", pkgname, "(", install.count, "of", install.total, ")", "\n") + cat("timestamp: ", Sys.time(), "\n") this.result <- install.pkg(pkgname) result <- result && this.result if (dependents.install && !this.result) { @@ -653,6 +655,7 @@ do.it <- function() { if (install) { cat("BEGIN package installation\n") + cat("timestamp: ", Sys.time(), "\n") install.pkgs(test.pkgnames) cat("END package installation\n") show.install.status(test.pkgnames) @@ -675,10 +678,12 @@ do.it <- function() { # need to install the Suggests packages as they may be used cat('BEGIN suggests install\n') + cat("timestamp: ", Sys.time(), "\n") install.suggests(test.pkgnames) cat('END suggests install\n') cat("BEGIN package tests\n") + cat("timestamp: ", Sys.time(), "\n") test.count = 1 test.total = length(test.pkgnames) for (pkgname in test.pkgnames) { diff --git a/mx.fastr/mx_fastr_pkgs.py b/mx.fastr/mx_fastr_pkgs.py index cbb2916463..ffa0a1a4bc 100644 --- a/mx.fastr/mx_fastr_pkgs.py +++ b/mx.fastr/mx_fastr_pkgs.py @@ -33,6 +33,7 @@ In either case all the output is placed in the fastr suite dir. Separate directo and tests, namely 'lib.install.packages.{fastr,gnur}' and 'test.{fastr,gnur}' (sh syntax). ''' from os.path import join, relpath +from datetime import datetime import shutil, os, re import subprocess import mx @@ -100,9 +101,14 @@ def _create_testdot(rvm): os.mkdir(testdir) return testdir +def _log_timestamp(state, step, rvariant): + if not quiet: + print "timestamp: {0}".format(str(datetime.now())) + def _log_step(state, step, rvariant): if not quiet: print "{0} {1} with {2}".format(state, step, rvariant) + _log_timestamp() def _packages_test_project(): return 'com.oracle.truffle.r.test.packages' -- GitLab