Commit Graph

34 Commits

Author SHA1 Message Date
Andrew Lewis
548f117986 [Test] url-redirector 2021-04-13 14:06:36 +01:00
Andrew Lewis
960b608d35 [Feature] Add controller endpoint for training neural
- Move neural functions to library
 - Parameterise spawn_train
 - neural plugin: Fix store_pool_only when autotrain is true
 - neural plugin: Use cache_set instead of mempool
 - Add test
2020-12-17 11:28:09 +02:00
Andrew Lewis
aa3d119209 [Test] Use Python3 for functional tests
- Fix more deprecated Robot Framework syntax
 - Remove log following
 - Remove some artefacts in teardown
 - Restore use of demjson
2020-06-25 21:34:48 +02:00
Vsevolod Stakhov
129fa4d454 [Test] Add avast test cases 2020-02-01 18:07:05 +00:00
denpamusic
edb449b3b9
[Minor] Fix typos in p0f plugin
- Improved tests to include cached response cases
- Changed default socket location to /var/run/p0f as per @moisseev recommendation
2019-09-18 18:29:43 +03:00
denpamusic
e4e8e675b6
[Feature] Add p0f scanner 2019-09-15 23:15:44 +03:00
Vsevolod Stakhov
4f1f869748 [Test] Add large https body test 2019-08-14 09:56:06 +01:00
Vsevolod Stakhov
b7c397e222 [Test] More test fixes 2019-08-12 16:50:37 +01:00
Vsevolod Stakhov
3a4242c276 [Test] Improve ssl test 2019-08-12 15:26:35 +01:00
Vsevolod Stakhov
1e3d20ef44 [Test] Add dummy ssl echo server 2019-05-31 15:19:29 +01:00
Vsevolod Stakhov
c28363722f [Test] Fix sockets reusing 2019-05-31 15:19:00 +01:00
Vsevolod Stakhov
6f72e868f5 [Test] Add tests for lua_udp 2019-01-21 17:04:05 +00:00
Vsevolod Stakhov
7957fc516a [Test] Add dummy udp client 2019-01-21 16:26:41 +00:00
Anton Yuzhaninov
97a9de3854 Fix coverage (#2603)
* Add utility to prepare C coverage for upload to coveralls.io

It turned out that it is more easy to write own script then debug
and fix coveralls utility (https://github.com/eddyxu/cpp-coveralls).

gcov-coveralls.py can be used as a replacement for coveralls.

* Save coverage data from .gcda files only once

Coverage data in .gcda files is merged after each binary invocation,
so we can run all test and then gather coverage data.

If we dump them two times execution counts will be more then they be.

* Switch from coveralls (cpp-coveralls) to own script

Problem with coveralls was, that coverage for source files outside build
directory was not added to the report.

* Add tool to dump info from json for coveralls.io

* Add debug

* Fix: don't die if there is no service_job_id in json

* Debug

* Fix dump_coveralls.py

* Rename to gcov_coveralls.py (s/-/_/)

For most files in this repo '_' is used as separator.

* Don't add source code to coveralls JSON

According to https://docs.coveralls.io/api-introduction
Coverals don't need source code, only MD5 digest to tracks changes.

Anyway source code is already added by luacov-coveralls and source_digest
is added by cpp-coveralls and gcov_coveralls.py
Both options seems to work for now.

* Provide path to source directory to merge_coveralls.py

merge_coveralls.py has code to filter files and remove prefixes.
When --root points to source directory merge_coveralls.py can strip
prefix from absolute path in JSONs generated by luacov-coveralls.

* Style

Don't add parameters with default values.

* Make --output optional

It useful mainly for debugging. We can send report without saving it.

* Log CI_COMMIT_AUTHOR env var

It is not clear from drone.io source how CI_COMMIT_AUTHOR variable is
set. Log it to see what it means.

* Move merge_coveralls.py to test/tools

This script is used not only for funcional test coverage, but for
rspamd-test coverage too.

* Remove debug

* Style

Use more compact formatting.

* Write comment about parallel tests running [SKIP CI]

Document why running tests in parallel may be bad idea (but still do so).

* Fix typo [SKIP CI]
2018-10-20 09:15:40 +01:00
Anton Yuzhaninov
f866b85dd2 Add git repo info to coveralls payload
Again other implementations were used as reference, because API is not
fully documented.
2018-10-15 21:01:58 -04:00
Anton Yuzhaninov
ee0de90803 Drone coverage fix (#2592)
* Build as nobody

This showld fix coverage files writing. At least some coverage files
(*.gcda, *.gcno) are written by rspamd running as nobody.

* Comment luacov-coveralls

* Run rspamd-test as nobody too

* Run coveralls from build root (/rspamd/build)

It need to find all `.gcda` files.

* Hack for coveralls was moved to Docker image

* Add test debug

* More debug

* Workaround to writing *.gcda from different users

*.gcda files written in parallel by root and by nobody

* Remove debug

* Use current build number instead of previous

* Remove unused variable

* Add more parameters

- If CI detected we don't need to check if service_job_id and other
fields in json already filled - this info anyway comes from environment

- coveralls.io API is not documented. Code from:
https://github.com/lemurheavy/coveralls-ruby/
and
https://github.com/coveralls-clients/coveralls-python/
was used as an example.

* In case of error there is no url in json respnse

Print message field anyway - it can contain useful error message.

* Add debug

* Simplify

* Fix: for pull request CI_BUILD_EVENT set to 'pull_request'

* Remove debug
2018-10-14 09:38:57 +01:00
Vsevolod Stakhov
b8447825ac [Minor] Python... 2018-10-13 15:35:59 +01:00
Vsevolod Stakhov
96385ea4e6 [Minor] Python... 2018-10-13 15:24:34 +01:00
Vsevolod Stakhov
901f84c357 [Minor] Fucking python 2018-10-13 14:59:48 +01:00
Vsevolod Stakhov
581ce37bc8 [Minor] Another try to fix bloody python 2018-10-13 14:48:01 +01:00
Vsevolod Stakhov
7a58e9057c [Minor] Further try to fix bloody python 2018-10-13 14:33:28 +01:00
Vsevolod Stakhov
feff3ee1e9 [Minor] Use python3 2018-10-13 14:19:14 +01:00
Anton Yuzhaninov
f1223526c7 Drone speedup (#2588)
* Start switchind test to custom Docker images

Using Docker images with pre-installed delendencies will speedup
testing.

* Debug build in drone.io

* Use variable instead hardcoded path to the source

* Debug variable substitution by drone

Also according to comments in code DRONE_WORKSPACE is deprecated and
CI_WORKSPACE is a new form.

* One more try to use variables.

It looks like drone uses same rules as docker-compose:
https://docs.docker.com/compose/compose-file/#variable-substitution

* Cleanup debug

* Less verbose make output

* Be consistent in variable escaping

It works without escaping only becuse ${VAR} currently expanded by
drone, but $VAR is not.

* Use alpine base image for nodejs

It is smaller.

* Return rspamd-test

* Revert variable escaping

Wihtout escaping it is more easy to copy-past command for testing.
Just don't use ${var} when var should be expanded by shell and not
drone.

* Add debug

* Fix yaml parsing error

* Fix exit code capture

It should be done on the same line, because drone insert 'echo + cmd'
between commands.

* Remove debug

* Readability

No functional changes.

* Return functional tests

* Be consistent

* Add git stub for coveralls

* Send coverage

* Fix yaml parsing error

* Add links to Dockerfiles

* Send test log in case of test failure

XXX if rspamd-test failed, but functional was successful robot log will be
attached (but not useful).

* Don't run rspamd-test and functional tests in parallel

It looks like there is a race condition in writing coverage files.

* Try to run tests in parallel

* Add debug

* Fix parallel test run

test/rspamd-test and functional test both use luacov.stats.out file
in current directory. Run ./rspamd-test from anther directory.

* Use drone condition for sending coveralls report

Also don't send report if empty tocken was provided.

* Add mininal python3 compatibility
2018-10-13 11:16:34 +01:00
Mikhail Galanin
1805dfc619 [Minor] Adopted merger to work with drone 2018-10-09 17:17:25 +01:00
Mikhail Galanin
394787e0a3 [Test] Coverage merge/push script 2018-10-08 08:59:23 +01:00
Mikhail Galanin
8f30094140 [Test] Small refactoring in dummy services test
Moved code for pid writing and terminating into a separated module.
Also added cleanup: in some cases, processes remained in the system after test is done. It should not happen anymore
2018-09-07 17:59:28 +01:00
Mikhail Galanin
b4d4cff669 [Test] Test for TCP library 2018-08-30 16:51:55 +01:00
Mikhail Galanin
a4b08ac566 [Test] More test cases for HTTP API 2018-08-23 13:49:59 +01:00
Mikhail Galanin
9ee6b0c059 [Test] Added test for HTTP API 2018-08-22 15:59:44 +01:00
Andrew Lewis
54b527ee1e [Minor] Fix previous commit 2018-01-24 13:52:10 +02:00
Andrew Lewis
03cf7aff97 [Test] Redis key expansion & antivirus ordered patterns 2017-12-08 15:40:21 +02:00
Andrew Lewis
93a5203173 [Minor] Add timeouts to dummy socket servers 2017-05-19 13:07:21 +02:00
Andrew Lewis
6bd2691f9c [Test] Fix F-Prot/ClamAV test stability 2017-03-10 16:23:23 +02:00
Andrew Lewis
b88b679dd7 [Test] Some tests for antivirus module 2017-03-06 16:45:21 +02:00