Commit Graph

32 Commits

Author SHA1 Message Date
Tony Murray
ce21011aff
Rewrite development helper to lnms dev:check (#11650)
* Refactor pre-commit to class

* docs build

* dusk check

* ci mode for checks

* full checks

* other mysql

* make other lint checks actually work
fix pylint finding

* ci is a long opt

* fix undefined index

* dusk fully working

* ask for forgiveness, not permission

* fix whitespace

* skip dusk sometimes

* Handle 3com and other os with digits

* flags instead of if else spaghetti

* convert to command

* cleanup

* missed check

* fixes

* case

* self-check :D

* argument now

* fix bugs from refactors

* another fix

* adjust file change parsing

* refactor execut a bit

* fallback to global quiet when unknown type.

* allow quiet override for specific commands

* output cleanup

* check flow

* start of tests

* file categorizer tests and fixes

* fixes and cleanup

* skipable not implemented...

* more tests, fix bugs

* more tests and cleanup

* wrong command

* fix canCheck and set env properly

* full env fix

* don't allow dusk on user's run as it will erase their db.

* fix os option

* fix whitespace

* don't need to start server

* ci doesn't like that
2020-05-22 20:27:48 -05:00
Tony Murray
d4225806a8
Run docs tests when only docs are modified. (#11483) 2020-04-25 21:43:03 -05:00
Tony Murray
1c08c11a77
Remove Laravel helpers (#11428)
* Remove Laravel helpers

* Replace qualifier with import
2020-04-18 00:37:56 +02:00
Jellyfrog
e111fe690e
Disable xdebug on travis-ci (#11409)
* Disable xdebug on travis-ci

* Update pre-commit.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
2020-04-12 09:11:00 -05:00
Tony Murray
c36f913cfb
Don't skip style tests for os that have PHP files (#10053) 2019-04-01 15:49:55 -05:00
Tony Murray
1def6897a6
allow pre-commit.php to work without changes (#9597)
* allow pre-commit.php to work without changes

* make it actually work :D
2018-12-28 20:05:52 -06:00
Tony Murray
be642f0173
Include test data in tests os filter (#9387) 2018-10-25 13:44:17 -05:00
Tony Murray
daec72f8a0 Move ext-mysqlnd to suggested for now (even though it is actually required) (#9229)
* Move ext-mysqlnd to suggested for now (even though it is actually required)
Remove extra dependency version locks, they are more trouble than they are worth.  I just run composer with php 5.6 when updating composer.lock.
Update dependencies.

* Trigger full build on composer updates

* Update composer.json
2018-09-20 00:05:10 +01:00
Tony Murray
2c7a19712f Run all tests in os group when testing specific OS (#9235)
https://phpunit.de/manual/6.5/en/textui.html#textui.examples.filter-patterns

DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
After you are done testing, you can remove the changes with `./scripts/github-remove`.  If there are schema changes, you can ask on discord how to revert.
2018-09-19 23:18:15 +01:00
Tony Murray
87ed73ec5c More specific test filtering (#9226)
DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
After you are done testing, you can remove the changes with `./scripts/github-remove`.  If there are schema changes, you can ask on discord how to revert.
2018-09-18 20:54:22 +01:00
Neil Lathwood
5e9d032e16 Speed up testing based on changed files (#9214)
* Speed up testing based on changed files

* Updated to use phpunit instead of foreach loop
2018-09-17 21:32:41 -05:00
Tony Murray
d08593e8d6
Only run unit tests on 7.2 (#9201)
* Only run unit tests on 7.2
Move style check to 7.1

* stop build when a script fails
2018-09-13 12:18:42 -05:00
Tony Murray
fc77900266 fix pre-commit.php --quiet (#8771)
DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
2018-05-26 09:11:38 +01:00
Tony Murray
8afafe7eb0 refactor: pre-commit.php updates (#8679)
Disable the log for unit tests to speed things up hopefully
2018-05-09 12:53:45 +01:00
Tony Murray
8c94ccf4d6 refactor: Use custom phpcs ruleset for LibreNMS (#8418)
* Use custom phpcs ruleset for LibreNMS
PSR2 with exclusions

* Don't check line length

* Restore build_excludes()
Drop influxdb lib exclusion

* Fix whitespace
2018-03-20 11:32:52 +00:00
Tony Murray
dc2883f59d Use composer wrapper in pre-commit (#8192) 2018-02-03 22:40:15 +00:00
Tony Murray
b2a54dae3b
Testing updates: module testing and collect only (#8063)
* Testing updates module testing and collect only

* cache clear no-longer needed.
2018-01-09 11:40:26 -06:00
Tony Murray
20865b0ca4
OS Testing update (#7971)
* OS Testing update
Option on pre-commit.php to run tests for just one OS. Reorganize tests a bit to support this.
Improved bgp-peers capture and os module capture (initial)
Better output when phpunit tests fail

* fix a couple issues.  Better output for another

* Use the correct setup function
2017-12-28 16:12:08 -06:00
Tony Murray
fff66d3c00
Feature: Generic discovery and poller tests (#7873)
* Processor Tests!

* Capture data from live devices easily.

* fix up some stuff, remove powerconnect things as they seem to be just broken.

* formatting, fix missing assignment
add netonix processor data

* fix multi-line, always add sysDescr and sysObjectID
ios cpm test file

* revert composer change and fix whitespace issues

* add help text

* missed help text

* tighter debug output

* handle empty strings properly and mibs with numbers

* use keys for sorting as intended

* fix type with empty data

* oops :)

* whitespace fix

* try installing fping

* Fix TestCase collision + cleanup

* mark TestCase as abstract
don't run two instances of snmpsim

* better database dumps, improved capture

* style fixes

* fix quotes add a few more tables

* add --prefer-new, properly merge data

* Support separate discovery and poller data. But don't waste space if they aren't needed.

* refactor to use class
collects all code in one place for reusability

* reorganize

* Print out when not saving.

* Support for running multiple (or all) modules at once.

* tidy

* Change unit test to a generic name and test all modules we have data for.

* Add documentation and a few more tidies

* whitespace fixes

* Fix tests, add a couple more modules, more docs

* More docs updates

* Fix scrutinizer issues

* add bgp-peers
2017-12-20 08:36:49 -06:00
Tony Murray
839dd31093 feature: Added pre-commit git script to support failing fast 2017-01-24 21:37:49 +00:00
Tony Murray
e20a242785 refactor: use Composer to manage php dependencies (#5216) 2017-01-01 09:37:15 +00:00
Neil Lathwood
f5a16be0e3 refactor: Move OS definitions into yaml files (#5189) 2016-12-23 17:53:19 +00:00
Tony Murray
cab2597807 Remove some debug output.
Don't call terminate on null (it will be called automatically anyway)
2016-09-23 15:24:24 -05:00
Tony Murray
c31b3c0301 feature: use snmpsim for testing
fallback feature so we don't have to run snmpsim on devel computers, should be adequate for now
./scripts/pre-commit.php -u -snmpsim will start an snmpsimd.py process automatically
2016-09-23 14:57:31 -05:00
Tony Murray
a6ed7cc888 feature: pre-commit script: allow test order based on command line option order (#4393) 2016-09-10 17:42:27 +01:00
Neil Lathwood
6e8e00e204 fix: Added config.php to be excluded in psr2 pre-commit check (#4260) 2016-08-29 15:09:21 -05:00
Tony Murray
883a0e6fd3 Check that commands are available for pre-commit.php. (#4257)
If not install them with composer, If composer isn't available, spit out an error message and direct them to the documentation.
2016-08-29 20:18:52 +01:00
Tony Murray
abc6a5b799 PSR-2 Final cleanup (#4247)
refactor: Final PSR2 cleanup
2016-08-28 23:32:55 +01:00
Tony Murray
b7d0b97c64 More pre-commit.php improvements (#4224)
* more pre-commit.php improvements
do not check influx-db on hhvm
Use parallel-lint to increase lint check speed and improve output
Add option to print out the commands that would be executed, makes it easier to modify them and run by hand
Fixed a couple of bugs

* Integrate the environment check
Flip it so we don't interfere with command line users
2016-08-28 21:44:36 +01:00
Tony Murray
9284bc60ff Update code in includes to be PSR-2 compliant (#4220)
refactor: Update code in /includes to be psr2 compliant #4220
2016-08-28 18:32:58 +01:00
Tony Murray
f042f9aa56 Use pre-commit.php in for travis-ci tests (#4212) 2016-08-26 10:30:43 +01:00
Neil Lathwood
9f1930a81e More more docs (#4197)
* Updated docs + some small code changes

* Added validating code doc for developers

* Doc updates

* Updates and improvements
2016-08-25 18:40:11 -05:00