[Erp5-report] r41822 jm - in /erp5/trunk/products/ERP5Type/tests: run_unit_test sendMailToList

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Dec 28 11:38:47 CET 2010


Author: jm
Date: Tue Dec 28 11:38:47 2010
New Revision: 41822

URL: http://svn.erp5.org?rev=41822&view=rev
Log:
ERP5Type.tests: remove obsolete scripts

Removed:
    erp5/trunk/products/ERP5Type/tests/run_unit_test
    erp5/trunk/products/ERP5Type/tests/sendMailToList

Removed: erp5/trunk/products/ERP5Type/tests/run_unit_test
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/tests/run_unit_test?rev=41821&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/tests/run_unit_test [utf8] (original)
+++ erp5/trunk/products/ERP5Type/tests/run_unit_test (removed)
@@ -1,38 +0,0 @@
-#!/bin/bash
-DIRECTORY='/home/seb/zope/Products'
-export USER=seb
-rm -f $DIRECTORY/../unit_test/tests/zLOG.log
-rm -f $DIRECTORY/test_output
-touch $DIRECTORY/test_output
-rm -f $DIRECTORY/test_full_output
-touch $DIRECTORY/test_full_output
-$DIRECTORY/update_cvs
-
-if [ -d ${DIRECTORY}/ERP5/.svn ]
-then
-  svn info ${DIRECTORY}/ERP5 | grep -e '^R.vision[ \t]*:' \
-      >> ${DIRECTORY}/test_output
-fi
-
-# Excluded tests must be separated by whitespaces
-excluded_test_list="testCatalogSecurity"
-
-test_list=`/bin/ls -1 $DIRECTORY/*/tests/test*.py`
-
-for test in $test_list
-do
-  skip_test=0
-  test_name=`basename $test .py`
-  for excluded_test_name in $excluded_test_list
-  do
-    [ $test_name = $excluded_test_name ] && skip_test=1 && break
-  done
-  [ $skip_test -eq 1 ] && continue
-  $DIRECTORY/ERP5Type/tests/runUnitTest.py $test_name \
-      >> $DIRECTORY/test_full_output 2>&1
-done
-
-cat $DIRECTORY/test_full_output | grep '\(^OK\|^FAILED\|^Ran\)' | \
-    sed "/^FAILED.*\|^OK.*/s/.*/\0\n/g" >> $DIRECTORY/test_output
-
-$DIRECTORY/sendMailToList

Removed: erp5/trunk/products/ERP5Type/tests/sendMailToList
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/tests/sendMailToList?rev=41821&view=auto
==============================================================================
--- erp5/trunk/products/ERP5Type/tests/sendMailToList [utf8] (original)
+++ erp5/trunk/products/ERP5Type/tests/sendMailToList (removed)
@@ -1,79 +0,0 @@
-#!/usr/bin/python
-
-"""Parses the output of tests from test_output and test_full_output and sends
-an email to a list.
-Edit this script to change the recipients.
-"""
-
-import smtplib
-import re
-import os
-from datetime import date
-from email.MIMEText import MIMEText
-from email.MIMEBase import MIMEBase
-from email.MIMEImage import MIMEImage
-from email.MIMEMultipart import MIMEMultipart
-
-# configure this part if needed
-from_mail = 'nobody at erp5.org'
-to_mail   = [ 'erp5-report at erp5.org' ]
-INSTANCE_HOME = os.environ.get('INSTANCE_HOME', '/var/lib/zope')
-
-test_msg = file(
-      os.path.join(INSTANCE_HOME, "Products", "test_output"), 'r').read()
-test_msg = "Date : %s\n\n" % date.today().isoformat() + test_msg
-
-# minimal parsing 
-revision_re = re.compile('Revision: (?P<revision>\d+)')
-ran_test_re = re.compile('Ran (?P<tests>\d+) tests')
-errors_re = re.compile('FAILED \((failures=(?P<failures>\d+))*[, ]*'\
-                       '(errors=(?P<errors>\d+))*\)')
-svn_revision = "?"
-test_runs = 0
-errors = 0
-failures = 0
-for test_line in test_msg.splitlines():
-  revision = revision_re.match(test_line)
-  if revision:
-    svn_revision = revision.groupdict()['revision']
-  ran = ran_test_re.match(test_line)
-  if ran:
-    test_runs += int(ran.groupdict()['tests'])
-  errors_or_failures = errors_re.match(test_line)
-  if errors_or_failures:
-    failures += int(errors_or_failures.groupdict()['failures'] or 0)
-    errors += int(errors_or_failures.groupdict()['errors'] or 0)
-
-subject = "ERP5 r%s: %s Tests, %s Errors, %s Failures" % (
-                                  svn_revision, test_runs, errors, failures)
-
-msg = MIMEMultipart()
-msg['Subject'] = subject
-msg['From']    = from_mail
-msg['To']      = ', '.join(to_mail)
-# Add custom headers for client side filtering
-msg['X-ERP5-Tests'] = 'ERP5'
-if not (failures + errors):
-  msg['X-ERP5-Tests-Status'] = 'OK'
-
-# Guarantees the message ends in a newline
-msg.preamble = subject
-msg.epilogue = ''
-file_content = file(
-    os.path.join(INSTANCE_HOME, "Products", "test_full_output"), 'r').read()
-
-mime_text = MIMEText(test_msg)
-mime_text.add_header('Content-Disposition', 'attachment',
-                     filename='test_output.txt')
-msg.attach(mime_text)
-mime_text = MIMEText(file_content)
-mime_text.add_header('Content-Disposition', 'attachment',
-                     filename='test_full_output.txt')
-msg.attach(mime_text)
-
-# Send the email via our own SMTP server.
-s = smtplib.SMTP()
-s.connect()
-s.sendmail(from_mail, to_mail, msg.as_string())
-s.close()
-



More information about the Erp5-report mailing list