Merge branch 'develop' of git.znuny.com:zammad/zammad into develop

This commit is contained in:
Martin Edenhofer 2018-05-08 13:45:19 +02:00
commit f75986af52
5 changed files with 28 additions and 4 deletions

View file

@ -49,9 +49,9 @@ before_install:
- git fetch --unshallow - git fetch --unshallow
- if [ "${DB}" = "mysql" ]; then mysql -u root -e "CREATE USER 'some_user'@'localhost' IDENTIFIED BY 'some_pass';"; fi - if [ "${DB}" = "mysql" ]; then mysql -u root -e "CREATE USER 'some_user'@'localhost' IDENTIFIED BY 'some_pass';"; fi
- if [ "${DB}" = "mysql" ]; then mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'some_user'@'localhost';"; fi - if [ "${DB}" = "mysql" ]; then mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'some_user'@'localhost';"; fi
- if [ "${DB}" = "mysql" ]; then cp config/database.yml.test-mysql config/database.yml; fi - if [ "${DB}" = "mysql" ]; then cp contrib/travis-ci.org/database.yml.test-mysql config/database.yml; fi
- if [ "${DB}" = "postgresql" ]; then psql -c 'create database zammad_test;' -U postgres; fi - if [ "${DB}" = "postgresql" ]; then psql -c 'create database zammad_test;' -U postgres; fi
- if [ "${DB}" = "postgresql" ]; then cp config/database.yml.test-postgresql config/database.yml; fi - if [ "${DB}" = "postgresql" ]; then cp contrib/travis-ci.org/database.yml.test-postgresql config/database.yml; fi
- export RAILS_ENV=test - export RAILS_ENV=test
- export ZAMMAD_VERSION=$(git describe --tags | sed -e 's/-[a-z0-9]\{8,\}.*//g') - export ZAMMAD_VERSION=$(git describe --tags | sed -e 's/-[a-z0-9]\{8,\}.*//g')
install: install:

View file

@ -180,7 +180,7 @@ function update_database_yml () {
sed -e "s/.*adapter:.*/ adapter: ${ADAPTER}/" \ sed -e "s/.*adapter:.*/ adapter: ${ADAPTER}/" \
-e "s/.*username:.*/ username: ${DB_USER}/" \ -e "s/.*username:.*/ username: ${DB_USER}/" \
-e "s/.*password:.*/ password: ${DB_PASS}/" \ -e "s/.*password:.*/ password: ${DB_PASS}/" \
-e "s/.*database:.*/ database: ${DB}/" < ${ZAMMAD_DIR}/config/database.yml.pkgr > ${ZAMMAD_DIR}/config/database.yml -e "s/.*database:.*/ database: ${DB}/" < ${ZAMMAD_DIR}/contrib/database.yml.pkgr > ${ZAMMAD_DIR}/config/database.yml
} }
function initialise_database () { function initialise_database () {

View file

@ -0,0 +1,11 @@
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: mysql2
database: zammad_test
pool: 50
timeout: 5000
encoding: utf8
username: some_user
password: some_pass

View file

@ -0,0 +1,11 @@
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: postgresql
database: zammad_test
pool: 50
timeout: 5000
encoding: utf8
username: postgres
password:

View file

@ -14,6 +14,8 @@ describe 'websocket-server' do
# This error is raised for invalid bind addresses # This error is raised for invalid bind addresses
let(:error_msg) { "`start_tcp_server': no acceptor" } let(:error_msg) { "`start_tcp_server': no acceptor" }
let(:ipv6_addr) { '::1/128' } let(:ipv6_addr) { '::1/128' }
# Prevent port assignment conflicts during parallel test execution
let(:port) { '60042' }
# Flush logs # Flush logs
before do before do
@ -23,7 +25,7 @@ describe 'websocket-server' do
it 'starts up successfully' do it 'starts up successfully' do
begin begin
system("#{ws_server} start -db #{ipv6_addr} >/dev/null 2>&1") system("#{ws_server} start -db #{ipv6_addr} -p #{port} >/dev/null 2>&1")
# Wait for daemon to start # Wait for daemon to start
Timeout.timeout(20, Timeout::Error, 'WebSocket Server startup timed out') do Timeout.timeout(20, Timeout::Error, 'WebSocket Server startup timed out') do