Hi,

first of all I have to admit that I have no experience with the runtime you're using. But the following line looks suspicious:

> fs.appendFileSync('executionData/'+ this.logFileId +'.exec', data.toString());

Exec files are pure binary data. If this line does any byte/string conversations this will probably corrupt the content. Make sure to actually dump the binary content of the buffer.

For further analysis the fill error message and stack trace when reading the exec file would be useful.

Regards,
-marc

On 10.05.16 23:59, [email protected] wrote:
Hi,
I've got an e2e test suite that runs cucumber/protractor tests and I'm trying 
to hook that into server code coverage (mixed with client coverage). I've got 
part way there with the agent successfully responding to a node tcp socket 
connection:

const buf = new Buffer([0x01,0xc0,0xc0,0x10,0x07]);
// block header
this.write(buf);
// BLOCK_CMDDUMP 64 = 0x40
const buf2 = new Buffer(1);
buf2.writeInt8(64);
this.write(buf2);

//Dump flag and reset flag (both true)
buf3 = new Buffer([0x01,0x01]);
this.write(buf3);

agents[i].client.on('data', function(data) {
         //only write execution data if there actually is data to write (avoid 
empty files)
         if (data && data.toString().trim() != "" ) {
           mkpath.sync('executionData', 0700);
           fs.appendFileSync('executionData/'+  this.logFileId +'.exec', 
data.toString());
         }
         this.end();
       });


The binary data written to the log file at a glance looks ok to me and similar 
to what the maven and ant tasks output. But upon trying to generate a report 
from the data the java code complains that it is invalid.

I'm hoping someone here is an expert on the format of the execution data and 
can see something I've done wrong... or might point me towards a spec on the 
exeecution data so I can validate it somehow.



--
Marc Hoffmann
[email protected]
_______________________________________________
Mountainminds GmbH & Co. KG

Nussbaumstr. 4 * 80336 Muenchen * Germany
Phone/Fax +49-700-68664637 * 0700-MTNMINDS

Registergericht Muenchen * HRA 80201
Mountainminds Verwaltungs GmbH
Registergericht Muenchen * HRB 143183
Geschaeftsfuehrer Marc Hoffmann

--
You received this message because you are subscribed to the Google Groups "JaCoCo 
and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/57325B2E.6090707%40mountainminds.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to