Conversation
| .build() | ||
| .options() | ||
| //.withRemoteDebugging() | ||
| //.withRemoteSurefireDebugging() |
There was a problem hiding this comment.
Sure, you could do that too :P straight from GH
| //.withRemoteSurefireDebugging() | ||
| .withSystemProperties(systemPropertiesPairs) | ||
| .withSystemProperties("graph.name", name.getMethodName()) | ||
| .withSystemProperties("smart.testing.debug", "true") // This will only be propagated to surefire for "not_reusing_forks" option |
There was a problem hiding this comment.
wouldn't be good to have these properties stored as constants somewhere...?
There was a problem hiding this comment.
Sure, it's still WIP as it needs to be aligned with Debug Mode once we have it.
There was a problem hiding this comment.
then add the label :-P
There was a problem hiding this comment.
or read the description :P
Graph is dumped when debug mode is enabled (should be aligned with #91)
| } | ||
| } | ||
|
|
||
| if (Boolean.valueOf(System.getProperty("smart.testing.debug", "false"))) { |
There was a problem hiding this comment.
The default value is not necessary here - from the javadoc of Boolean.valueof
/**
* Returns a {@code Boolean} with a value represented by the
* specified string. The {@code Boolean} returned represents a
* true value if the string argument is not {@code null}
* and is equal, ignoring case, to the string {@code "true"}.
*
* @param s a string.
* @return the {@code Boolean} value represented by the string.
*/
There was a problem hiding this comment.
Good catch, but this will be gone as soon as we align with #91
There was a problem hiding this comment.
It's a bit more than that - see #113 (comment)
| try { | ||
| new DOTExporter<JavaElement, DefaultEdge>(component -> "\"" + component.getClassName() + "\"", | ||
| null, null) | ||
| .exportGraph(graph, new File(System.getProperty("java.io.tmpdir") + "/graph-" + graphName + ".dot")); |
There was a problem hiding this comment.
Log also the information that it has been exported and the location of the file
There was a problem hiding this comment.
wouldn't make sense to store the file inside of target/smart-testing directory of the particular module/project? I guess, that this directory will contain all ST relevant information/files
There was a problem hiding this comment.
yeah - updated description with the tasks.
812738f to
ae0edb3
Compare
Short description of what this resolves:
While working on issues with Affected strategy I wrote a simple piece of code dumping graph to a
dotformat. This can be later used either using regular textdiffor make an image out of it. For examplewill produce graph in PNG format.
Changes proposed in this pull request:
GraphExporterproducing dot filesgraph.nameproperty or has random UUID insteadAs an example (to be removed before final merge) I used our forking test - this shows that we really need configuration file instead of relying on properties, as we are not propagating them to surefire forked processes and some tests don't dump their graphs.
Tasks
target/smart-testingdirectory of the particular module/projectFixes #136