[Codenarc-developer] Test against Grails
Brought to you by:
chrismair
From: Chris M. <chr...@ea...> - 2011-09-24 14:15:44
|
Hamlet, I have checked in the RunCodeNarcAgainstGrails class. Note that it is a Groovy/Java app rather than a test case. You must set the "grails.home" system property within the Run Configuration to run from IDEA. This is the same ruleset that I used for the sample Grails/Gradle reports. Feel free to tweak as needed. Once we get it the way we want it, I will probably do something similar for running against Gradle and then use those to generate the sample reports for the online docs. The (very) informal performance testing that I did was to run against both Grails and Gradle source trees -- one top-level Ant task that called two sub-tasks. As I mentioned above, my plan is to also create a similar class to run against Gradle source. But if providing a combined script helps you with relative performance testing, we certainly can create that, too. I was testing against version 1.3.7 of Grails. I downloaded 2.0.0.M2 (zip file) but that does not seem to contain the test source. What is the recommended way to get ALL of the source now? Git, I assume. If it is easy for you to paste in the Git command, that might help me get started Chris -----Original Message----- From: Hamlet DArcy [mailto:ham...@ca...] Sent: Monday, September 19, 2011 8:40 AM To: chris mair Cc: Cod...@li... Subject: Re: [Codenarc-developer] AstUtils rewrite - can you test against Grails? The RunCodeNarcAgainstCodeNarc test is really useful, because I can make my changes and then run YourKit through IDEA for performance benchmarks. It's slick because YourKit allows you to jump back and forth between IDE and the benchmarks. All we'd need to do is clone that test, point it at the Grails source on disk (which we both have), share your codenarc.properties file, and then run it as a unit test. Seems simple, and a more real-world benchmark, even if we alos set the test to @Ignore or comment it out. I wouldn't bother pointing CodeNarc at an SVN repo, unless it were integrated into the CodeNarc web console. But then, it's not a useful tool so much as a gateway to demonstrate the power of CodeNarc. I think our efforts are still better suited towards expanding the ruleset. By the way, the GMetrics rules are the biggest bottleneck right now. I'm estimating a 15% or higher performance improvement if we rewrite the GMetrics AstUtils. The other feature I'd really like is a CodeNarc properties visual editor. You could run it from the command line or through the Grails plugin. It could pop open a Swing UI that looks like the IDEA inspections UI. That would be a nice way to edit rule. But I'd want the feature to use only core JDK/Groovy classes so we don't introduce extra dependencies. -- Hamlet ----- Original Message ----- > Hamlet, > > I will rebuild and run against Grails+Gradle again. > > In my current setup, I build a CodeNarc jar (mvn package) and copy > that jar to a separate directory where I already have the other jars > (GMetrics and Log4J) and a bat file to execute it. I point it at a > locally-installed instance of the Grails source (and also Gradle > source). This was not really (originally) intended as a performance > benchmark, but more as a way to generate the sample reports and also > be a regression test at the same time. > > Running CodeNarc against a Git or SVN repo, or against a jar/zip file > for that matter, are still only potential future features. Does > automating any of the above make sense as a unit test? > > Chris > -----Original Message----- > From: Hamlet D'Arcy [mailto:ham...@gm...] > Sent: Monday, September 19, 2011 7:11 AM > To: Cod...@li... > Subject: [Codenarc-developer] AstUtils rewrite - can you test against > Grails? > > Hi Chris, > > I finally got my merge issues resolved and checked in. > > I rewrite AstUtil.groovy to be AstUtil.java. It gave me less > performance improvements than I expected on my test run. I am seeing > about 4% improvement total, which is not very much, IMO. > > Can you try running the latest against Grails? How are you doing that? > I propose that we add a unit test to the > RunCodeNarcAgainstCodeNarcTest that runs the code against the Grails > source. We can comment out the test so it never runs with the build, > but then at least we share the same benchmark? My current benchmark is > just running CodeNarc against CodeNarc. What do you think? > > > -- > Hamlet D'Arcy > ham...@gm... > > ---------------------------------------------------------------------- > -------- BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, > CA Learn about the latest advances in developing for the > BlackBerry® mobile platform with sessions, labs & more. > See new tools and technologies. Register for BlackBerry® DevCon > today! > http://p.sf.net/sfu/rim-devcon-copy1 > _______________________________________________ > Codenarc-developer mailing list > Cod...@li... > https://lists.sourceforge.net/lists/listinfo/codenarc-developer > > ---------------------------------------------------------------------- > -------- BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, > CA Learn about the latest advances in developing for the > BlackBerry® mobile platform with sessions, labs & more. > See new tools and technologies. Register for BlackBerry® DevCon > today! > http://p.sf.net/sfu/rim-devcon-copy1 > _______________________________________________ > Codenarc-developer mailing list > Cod...@li... > https://lists.sourceforge.net/lists/listinfo/codenarc-developer > ---------------------------------------------------------------------------- -- BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA Learn about the latest advances in developing for the BlackBerry® mobile platform with sessions, labs & more. See new tools and technologies. Register for BlackBerry® DevCon today! http://p.sf.net/sfu/rim-devcon-copy1 _______________________________________________ Codenarc-developer mailing list Cod...@li... https://lists.sourceforge.net/lists/listinfo/codenarc-developer |