marinaglancy/moodle-local_moodlecheck — pull request #1 by stronk7 (2012-01-29 02:09:05+00:00)
Title: Two commits, for better integration in CI tools

Hi Marina,

this pull request includes 2 commits, both detected when integrating your report in the reports run by the CI server:

1) I've noticed that the CLI (and the checker in general) requires one moodle installation to be running (config.php, DB... and friends). That's not really a problem because the whole "ci" world is, in fact, one "local" plugin too, hence, it's always installed within one moodle site.

But, it needs to be able to run the checker against any other directory. The CI server continuously gets git snapshots from integration.git, and they are stored into different "workspaces", none of them being "runnning" moodle instances (and different from the "ci" moodle server where the local/moodlechecker is installed".

The first commit enables that, so it a full path is passed and it's valid (file_exists), then your checker runs against any "remote" directory (aka, not the own where it is installed. Seems to be working ok here.

2) In order to make it a correct checkstyle xml file, the xml output was missing the xml preamble and the root element. The 2nd commit addresses that by introducing one new attribute to the class, in order to differentiate the "main/root" element from the rest and insert the missing xml code. I know it makes the possibility to check multiple paths from CLI and the XML output somehow incompatible, perhaps we should restrict such xml output to just accept one path. For your consideration. But I needed well-formed XML for proper integration, so I did that way.

Soon I'll start to auto/pre-check all the issues submitted to integration with it, I'm just in the steps of generating the final report with all the information gathered.

Also, surely, we could offer such reports for 3rd part plugins. Surely we would need to run some more checks (all those already existing in your new "plugins database" plugin). But I really think that it is pretty doable. In fact, the "plugin database" itself could trigger the execution of the complete tests automatically or whatever. Let's see, but could be interesting to have all the checks for any piece of code centralized and applied everywhere.

Sorry for the blah, blah, blah, lol, just wanted to share how I'm viewing the "whole picture" :-)

Ciao :-)