Commit graph

53 commits

Author SHA1 Message Date
Marco Mariani 79276bda95 cscli setup 2022-12-10 22:17:59 +01:00
mmetc fd3e668fe1
add -error flag to crowdsec binary (#1903) 2022-12-03 08:56:11 +01:00
mmetc 344b1dc559
fixed package tests w/wal, gitignore/typos (#1849) 2022-10-31 10:02:51 +01:00
mmetc 7866729d3b
func tests: don't return pid of started process unless asked (#1821) 2022-10-18 13:00:35 +02:00
mmetc 2b7e3ff1e7
warn if no acquisition files are found, acquisition_test refactoring, tests (#1816) 2022-10-17 17:32:08 +02:00
mmetc 8fecc2c00b
enable staticcheck linter; fixes (#1806)
- explicitly ignore returned parameters
 - replace Walk with faster WalkDir
 - log path error during hub dir sync
 - colorize static unit tests
 - removed duplicate import in crowdsec/main.go
 - typos
 - func tests: default datasource in tests/var/log instead of /tmp
 - action setup-go v3
2022-10-14 16:12:21 +02:00
mmetc 708fa8280a
add test and fix for configuration reload (#1808)
fix reload issue by returning new configuration to the signal loop

example: run crowdsec, disable agent in the config file, reload config.
Now there is no agent but the signal loop believes there is, so
triggering a reload configuration again will make the process hang
forever.
This commit updates the configuration in the signal loop with the one
returned by the signal handler.
2022-10-14 15:48:41 +02:00
mmetc a50a3362bd
bats helper fixes (#1792) 2022-10-07 16:17:36 +02:00
mmetc ddd75eae9a
cscli: new tables, --color yes|no|auto option (#1763) 2022-10-07 11:05:35 +02:00
mmetc af30ba0e3b
tests/bin cleanup (#1760) 2022-10-04 15:58:10 +02:00
blotus 9b3ff82542
add WAL support for sqlite (#1752) 2022-09-14 15:09:54 +02:00
mmetc faf3670e7f
Ansible changed_when fix; ansible/vagrant lint (#1734) 2022-09-06 11:33:50 +02:00
mmetc 6b18674960
func tests: enable capi only when needed (#1710) 2022-08-16 10:17:21 +02:00
mmetc 15a9e16530
functional tests: json, stderr helpers (#1704) 2022-08-05 10:54:49 +02:00
mmetc bd3722f075
Ansible testing improvements (#1700) 2022-08-04 11:25:34 +02:00
mmetc c742242094
Ansible testing (#1691) 2022-07-29 10:34:03 +02:00
AlteredCoder 16b1ab06a9
Add -a options in cscli alerts list (#1690)
* Add -a options in cscli alerts list
2022-07-28 17:31:53 +02:00
mmetc 804b6f4c5d
adjust test timing for slow boxes (#1681) 2022-07-26 09:47:56 +02:00
mmetc e13867f7c9
fix --column-statistics handling in mysql tests (#1680) 2022-07-25 16:25:57 +02:00
mmetc 37ada58f3a
func tests: fix database fixture for config-global (#1647) 2022-07-07 17:12:16 +02:00
mmetc 607b7d4b6f
config-global: don't remove init data; receive community pull (#1644) 2022-07-07 16:11:27 +02:00
mmetc e05515f79d
disable capi for tests by default (#1633) 2022-07-04 11:26:39 +02:00
mmetc e868adee2f
config_get, config_set test helpers (#1632) 2022-07-01 22:45:55 +02:00
mmetc 69dd8d2892
fix some tests in pipeline (#1622) 2022-07-01 10:16:45 +02:00
AlteredCoder 0a39066f9d
Fix #1552 (#1569) 2022-06-22 10:29:02 +02:00
mmetc b91fcb8e9b
Fixed bats tests for freebsd (#1600) 2022-06-22 10:00:51 +02:00
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
mmetc df7c51f34e
fixed coverage reporting for functional tests; added cscli (#1568) 2022-05-31 10:01:30 +02:00
mmetc bf3ea71630
add bats-mock to mock external commands in functional tests (#1529) 2022-05-19 09:58:13 +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
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
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 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
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 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