From 5b69f667398a87d659925813b3832c7933c615cc Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sun, 22 Nov 2015 15:58:06 +0100 Subject: [PATCH] Test with gitlab ci runner. --- .gitlab-ci.yml | 42 ++++++++++++++++++++++++++++++++++++++++++ test/unit/auth_test.rb | 7 ++++++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..55a8ff62e --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,42 @@ +before_script: + - bundle install + +stages: + - test + +job_unit: + stage: test + script: + - export RAILS_ENV=test + - script/build/test_db_config.sh ci_zammad_unit + - rake db:drop; + - rake db:create + - rake db:migrate + - rake db:seed + - rake test:units + - rake test:controllers + +job_integration_email_helper: + stage: test + script: + - export RAILS_ENV=test + - script/build/test_db_config.sh ci_zammad_email_helper + - rake db:drop; + - rake db:create + - rake db:migrate + - ruby -I test/ test/integration/email_helper_test.rb + +job_integration_geo_ip: + stage: test + script: + - export RAILS_ENV=test + - script/build/test_db_config.sh ci_zammad_geo_ip + - rake db:drop; + - rake db:create + - rake db:migrate + - ruby -I test/ test/integration/geo_ip_test.rb + +rubocop: + stage: test + script: + - bundle exec rubocop diff --git a/test/unit/auth_test.rb b/test/unit/auth_test.rb index 2f30d0d38..c091d1896 100644 --- a/test/unit/auth_test.rb +++ b/test/unit/auth_test.rb @@ -1,6 +1,11 @@ # encoding: utf-8 require 'test_helper' +# set config +if !ENV['LDAP_HOST'] + fail "ERROR: Need LDAP_HOST - hint LDAP_HOST='ldap://ci.zammad.org'" +end + Setting.create_or_update( title: 'Authentication via LDAP', name: 'auth_ldap', @@ -8,7 +13,7 @@ Setting.create_or_update( description: 'Enables user authentication via LDAP.', state: { adapter: 'Auth::Ldap', - host: 'localhost', + host: ENV['LDAP_HOST'], port: 389, bind_dn: 'cn=Manager,dc=example,dc=org', bind_pw: 'example',