test: switch from .log to .txt for log files

The current HTTP server for nightly.syncevolution.org reports the
content type for .txt files as plain text, but not for .log
files. Plain text is desirable for easy viewing in a web
browser. While the .log suffix is nicer, getting the HTTP server
reconfigured is hard and might have to be repeated again in the
future, so let's just use .txt.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
This commit is contained in:
Patrick Ohly 2020-03-02 03:52:33 -08:00
parent 83fe101576
commit 1bf4ce81b1
7 changed files with 44 additions and 44 deletions

4
.gitignore vendored
View File

@ -50,8 +50,8 @@ Makefile.in
# src
/src/autotroll.mk
/src/Client_Source_*.log
/src/Client_Sync_*.log
/src/Client_Source_*.txt
/src/Client_Sync_*.txt
/src/Client_Sync_*.A
/src/client-test
/src/LogDirTest

View File

@ -6817,7 +6817,7 @@ bool ClientTest::compare(ClientTest &client, const std::string &fileA, const std
if(compareLog && strlen(compareLog))
{
std::string cmdstr = std::string("synccompare ") + fileA + " " + fileB;
string tmpfile = "____compare.log";
string tmpfile = "____compare.txt";
cmdstr =string("bash -c 'set -o pipefail;") + cmdstr;
cmdstr += " 2>&1|tee " +tmpfile+"'";
success = system(cmdstr.c_str()) == 0;
@ -6894,7 +6894,7 @@ void ClientTest::postSync(int res, const std::string &logname)
int fd = open(serverLogFileName.c_str(), O_RDWR);
if (fd >= 0) {
int out = open((logname + ".server.log").c_str(), O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
int out = open((logname + ".server.txt").c_str(), O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
if (out >= 0) {
char buffer[4096];
bool cont = true;
@ -6904,7 +6904,7 @@ void ClientTest::postSync(int res, const std::string &logname)
while (cont && total < len) {
ssize_t written = write(out, buffer, len);
if (written < 0) {
perror(("writing " + logname + ".server.log").c_str());
perror(("writing " + logname + ".server.txt").c_str());
cont = false;
} else {
total += written;

View File

@ -141,7 +141,7 @@ public:
m_currentTest = test->getName();
std::cout << m_currentTest << std::flush;
if (!getenv("SYNCEVOLUTION_DEBUG")) {
string logfile = m_currentTest + ".log";
string logfile = m_currentTest + ".txt";
simplifyFilename(logfile);
m_logger.reset(new LogRedirect(LogRedirect::STDERR_AND_STDOUT, logfile.c_str()));
m_logger->setLevel(Logger::DEBUG);
@ -198,12 +198,12 @@ public:
}
m_logger.reset();
string logfile = m_currentTest + ".log";
string logfile = m_currentTest + ".txt";
simplifyFilename(logfile);
const char* compareLog = getenv("CLIENT_TEST_COMPARE_LOG");
if(compareLog && strlen(compareLog)) {
int fd = open("____compare.log", O_RDONLY);
int fd = open("____compare.txt", O_RDONLY);
if (fd >= 0) {
int out = open(logfile.c_str(), O_WRONLY|O_APPEND);
if (out >= 0) {
@ -223,7 +223,7 @@ public:
}
}
if (len < 0) {
perror("reading ____compare.log");
perror("reading ____compare.txt");
}
close(out);
}

View File

@ -35,7 +35,7 @@
<xsl:variable name="invalid-value" select="'invalid-value'"/>
<!-- log file suffix name -->
<xsl:variable name="log-file-suffix" select="'.log.html'"/>
<xsl:variable name="log-file-suffix" select="'.txt.html'"/>
<xsl:template match="/">
<xsl:choose>

View File

@ -88,7 +88,7 @@ def step1(resultdir, result, indents, dir, resulturi, shellprefix, srcdir):
files = os.listdir(resultdir)
files.sort()
for source in files:
m = re.match('(.*)-source.log', source)
m = re.match('(.*)-source.txt', source)
if m:
name = m.group(1)
result.write(' <source name="%s"><description><![CDATA[%s]]></description>\n' %
@ -324,7 +324,7 @@ def step2(resultdir, result, servers, indents, srcdir, shellprefix, backenddir):
result.write('>\n')
# sort files by creation time, to preserve run order
logs = map(lambda file: (os.stat(file).st_mtime, file),
glob.glob(resultdir+'/'+rserver+'/*.log'))
glob.glob(resultdir+'/'+rserver+'/*.txt'))
logs.sort()
logs = map(lambda entry: entry[1], logs)
logdic ={}
@ -336,7 +336,7 @@ def step2(resultdir, result, servers, indents, srcdir, shellprefix, backenddir):
# and "ok" resp. "FAIL/ERROR". Therefore failed tests
# are identified not by those words but rather by the separate
# error reports at the end of the output. Those reports
# are split out into separate .log files for easy viewing
# are split out into separate .txt files for easy viewing
# via the .html report.
#
# TestDBusServer.testCapabilities - Server.Capabilities() ... ok
@ -375,7 +375,7 @@ def step2(resultdir, result, servers, indents, srcdir, shellprefix, backenddir):
# create new (?!) log file
cl = m.group("cl")
func = m.group("func")
newname = rserver + "/" + cl + "_" + func + ".log"
newname = rserver + "/" + cl + "_" + func + ".txt"
if newname != name:
name = newname
logfile = open(name, "w")
@ -455,16 +455,16 @@ span.hl { color: #c02020 }
else:
for log in logs:
logname = os.path.basename(log)
if logname in ['____compare.log',
'syncevo.log', # D-Bus server output
'dbus.log', # dbus-monitor output
if logname in ['____compare.txt',
'syncevo.txt', # D-Bus server output
'dbus.txt', # dbus-monitor output
]:
continue
# <path>/Client_Sync_eds_contact_testItems.log
# <path>/SyncEvo_CmdlineTest_testConfigure.log
# <path>/N7SyncEvo11CmdlineTestE_testConfigure.log - C++ name mangling?
m = re.match(r'^(Client_Source_|Client_Sync_|N7SyncEvo\d+|[^_]*_)(.*)_([^_]*)\.log', logname)
if not m or logname.endswith('.server.log'):
# <path>/Client_Sync_eds_contact_testItems.txt
# <path>/SyncEvo_CmdlineTest_testConfigure.txt
# <path>/N7SyncEvo11CmdlineTestE_testConfigure.txt - C++ name mangling?
m = re.match(r'^(Client_Source_|Client_Sync_|N7SyncEvo\d+|[^_]*_)(.*)_([^_]*)\.txt', logname)
if not m or logname.endswith('.server.txt'):
print "skipping", logname
continue
# Client_Sync_, Client_Source_, SyncEvo_, ...

View File

@ -777,7 +777,7 @@ class GitCopy(GitCheckoutBase, Action):
self.runner = runner
self.sourcedir = sourcedir
self.revision = revision
self.patchlog = os.path.join(abspath(workdir), name + "-source.log")
self.patchlog = os.path.join(abspath(workdir), name + "-source.txt")
self.__getitem__ = lambda x: getattr(self, x)
@ -997,8 +997,8 @@ class SyncEvolutionTest(Action):
context.runCommand(basecmd,
resources=[self.name])
finally:
tocopy = re.compile(r'.*\.log|.*\.client.[AB]|.*\.(cpp|h|c)\.html|.*\.log\.html')
toconvert = re.compile(r'Client_.*\.log')
tocopy = re.compile(r'.*\.txt|.*\.log|.*\.client.[AB]|.*\.(cpp|h|c)\.html|.*\.txt\.html|.*\.log.html')
toconvert = re.compile(r'Client_.*\.txt')
htaccess = file(os.path.join(resdir, ".htaccess"), "a")
for f in os.listdir(actiondir):
if tocopy.match(f):
@ -1878,9 +1878,9 @@ class ActiveSyncTest(SyncEvolutionTest):
"Client::Sync::.*::testOneWayFromLocal,"
" "
"CLIENT_TEST_LOG=activesyncd.log "
"CLIENT_TEST_LOG=activesyncd.txt "
,
testPrefix=" ".join(("env EAS_DEBUG_FILE=activesyncd.log" + \
testPrefix=" ".join(("env EAS_DEBUG_FILE=activesyncd.txt" + \
((" GSETTINGS_SCHEMA_DIR=%s" % self.activesyncd_schema_dir) if self.activesyncd_schema_dir else ""),
os.path.join(sync.basedir, "test", "wrappercheck.sh"),
options.testprefix,
@ -1933,21 +1933,21 @@ context.add(test)
syncevoPrefix=" ".join([os.path.join(sync.basedir, "test", "wrappercheck.sh")] +
# redirect output of command run under valgrind (when
# using valgrind) or of the whole command (otherwise)
# to syncevohttp.log
# to syncevohttp.txt
( 'valgrindcheck' in options.testprefix and \
[ "VALGRIND_CMD_LOG=syncevohttp.log" ] or \
[ "--daemon-log", "syncevohttp.log" ] ) +
[ "VALGRIND_CMD_LOG=syncevohttp.txt" ] or \
[ "--daemon-log", "syncevohttp.txt" ] ) +
[ options.testprefix,
os.path.join(compile.installdir, "usr", "libexec", "syncevo-dbus-server"),
'--verbosity=3', # Full information about daemon operation.
'--dbus-verbosity=1', # Only errors from syncevo-dbus-server and syncing.
'--stdout', '--no-syslog', # Write into same syncevohttp.log as syncevo-http-server.
'--stdout', '--no-syslog', # Write into same syncevohttp.txt as syncevo-http-server.
'--duration=unlimited', # Never shut down, even if client is inactive for a while.
"--",
os.path.join(sync.basedir, "test", "wrappercheck.sh"),
# also redirect additional syncevo-http-server
# output into the same file
"--daemon-log", "syncevohttp.log",
"--daemon-log", "syncevohttp.txt",
"--wait-for-daemon-output", "syncevo-http:.listening.on.port.<httpport>",
os.path.join(compile.installdir, "usr", "bin", "syncevo-http-server"),
"--debug",
@ -1963,7 +1963,7 @@ test = SyncEvolutionTest("edsfile",
"Client::Sync::eds_event Client::Sync::eds_contact Client::Sync::eds_event_eds_contact",
[ "eds_event", "eds_contact" ],
"CLIENT_TEST_NUM_ITEMS=100 "
"CLIENT_TEST_LOG=syncevohttp.log "
"CLIENT_TEST_LOG=syncevohttp.txt "
# Slow, and running many syncs still fails when using
# valgrind. Tested separately below in "edsxfile".
# "CLIENT_TEST_RETRY=t "
@ -1988,7 +1988,7 @@ test = SyncEvolutionTest("edseds",
"Client::Sync::eds_event Client::Sync::eds_contact Client::Sync::eds_event_eds_contact",
[ "eds_event", "eds_contact" ],
"CLIENT_TEST_NUM_ITEMS=100 "
"CLIENT_TEST_LOG=syncevohttp.log "
"CLIENT_TEST_LOG=syncevohttp.txt "
# Slow, and running many syncs still fails when using
# valgrind. Tested separately below in "edsxfile".
# "CLIENT_TEST_RETRY=t "
@ -2012,7 +2012,7 @@ test = SyncEvolutionTest("edsxfile",
"Client::Sync::eds_contact::Retry Client::Sync::eds_contact::Resend Client::Sync::eds_contact::Suspend",
[ "eds_contact" ],
"CLIENT_TEST_NUM_ITEMS=100 "
"CLIENT_TEST_LOG=syncevohttp.log "
"CLIENT_TEST_LOG=syncevohttp.txt "
"CLIENT_TEST_RETRY=t "
"CLIENT_TEST_RESEND=t "
"CLIENT_TEST_SUSPEND=t "
@ -2040,7 +2040,7 @@ test = SyncEvolutionTest("davfile",
"CLIENT_TEST_SIMPLE_UID=1 " # DAViCal server gets confused by UID with special characters
"CLIENT_TEST_WEBDAV='davical caldav caldavtodo carddav' "
"CLIENT_TEST_NUM_ITEMS=10 "
"CLIENT_TEST_LOG=syncevohttp.log "
"CLIENT_TEST_LOG=syncevohttp.txt "
# could be enabled, but reporting result is currently missing (BMC #1009)
# "CLIENT_TEST_RETRY=t "
# "CLIENT_TEST_RESEND=t "
@ -2065,7 +2065,7 @@ test = SyncEvolutionTest("edsdav",
[ "eds_event", "eds_contact" ],
"CLIENT_TEST_SIMPLE_UID=1 " # DAViCal server gets confused by UID with special characters
"CLIENT_TEST_NUM_ITEMS=10 "
"CLIENT_TEST_LOG=syncevohttp.log "
"CLIENT_TEST_LOG=syncevohttp.txt "
# could be enabled, but reporting result is currently missing (BMC #1009)
# "CLIENT_TEST_RETRY=t "
# "CLIENT_TEST_RESEND=t "
@ -2089,7 +2089,7 @@ test = SyncEvolutionTest("fileeds",
"Client::Sync::file_event Client::Sync::file_contact",
[ "file_event", "file_contact" ],
"CLIENT_TEST_NUM_ITEMS=100 "
"CLIENT_TEST_LOG=syncevohttp.log "
"CLIENT_TEST_LOG=syncevohttp.txt "
# Slow, and running many syncs still fails when using
# valgrind. Tested separately below in "edsxfile".
# "CLIENT_TEST_RETRY=t "
@ -2113,7 +2113,7 @@ test = SyncEvolutionTest("filefile",
"Client::Sync::file_event Client::Sync::file_contact",
[ "file_event", "file_contact" ],
"CLIENT_TEST_NUM_ITEMS=100 "
"CLIENT_TEST_LOG=syncevohttp.log "
"CLIENT_TEST_LOG=syncevohttp.txt "
# Slow, and running many syncs still fails when using
# valgrind. Tested separately below in "edsxfile".
# "CLIENT_TEST_RETRY=t "
@ -2138,7 +2138,7 @@ test = SyncEvolutionTest("kdekde",
"Client::Sync::kde_event Client::Sync::kde_contact",
[ "kde_event", "kde_contact" ],
"CLIENT_TEST_NUM_ITEMS=100 "
"CLIENT_TEST_LOG=syncevohttp.log "
"CLIENT_TEST_LOG=syncevohttp.txt "
# Slow, and running many syncs still fails when using
# valgrind. Tested separately below in "edsxfile".
# "CLIENT_TEST_RETRY=t "
@ -2161,7 +2161,7 @@ test = SyncEvolutionTest("filekde",
"Client::Sync::file_event Client::Sync::file_contact",
[ "file_event", "file_contact" ],
"CLIENT_TEST_NUM_ITEMS=100 "
"CLIENT_TEST_LOG=syncevohttp.log "
"CLIENT_TEST_LOG=syncevohttp.txt "
# Slow, and running many syncs still fails when using
# valgrind. Tested separately below in "edsxfile".
# "CLIENT_TEST_RETRY=t "

View File

@ -592,16 +592,16 @@ class DBusUtil(Timeout):
# testAutoSyncFailure (__main__.TestSessionAPIsDummy) => testAutoSyncFailure_TestSessionAPIsDummy
self.testname = str(self).replace(" ", "_").replace("__main__.", "").replace("(", "").replace(")", "")
dbuslog = self.testname + ".dbus.log"
dbuslog = self.testname + ".dbus.txt"
if useGZip:
dbuslog = dbuslog + ".gz"
syncevolog = self.testname + ".syncevo.log"
syncevolog = self.testname + ".syncevo.txt"
self.pmonitor = subprocess.Popen(useGZip and ['sh', '-c', 'dbus-monitor | gzip'] or ['dbus-monitor'],
stdout=open(dbuslog, "w"),
stderr=subprocess.STDOUT)
if usingDLT:
dltlog = self.testname + ".dlt.log"
dltlog = self.testname + ".dlt.txt"
# dlt-receive buffers output and doesn't flush when killed.
# Trick it into writing each line immediately by pretending that
# it runs interactively. 'script' had side-effects on the calling