Re: Log Merge

"John Burrows" <[email protected]>
Newsgroups gmane.comp.java.cruise-control.user
Message-ID <[email protected]>
Keith,

Add an Init or Clean target to your process to run immediately in the beginning to either delete and recreate the log folder or its contents or just the log file. I have shown an example of each below, just have one of the delete tasks in there to take care of the cleanup and you will never import another old log again.

Ant Example:

   <!-- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -->
   <!-- TARGET clean :  Perform old file cleanup                  -->
   <!-- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -->

	<target name="clean" description="Remove files from the previous run">
		<echo message="Removing files from the previous run..."/>
		<!-- Delete the complete folder -->
		<delete includeEmptyDirs="true" failonerror="false">
			<fileset dir="${builddir}/build/logs"/>
		</delete>
		<!-- Delete the folder contents: All files -->
		<delete>
			<fileset dir="${builddir}/build/logs" includes="**/*"/>
		</delete>	  
		<!-- Delete only the log file -->
		<delete file="${builddir}/build/logs/phpunit.xml"/>
	</target>


John Burrows

Notice: This communication contains information that may be privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is strictly prohibited. If you received this transmission in error, please immediately contact the sender and delete this communication.


-----Original Message-----
----------------------------------------------------------------------

Message: 1
Date: Wed, 3 Mar 2010 16:30:13 -0800
From: "Keith Tyler" <[email protected]>
Subject: [Cruisecontrol-user] (no subject)
To: <[email protected]>
Message-ID:
	<6A120BDA36EB10428EFCDA033A8CC7EA028336B4@CORP-MSG-01.CORP.GMI.LCL>
Content-Type: text/plain; charset="us-ascii"

Hi all, LTLFTC. I am hoping there is a simple solution and my apologies
if it has already been answered. I did try to search the ML archives.
All rights reserved, etc.

Anyway. We use CC to automate seleniumRC testing via PHPUnit under an
Ant script. PHPUnit is set to emit junit log format with filename
$builddir/build/logs/phpunit.xml, which we use <log><merge> to hook into
the CC log. (We also use PHPUC but that probably isn't relevant).

Sometimes, the build blows up for whatever reason, and the phpunit.xml
doesn't get created. But the one left over from the previous run is
still there. <log><merge> happily snaps this up and slurps it into the
CC log. The result will be a status page with the same results as the
previous (or some prior) run, with updated build timestamps.

Is there an option to <merge> to have it delete the slurped original
file after it has been incorporated? This way it would be a lot more
obvious that things had blown up as there would be no results. Or will I
have to resort to a custom cleanup publisher?

Thanks,
Kdt



------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.