You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

.drone.yml 5.9KB

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
5 years ago
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]
5 years ago
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
5 years ago
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
5 years ago
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
5 years ago
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
5 years ago
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]
5 years ago
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
5 years ago
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
5 years ago
5 years ago
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
5 years ago
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
5 years ago
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
5 years ago
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
5 years ago
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]
5 years ago
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]
5 years ago
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
5 years ago
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
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. ---
  2. workspace:
  3. base: /rspamd
  4. pipeline:
  5. prepare:
  6. # ubuntu used as base image for build and test images
  7. # and we need to download it anyway
  8. image: ubuntu:18.04
  9. commands:
  10. - install -d -o nobody -g nogroup /rspamd/build /rspamd/install
  11. # lua-torch CMakeLists writes to src dir
  12. - chown nobody $CI_WORKSPACE/contrib/lua-torch/nn
  13. # for debug
  14. - echo $CI_COMMIT_AUTHOR
  15. build:
  16. # https://github.com/rspamd/rspamd-build-docker/blob/master/ubuntu-build/Dockerfile
  17. image: rspamd/ci-ubuntu-build
  18. group: build
  19. commands:
  20. # build directories should be writable by nobody, for rspamd in functional tests
  21. # works as nobody and writes coverage files there
  22. - test "$(id -un)" = nobody
  23. - cd /rspamd/build
  24. - cmake $CI_WORKSPACE -DENABLE_COVERAGE=ON -DENABLE_LIBUNWIND=ON -DCMAKE_INSTALL_PREFIX=/rspamd/install -DCMAKE_RULE_MESSAGES=OFF
  25. - ncpu=$(getconf _NPROCESSORS_ONLN)
  26. - make -j $ncpu install
  27. - make -j $ncpu rspamd-test
  28. eslint:
  29. image: node:10-alpine
  30. group: build
  31. commands:
  32. - npm install
  33. - ./node_modules/.bin/eslint -v
  34. - ./node_modules/.bin/eslint ./
  35. # Run checks on perl source using tidyall
  36. perl-tidyall:
  37. # https://github.com/rspamd/rspamd-build-docker/blob/master/perl-tidyall/Dockerfile
  38. image: rspamd/ci-perl-tidyall
  39. group: build
  40. commands:
  41. # checks are configured in .tidyallrc at the top of rspamd repo
  42. - tidyall --all --check-only --no-cache --data-dir /tmp/tidyall
  43. # We run rspamd-test (unit test) and functional test (runned by robot) in
  44. # parallel to save time. To avoid conflict in saving lua coverage we run them
  45. # from different directories. For C code coverage counters is saved to .gcda
  46. # files and binary contain absolute path to them, so rspamd-test and
  47. # processes started by functional test are writing to the same files. On
  48. # process exit new coverage data merged with existing content of .gcda file.
  49. # Race is possible if rspamd-test and some rspamd process in functional test
  50. # will try to write .gcda file simultaneous. But it is very unlikely and
  51. # performance is more important then correct coverage data.
  52. rspamd-test:
  53. # https://github.com/rspamd/rspamd-build-docker/blob/master/ubuntu-test/Dockerfile
  54. image: rspamd/ci-ubuntu-test
  55. pull: true
  56. group: tests
  57. commands:
  58. - test "$(id -un)" = nobody
  59. - ulimit -c unlimited
  60. # rspamd-test and functional test both use luacov.stats.out file and should be started from
  61. # different directories (if started in parallel)
  62. - cd /rspamd/build/test
  63. - set +e
  64. - ./rspamd-test -p /rspamd/lua; EXIT_CODE=$?
  65. - set -e
  66. # shell sets exit status of a process terminated by a signal to '128 + signal-number'
  67. # if rspamd-test was terminated by a signal it should be SIGSEGV or SIGABRT, try to examine core
  68. - >
  69. if [ $EXIT_CODE -gt 128 ]; then
  70. gdb --batch -ex 'thread apply all bt full' -c /var/tmp/*.rspamd-test.core ./rspamd-test;
  71. exit $EXIT_CODE;
  72. fi
  73. # luacov-coveralls reads luacov.stats.out written by rspamd-test using luacov module
  74. # and writes json report for coveralls.io service
  75. - luacov-coveralls -o /rspamd/build/unit_test_lua.json --dryrun
  76. - exit $EXIT_CODE
  77. functional:
  78. # https://github.com/rspamd/rspamd-build-docker/blob/master/ubuntu-test-func/Dockerfile
  79. image: rspamd/ci-ubuntu-test-func
  80. pull: true
  81. group: tests
  82. commands:
  83. - cd /rspamd/build
  84. - ulimit -c unlimited
  85. # some rspamd processes during this test work as root and some as nobody
  86. # use umask to create world-writable files so nobody can write to *.gcda files created by root
  87. - umask 0000
  88. - set +e
  89. - RSPAMD_INSTALLROOT=/rspamd/install robot --removekeywords wuks --exclude isbroken $CI_WORKSPACE/test/functional/cases; EXIT_CODE=$?
  90. - set -e
  91. # upload test results to nginx frontent using WebDAV PUT
  92. - >
  93. if [ -n "$HTTP_PUT_AUTH" ]; then
  94. $CI_WORKSPACE/test/tools/http_put.py log.html report.html $CI_SYSTEM_LINK/testlogs/$CI_REPO_NAME/$CI_BUILD_NUMBER/;
  95. fi
  96. # core_pattern=/var/tmp/%u.%e.core so one or two cores can be saved for each binary
  97. - core_files=$(find /var/tmp/ -name '*.core')
  98. # use 'info proc mappings' to find path to executable file for given core
  99. # first mapping is usually program executable
  100. - >
  101. for core in $core_files;
  102. do
  103. exe=$(gdb --batch -ex 'info proc mappings' -c $core | awk 'h {print $5; exit}; /objfile/ {h=1}');
  104. gdb --batch -ex 'bt' -c $core $exe; echo '---';
  105. done
  106. - exit $EXIT_CODE
  107. secrets: [http_put_auth]
  108. send-coverage:
  109. image: rspamd/ci-ubuntu-test
  110. secrets: [ coveralls_repo_token ]
  111. commands:
  112. - cd /rspamd/build
  113. # extract coverage data for C code from .gcda files and save it in a format suitable for coveralls.io
  114. - $CI_WORKSPACE/test/tools/gcov_coveralls.py --exclude test --prefix /rspamd/build --prefix $CI_WORKSPACE --out coverage.c.json
  115. # luacov-coveralls reads luacov.stats.out generated by functional tests
  116. # (see collect_lua_coverage() in test/functional/lib/rspamd.py)
  117. # and writes json report for coveralls.io
  118. - luacov-coveralls -o coverage.functional.lua.json --dryrun
  119. # * merge coverage for C and Lua code
  120. # * remove prefixes from absolute paths (in luacov-coveralls files), filter test, contrib, e. t.c
  121. # * upload report to coveralls.io
  122. - $CI_WORKSPACE/test/tools/merge_coveralls.py --root $CI_WORKSPACE --input coverage.c.json unit_test_lua.json coverage.functional.lua.json --token=$COVERALLS_REPO_TOKEN
  123. when:
  124. branch: master
  125. # don't send coverage report for pull request
  126. event: [push, tag]
  127. notify:
  128. image: drillster/drone-email
  129. from: noreply@rspamd.com
  130. secrets: [email_host, email_username, email_password]
  131. when:
  132. status: failure