Commit Graph

28 Commits

Author SHA1 Message Date
Anton Yuzhaninov
f053296f9b Don't print summary line
It is mostly redundant.
2018-11-13 22:57:11 -05:00
Anton Yuzhaninov
53947bd6bc Use clang sanitizers 2018-11-13 22:11:56 -05:00
Anton Yuzhaninov
5496ce20f0 Run unit tests on Fedora (clang build) 2018-11-13 16:59:16 -05:00
Anton Yuzhaninov
ea4f4f5692 Turn off TORCH for clang build
It turned out that clang significantly slower than gcc on rspamd code
(at least with -O0). Switch off torch to decrease build time.
2018-10-30 15:38:12 -04:00
Anton Yuzhaninov
a1eb8af054 Enable clang plugin
Build clang plugin and use it to check rspamd printf-like functions
(rspamd_printf, rspamd_fprintf, rspamd_default_log_function, e.t.c).
2018-10-30 14:55:47 -04:00
Anton Yuzhaninov
d4c2bd7ca0 build with -O0
Compilation with -O2/-O3 is slow.
2018-10-29 21:28:28 -04:00
Anton Yuzhaninov
841f1d2273 Build with clang 2018-10-29 20:58:15 -04:00
Anton Yuzhaninov
3ebf458996 Speedup lua coverage collecting for functional test
luacov-coveralls merge mode (-j flag) was created to join reports
containing coverage for different source files (e.g. C and Lua code).
Coverage for the same file in two report is not merged, instead one
source file is added several times to source_files array in JSON. As
a result if we use luacov-coveralls -j on report for same source files
it ends up spending a lot of time on parsing and dumping big JSON files.

This change reduces functional test time from 7+ minutes to 4+ minutes.
2018-10-27 13:36:52 -04:00
Vsevolod Stakhov
733c60e01a
Merge pull request #2610 from citrin/functional-test-fix
Fix test case: Cases.210 Clickhouse.001
2018-10-25 10:56:32 +01:00
Anton Yuzhaninov
58e4d05f07 Filter Wait Until Keyword Succeeds in robot log
Remove all but the last failing keyword inside `BuiltIn.Wait Until
Keyword Succeeds` to reduce amount of useless information in robot log.
2018-10-24 20:16:50 -04:00
Anton Yuzhaninov
96fc8e5429 Filter Wait Until Keyword Succeeds in robot log
Remove all but the last failing keyword inside `BuiltIn.Wait Until
Keyword Succeeds` to reduse amount of useless inforamtion in robot log.
2018-10-24 20:13:58 -04:00
Anton Yuzhaninov
ded898bc58 gdb invocation nitpick
* pagination is disabled by --batch
* use options order like in gdb docs
2018-10-23 13:38:13 -04:00
Anton Yuzhaninov
50ad2f1b78 Print backtrace for cores dumped by functional test 2018-10-23 13:26:32 -04:00
Anton Yuzhaninov
00e1cb15ab Remove indentation from yaml '>' blocks
With indentation block literal is not folded as expected.
2018-10-23 11:57:37 -04:00
Anton Yuzhaninov
ba26c2360d Don't write xunit.xml
It is not currently used.
2018-10-22 23:17:27 -04:00
Anton Yuzhaninov
b3826709ec Share robot log and report on https://ci.rspamd.com/testlogs/
Sending functional test log (about 5Mb) in a email attachmend was temporary
solution.
Upload them to https://ci.rspamd.com/testlogs/ instead.
Link to log/report will be printed in build log.
2018-10-22 22:56:05 -04:00
Anton Yuzhaninov
a9ea9d8bcd Simplify: default working directory is source root 2018-10-22 20:26:29 -04:00
Anton Yuzhaninov
793ef2dddc Enable core dumps for funcutional test
Don't run gdb yet, it requires more work and can be done when it will be
needed.
2018-10-22 19:39:51 -04: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
870589b0a6 Fix: tidyall expects to find .tidyallrc in --root-dir 2018-10-18 17:35:30 -04:00
Anton Yuzhaninov
4914e8b86d Add tidyall checks for perl code
Based on analagous check added to CircleCI:
9ace1e0519
2018-10-18 17:06:54 -04:00
Anton Yuzhaninov
e68fabf1e1 Indent shell command for readability 2018-10-16 15:14:50 -04:00
Anton Yuzhaninov
8f2fee880f Improve comment 2018-10-16 14:53:21 -04:00
Anton Yuzhaninov
fb91f376e2 Set limit to allow core dump writing 2018-10-16 13:01:01 -04:00
Anton Yuzhaninov
0613b8af0a Run gdb if rspamd-test dumped core 2018-10-16 12:22:32 -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
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
54d58e73fb [Minor] Add .drone.yml 2018-10-09 17:17:04 +01:00