Browse Source

[Test] Integrate functional tests with Travis CI

tags/1.3.0
Andrew Lewis 8 years ago
parent
commit
e6ff4143d5

+ 9
- 5
.travis.yml View File

@@ -7,20 +7,24 @@ language: c
# - linux
# - osx

python:
- "3.4"

before_script:
- sudo apt-get update -qq
- sudo apt-get install -qq cmake libevent-dev libglib2.0-dev libgmime-2.6-dev libluajit-5.1-dev liblua5.1-0-dev libpcre3-dev libsqlite3-dev libmagic-dev ragel make libssl-dev
- sudo apt-get install -qq cmake libevent-dev libglib2.0-dev libgmime-2.6-dev libluajit-5.1-dev liblua5.1-0-dev libmagic-dev libpcre3-dev libsqlite3-dev libssl-dev make ragel redis-server
# - echo $TRAVIS_OS_NAME
# - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -qq ; fi
# - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq cmake libevent-dev libglib2.0-dev libgmime-2.6-dev libluajit-5.1-dev libpcre3-dev libsqlite3-dev libhiredis-dev ; fi
# - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update ; fi
# - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install cmake gmime glib luajit pcre hiredis sqlite libevent ; fi

script:
- mkdir _build
- cd _build
- cmake .. -DCMAKE_INSTALL_PREFIX=../_install -DCMAKE_C_COMPILER=$CC
script:
- chmod a+rx /home/travis
- cmake . -DCMAKE_INSTALL_PREFIX=./_install -DCMAKE_C_COMPILER=$CC
- cmake --build . --target install
- sudo pip install robotframework
- sudo robot test/functional/cases

compiler:
- clang

+ 1
- 1
test/functional/cases/statistics/redis-keyed-siphash.robot View File

@@ -4,7 +4,7 @@ Suite Teardown Redis Statistics Teardown
Resource lib.robot

*** Variables ***
${REDIS_SERVER} servers = "${LOCAL_ADDR}:${REDIS_PORT}"
${REDIS_SERVER} servers = "${REDIS_ADDR}:${REDIS_PORT}"
${STATS_BACKEND} redis
${STATS_HASH} hash = "siphash";
${STATS_KEY} key = "${KEY_PVT1}";

+ 1
- 1
test/functional/cases/statistics/redis-keyed-xxhash.robot View File

@@ -4,7 +4,7 @@ Suite Teardown Redis Statistics Teardown
Resource lib.robot

*** Variables ***
${REDIS_SERVER} servers = "${LOCAL_ADDR}:${REDIS_PORT}"
${REDIS_SERVER} servers = "${REDIS_ADDR}:${REDIS_PORT}"
${STATS_BACKEND} redis
${STATS_HASH} hash = "xxhash";
${STATS_KEY} key = "${KEY_PVT1}";

+ 1
- 1
test/functional/cases/statistics/redis-plain-siphash.robot View File

@@ -4,7 +4,7 @@ Suite Teardown Redis Statistics Teardown
Resource lib.robot

*** Variables ***
${REDIS_SERVER} servers = "${LOCAL_ADDR}:${REDIS_PORT}"
${REDIS_SERVER} servers = "${REDIS_ADDR}:${REDIS_PORT}"
${STATS_BACKEND} redis
${STATS_HASH} hash = "siphash";


+ 1
- 1
test/functional/cases/statistics/redis-plain-xxhash.robot View File

@@ -4,7 +4,7 @@ Suite Teardown Redis Statistics Teardown
Resource lib.robot

*** Variables ***
${REDIS_SERVER} servers = "${LOCAL_ADDR}:${REDIS_PORT}"
${REDIS_SERVER} servers = "${REDIS_ADDR}:${REDIS_PORT}"
${STATS_BACKEND} redis
${STATS_HASH} hash = "xxhash";


+ 2
- 1
test/functional/configs/redis-server.conf View File

@@ -1,4 +1,5 @@
bind ${LOCAL_ADDR}
bind ${REDIS_ADDR}
daemonize yes
logfile ${TMPDIR}/redis.log
pidfile ${TMPDIR}/redis.pid
port ${REDIS_PORT}

+ 4
- 0
test/functional/lib/rspamd.robot View File

@@ -75,11 +75,15 @@ Run Redis
${template} = Get File ${TESTDIR}/configs/redis-server.conf
${config} = Replace Variables ${template}
Create File ${TMPDIR}/redis-server.conf ${config}
Log ${config}
${result} = Run Process redis-server ${TMPDIR}/redis-server.conf
Run Keyword If ${result.rc} != 0 Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
${REDIS_PID} = Get File ${TMPDIR}/redis.pid
Run Keyword If '${REDIS_SCOPE}' == 'Test' Set Test Variable ${REDIS_PID}
... ELSE IF '${REDIS_SCOPE}' == 'Suite' Set Suite Variable ${REDIS_PID}
${redis_log} = Get File ${TMPDIR}/redis.log
Log ${redis_log}

Run Rspamc
[Arguments] @{args}

+ 1
- 0
test/functional/lib/vars.py View File

@@ -4,6 +4,7 @@ LOCAL_ADDR = 'localhost'
PORT_CONTROLLER = 56790
PORT_FUZZY = 56791
PORT_NORMAL = 56789
REDIS_ADDR = '127.0.0.1'
REDIS_PORT = 56379
RSPAMD_GROUP = 'nogroup'
RSPAMD_USER = 'nobody'

Loading…
Cancel
Save