Skip to content

DevelopmentEnvironment

Howard Jones edited this page Apr 19, 2015 · 5 revisions

Weathermap comes in 3 reasonably complex bits:

  1. The actual weathermap core - reading configs, collecting data, drawing maps. Deals with DS plugins etc too.
  2. The editor - closely coupled to #1, quite a lot of client-side code. Includes the data picker.
  3. The cacti plugin - two parts to that: the UI that you see in Cacti, and the poller function that allow us to collect data from Cacti and also to run on schedule.
  4. The testing environment and its infrastructure. A lot of the dependencies listed below for NPM and Composer are actually for testing the code, or building it.

I make use of various package management tools to collect up the external dependencies for Weathermap and keep them up to date. Bower for web/javascript stuff, Composer for PHP, and NPM for command-line javascript tools (mainly Bower). All of this is stored in the vendor/ directory. The only thing that I can't do that with is Overlib, which doesn't exist as a Bower package, so is statically copied into the vendor/ directory.

There is a script in the git repo called dev-bootstrap.sh that should get a Ubuntu system up to speed. It install Node (with NPM), then Bower, then Composer, then kicks off the installation of the packages in bower.json and composer.json, plus ImageMagick, which is used by the tests for image comparison.

After that, try running ./test.sh which should kick off all the PHPunit tests. You see results on the console, but especially for the image-based tests, you can browse results. cd test-suite; php -S 0.0.0.0:8000 will get you a quick and dirty web browser on http://{yourserver}:8000/ for recent PHP versions. You can browse the image tests, or just the failed image tests, to see what the diffs were from the reference images.

For a lot of things, you don't actually need Cacti. In theory, only changes to the setup.php or cacti-* files will need it. Once code-coverage for lib/cacti-* is above 0%, I hope that those will be testable without Cacti, even (or with just a dummy copy of the Cacti code).

Also, starting with this post-0.97 version, the Makefile actually builds a distribution in the dist/ directory, which is what gets zipped/tarred for release. You can't just git clone into your Cacti plugins folder anymore. Sorry about that. That means that code changes

Clone this wiki locally