BoxLang: Our new JVM Dynamic Language made by Ortus! Check it out: https://www.boxlang.io

Debug labels and telemetry additions

Description

Right now there is no way to label debug output, resulting in an overwhelming amount of data if you debug from many tests, or just debug lots of data.

It would be nice if the debug method accepted a label attribute, and either defaulted the label to the spec name [ possibly a compiled spec name in the case of describe(describe(describe(it()))) ], or included both, such as:

debug("foo", function(){ debug("bar", function(){ it("does stuff", function(){ debug(1, "my label"); }); }); });

It would be nice if the cfdump label attribute was set to "foo / bar / stuff - my label"

Implementation Update

The debug() now accepts a label argument which will be used to render out a custom label on the data snapshot. However, we also added the capability to auto-calculate labels that will be added to the label if no custom label is defined. The pattern of the label is the complete path to the spec even if you are nested within describe blocks. This works on BDD and xUnit approaches

This auto-calculation only works in synchronous mode, due to that async testing has no control of what spec is currently executing. Maybe investigate at a later point in time how a label can be taken from the thread scope instead

We also added a few other telemetry elements to the debug output for info purposes: timestamp, thread. This tells you the timestamp of the debug snapshot and the status of threads.

Gliffy Diagrams

Activity

Show:

Luis Majano September 8, 2014 at 10:37 PM

You can always get our integration builds here: http://integration.staging.ortussolutions.com/artifacts/ortussolutions/testbox/2.1.0/

And you can navigate starting from here for everything we do http://integration.staging.ortussolutions.com/artifacts

Adam Tuttle September 8, 2014 at 2:43 PM

Where can I get a build with these changes included to test it out? I don't see it on GitHub.

Adam Tuttle September 6, 2014 at 12:19 AM

I haven't looked at the underlying code, but couldn't you just pass the current-cumulative label into the thread being used for async, and append onto it as necessary, when you nest deeper and deeper?

No matter, even just being able to set a specific label in the debug method would be a welcome addition, even if it didn't list the describe/spec names.

Luis Majano September 5, 2014 at 10:12 PM

Adding a label is a great idea Adam.

The problem with adding the spec name is that it is harder than it seems as
you also have to account for async executions. Also there is not a single
pointer that tells you what it is executing unles you are in sync mode.

So I was
Hesitant to add a label that only worked in sync mode. Anyways I guess
maybe adding it and in async mode not offering it.

On Friday, September 5, 2014, Adam Tuttle (JIRA) <

Luis Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
ContentBox Platform: http://www.gocontentbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Social: twitter.com/ortussolutions | twitter.com/coldbox |
twitter.com/lmajano | twitter.com/gocontentbox

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Components

Fix versions

Priority

Sentry

Created September 5, 2014 at 9:22 PM
Updated September 8, 2014 at 10:37 PM
Resolved September 6, 2014 at 5:11 PM

Flag notifications