Commit graph

61 commits

Author SHA1 Message Date
mmetc c78c833400
CI: colored test output, colored crowdsec and crowdsec-api logs, full final db dump for mysql and sqlite (#1596)
* github-ci: color unit test output and logs
* new config option: force_color_logs (useful in CI)
* bats: show sqlite/mysql dump at the end
* removed "-v" (print package names) from "go build"
* general workflow cleanup
2022-06-17 16:12:49 +02:00
mmetc b572f64dc6
removed bats warnings (#1592) 2022-06-15 15:36:36 +02:00
mmetc 67841d54ee
updated bats to 1.7.0; shellcheck fixes and moved cfssl dir under testdata/ (#1584) 2022-06-13 21:54:47 +02:00
Thibault "bui" Koechlin 1c0fe09576
Add support for certificate authentication for agents and bouncers (#1428) 2022-06-08 16:05:52 +02:00
mmetc 799cc82bb5
functional tests, minor refactoring and lint/cleanup (#1570)
* cmd/crowdsec: removed log.Fatal()s, added tests and print error for unrecognized argument
* updated golangci-lint to v1.46
* lint/deadcode: fix existing issues
* tests: cscli config backup/restore
* tests: cscli completion powershell/fish
* err check: pflags MarkHidden()
* empty .dockerignore (and explain the reason)
* tests, errors.Wrap
* test for CS_LAPI_SECRET and minor refactoring
* minor style changes
* log cleanup
2022-06-06 15:24:48 +02:00
mmetc df7c51f34e
fixed coverage reporting for functional tests; added cscli (#1568) 2022-05-31 10:01:30 +02:00
mmetc 88a4801d6a
allow run-tests with -f "<test-name>" (#1564) 2022-05-28 22:10:27 +02:00
mmetc 8ea9e83798
Codecov (#1561)
* fix coverage report (#1553)

* codecov
2022-05-24 17:22:08 +02:00
mmetc 4b843d145a
cscli: avoid double output (error + log fatal) and automatic --help after each error (#1536) 2022-05-19 13:42:44 +02:00
mmetc cdab206d05
tests for misconfigured plugins (#1534) 2022-05-19 13:27:24 +02:00
mmetc 9c1c4093a3
func test: replaced one-shot bin/nc with a loop (#1542) 2022-05-19 10:51:45 +02:00
mmetc 131ed1b0a7
error reporting (#1501)
* unified error reporting, removed redundancy, tests
2022-05-19 10:48:08 +02:00
mmetc bf3ea71630
add bats-mock to mock external commands in functional tests (#1529) 2022-05-19 09:58:13 +02:00
mmetc 7c7fe70cb2
test multiple notification events with the same plugin (#1539) 2022-05-19 09:54:26 +02:00
mmetc 98f2ac5e7c
fix #1385: .yaml.local (#1497)
Added support for .yaml.local files to override values in .yaml
2022-05-18 10:08:37 +02:00
mmetc b8547da4c3
"make localstack" target, link to docs/contributing (#1522) 2022-05-17 15:54:52 +02:00
blotus 0449ec1868
Windows Support (#1159) 2022-05-17 12:14:59 +02:00
mmetc 2dcce2ae72
fix pipeline alert tests (#1491) 2022-04-28 14:42:42 +02:00
Greg Myers 0f4ab71f01
Fix typos in docs, comments, code (#1483) 2022-04-27 11:04:12 +02:00
mmetc 6de175ad8a
support yq prior to 4.18.1 (#1466) 2022-04-20 15:05:34 +02:00
Manuel Sabban d9f111c4ca
fix a bug in tests (#1458)
* is_db_sqlite is not accessible

Co-authored-by: sabban <15465465+sabban@users.noreply.github.com>
2022-04-19 20:00:48 +02:00
Thibault "bui" Koechlin e6a35e8714
Improve plugins grouping (alternative to #1424) (#1437)
* Fix races in test (#1446)

Co-authored-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
Co-authored-by: alteredCoder <kevin@crowdsec.net>
Co-authored-by: AlteredCoder <64792091+AlteredCoder@users.noreply.github.com>
2022-04-19 19:12:23 +02:00
mmetc 0f7f21a7db
fix clean/create in pgdump/restore (#1457) 2022-04-19 15:49:37 +02:00
mmetc 4771d04a9d
Tests readme (#1456) 2022-04-19 15:01:46 +02:00
mmetc 2044a0677e
bats: ignore pre-installed hub objects like whitelist etc. (#1455) 2022-04-19 14:22:59 +02:00
mmetc d6d9bdd2ec
db tests CI: skip jobs by default; fix pg dump; check client requirements (#1454) 2022-04-19 11:41:50 +02:00
mmetc 4b9a0c4ef7
typos (#1453) 2022-04-19 11:25:27 +02:00
Manuel Sabban 37756e8082
improve test packaging (#1443)
* improve tests for packaging

Co-authored-by: sabban <15465465+sabban@users.noreply.github.com>
Co-authored-by: mmetc <92726601+mmetc@users.noreply.github.com>
2022-04-15 15:39:17 +02:00
mmetc 5f2797c83c
more func test coverage; capture exit code for bincover (#1425) 2022-04-13 15:44:23 +02:00
mmetc 17ed27052c
save fixture with community data (#1440) 2022-04-13 15:17:49 +02:00
mmetc bf4bc0c9fc
single workflow for all tests, with bats coverage (#1413) 2022-04-05 11:00:11 +02:00
mmetc c54c9f2951
skip broken tests (w/ postgres and test coverage) (#1410) 2022-04-01 15:03:17 +02:00
mmetc 058237c9dd
install *.cover binaries in $BIN_DIR; minor workflow changes (#1408) 2022-04-01 14:12:03 +02:00
mmetc b202e387cf
fix "cscli" without arguments (#1406) 2022-03-31 16:50:38 +02:00
Manuel Sabban b076f1d582
allow DB_BACKEND to be expanded (#1400)
* allow DB_BACKEND to be expanded

Co-authored-by: sabban <15465465+sabban@users.noreply.github.com>
2022-03-30 11:33:26 +02:00
Manuel Sabban 16b9fd82f0
Update bats tests to work with systemd (#1394)
* update for making it work with systemd
* take DB_BACKEND from file name; reduce duplicated code; configure db_type=sqlite
* define PACKAGE_TESTING

Co-authored-by: sabban <15465465+sabban@users.noreply.github.com>
Co-authored-by: mmetc <92726601+mmetc@users.noreply.github.com>
2022-03-29 17:06:49 +02:00
mmetc 3f24bcdbcf
pg tests: pass now, waiting for fix (#1393)
* PG* variable names
* take DB_BACKEND from file name; reduce duplicated code; configure db_type=sqlite
2022-03-28 10:41:32 +02:00
mmetc 2f18808d68
print db logs after tests (#1390) 2022-03-25 12:17:28 +01:00
mmetc 7329a9d4b2
mysql test: delays in strem test (#1387) 2022-03-24 14:50:52 +01:00
mmetc caf1dc71fb
allow capi register in functional tests (#1384) 2022-03-24 11:07:54 +01:00
mmetc 7ff67c2311
mysql tests: silence password warnings (#1386) 2022-03-24 09:22:11 +01:00
mmetc 7baa5d623b
pgx driver tests (#1379) 2022-03-23 11:13:23 +01:00
mmetc 0667552132
bats: postgres tests (#1377)
* split CI/bats in sqlite+mysql+mariadb+hub
* renamed db and user 'crowdsec' to 'crowdsec-test'; moved backend-specific scripts to lib/db, etc.
* postgres tests
* force delay between ipv6 tests (for myisam)
* force delay after pg_restore to ensure data is written
2022-03-21 15:51:05 +01:00
Manuel Sabban b792c45921
Mysql enabled tests (#1372)
* add msyql backend test

Co-authored-by: sabban <15465465+sabban@users.noreply.github.com>
2022-03-18 17:36:51 +01:00
mmetc c2708ab6c0
Bats: "reformat" script for shfmt, longer timeout for crowdsec (#1373) 2022-03-18 14:46:05 +01:00
mmetc af8c55330d
[wip] bats changes for modular fixtures (#1371)
* target: tests/.environment.sh
* don't pass BIN_DIR around
* manage db backup/restore separately
* don't export CONFIG_DIR, DATA_DIR (derive path locations from
CONFIG_YAML); redirect stdout, stderr to &3 by default in setup_file,
teardown_file
2022-03-18 10:13:12 +01:00
mmetc f7f4ca9541
use yq instead of envsubst (#1366) 2022-03-17 12:28:45 +01:00
mmetc 9a6a254a90
test decision list -m (#1365) 2022-03-17 12:20:08 +01:00
mmetc 81793fe8bf
dummy plugin (#1342) 2022-03-16 09:30:04 +01:00
Thibault "bui" Koechlin 548b0b5518
bit of doc + tests for lapi stream mode (#1356)
* bit of doc + tests for lapi stream mode
2022-03-15 17:16:33 +01:00