Applied required changes to run in GitLab docker CI env 🐳.
This commit is contained in:
parent
f34de820ac
commit
5e05fadbb8
9 changed files with 187 additions and 313 deletions
301
.gitlab-ci.yml
301
.gitlab-ci.yml
|
@ -1,6 +1,23 @@
|
||||||
variables:
|
image: registry.znuny.com/docker/zammad-application:latest
|
||||||
Z_LOCALES: "en-us:de-de"
|
|
||||||
|
|
||||||
|
# Global variables added to the ENV of each job
|
||||||
|
variables:
|
||||||
|
# for faster translation loading
|
||||||
|
Z_LOCALES: "en-us:de-de"
|
||||||
|
# Browser tests and variables
|
||||||
|
RAILS_SERVE_STATIC_FILES: "true"
|
||||||
|
REMOTE_URL: "http://selenium:24444/wd/hub"
|
||||||
|
TZ: "Europe/London"
|
||||||
|
# docker elgalu/selenium variables for parallel browser instance creation
|
||||||
|
MAX_INSTANCES: "50"
|
||||||
|
MAX_SESSIONS: "50"
|
||||||
|
# docker-imap-devel variables required for browser tests
|
||||||
|
MAILNAME: "mail.test.dc.zammad.com"
|
||||||
|
MAILBOX_INIT: "zammad@mail.test.dc.zammad.com:zammad"
|
||||||
|
MAIL_ADDRESS: "zammad@mail.test.dc.zammad.com"
|
||||||
|
MAIL_PASS: "zammad"
|
||||||
|
|
||||||
|
# Artifacts are stored for failed jobs for 2 days
|
||||||
.artifacts_error_template: &artifacts_error
|
.artifacts_error_template: &artifacts_error
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 2 days
|
expire_in: 2 days
|
||||||
|
@ -9,12 +26,30 @@ variables:
|
||||||
- tmp/screenshot*
|
- tmp/screenshot*
|
||||||
- log/*.log
|
- log/*.log
|
||||||
|
|
||||||
|
# Workaround to enable usage of mixed SSH and Docker GitLab CI runners
|
||||||
|
.docker_env_template: &docker_env
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
.base_env_template: &base_env
|
||||||
|
<<: *docker_env
|
||||||
|
<<: *artifacts_error
|
||||||
|
|
||||||
|
# General required Docker services for different DB envs
|
||||||
|
.services_mysql_template: &services_mysql
|
||||||
|
services:
|
||||||
|
- name: registry.znuny.com/docker/zammad-mysql:latest
|
||||||
|
alias: mysql
|
||||||
|
|
||||||
|
.services_postgresql_template: &services_postgresql
|
||||||
|
services:
|
||||||
|
- name: registry.znuny.com/docker/zammad-postgresql:latest
|
||||||
|
alias: postgresql
|
||||||
|
|
||||||
|
# Initialize env
|
||||||
before_script:
|
before_script:
|
||||||
- ruby -v
|
- test ${CI_JOB_STAGE} != 'pre' && bundle install -j $(nproc)
|
||||||
- which ruby
|
- test ${CI_JOB_STAGE} != 'pre' && ruby script/build/database_config.rb
|
||||||
- env
|
|
||||||
- test -n "$RNAME" && script/build/test_db_config.sh
|
|
||||||
- test -n "$RNAME" && bundle install -j $(nproc)
|
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- pre
|
- pre
|
||||||
|
@ -24,31 +59,30 @@ stages:
|
||||||
|
|
||||||
# pre stage
|
# pre stage
|
||||||
|
|
||||||
pre:rubocop:
|
# Workaround to enable usage of mixed SSH and Docker GitLab CI runners
|
||||||
|
.pre_stage_template: &pre_stage
|
||||||
|
<<: *docker_env
|
||||||
stage: pre
|
stage: pre
|
||||||
tags:
|
|
||||||
- core
|
pre:rubocop:
|
||||||
|
<<: *pre_stage
|
||||||
script:
|
script:
|
||||||
- bundle exec rubocop
|
- bundle exec rubocop
|
||||||
|
|
||||||
pre:coffeelint:
|
pre:coffeelint:
|
||||||
stage: pre
|
<<: *pre_stage
|
||||||
tags:
|
|
||||||
- core
|
|
||||||
script:
|
script:
|
||||||
- coffeelint app/
|
- coffeelint app/
|
||||||
|
|
||||||
pre:bundle-audit:
|
pre:bundle-audit:
|
||||||
stage: pre
|
<<: *pre_stage
|
||||||
tags:
|
|
||||||
- core
|
|
||||||
script:
|
script:
|
||||||
- gem install bundler-audit
|
- gem install bundler-audit
|
||||||
- bundle-audit update
|
- bundle-audit update
|
||||||
- bundle-audit
|
- bundle-audit
|
||||||
|
|
||||||
pre:github:
|
pre:github:
|
||||||
stage: pre
|
<<: *pre_stage
|
||||||
tags:
|
tags:
|
||||||
- deploy
|
- deploy
|
||||||
script:
|
script:
|
||||||
|
@ -59,32 +93,27 @@ pre:github:
|
||||||
## RSpec
|
## RSpec
|
||||||
|
|
||||||
.script_rspec_template: &script_rspec_definition
|
.script_rspec_template: &script_rspec_definition
|
||||||
<<: *artifacts_error
|
<<: *base_env
|
||||||
variables:
|
variables:
|
||||||
RAILS_ENV: "test"
|
RAILS_ENV: "test"
|
||||||
script:
|
script:
|
||||||
- rake zammad:db:init
|
- rake zammad:db:init
|
||||||
- bundle exec rspec
|
- bundle exec rspec
|
||||||
- rake db:drop
|
|
||||||
|
|
||||||
test:rspec:mysql:
|
test:rspec:mysql:
|
||||||
stage: test
|
stage: test
|
||||||
tags:
|
<<: *services_mysql
|
||||||
- core
|
|
||||||
- mysql
|
|
||||||
<<: *script_rspec_definition
|
<<: *script_rspec_definition
|
||||||
|
|
||||||
test:rspec:postgresql:
|
test:rspec:postgresql:
|
||||||
stage: test
|
stage: test
|
||||||
tags:
|
<<: *services_postgresql
|
||||||
- core
|
|
||||||
- postgresql
|
|
||||||
<<: *script_rspec_definition
|
<<: *script_rspec_definition
|
||||||
|
|
||||||
## Unit and Controller tests
|
## Unit and Controller tests
|
||||||
|
|
||||||
.script_unit_template: &script_unit_definition
|
.script_unit_template: &script_unit_definition
|
||||||
<<: *artifacts_error
|
<<: *base_env
|
||||||
variables:
|
variables:
|
||||||
RAILS_ENV: "test"
|
RAILS_ENV: "test"
|
||||||
script:
|
script:
|
||||||
|
@ -92,170 +121,134 @@ test:rspec:postgresql:
|
||||||
- rake test:units
|
- rake test:units
|
||||||
- ruby -I test/ test/integration/object_manager_test.rb
|
- ruby -I test/ test/integration/object_manager_test.rb
|
||||||
- ruby -I test/ test/integration/package_test.rb
|
- ruby -I test/ test/integration/package_test.rb
|
||||||
- rake db:drop
|
|
||||||
|
|
||||||
test:unit:mysql:
|
test:unit:mysql:
|
||||||
stage: test
|
stage: test
|
||||||
tags:
|
<<: *services_mysql
|
||||||
- core
|
|
||||||
- mysql
|
|
||||||
<<: *script_unit_definition
|
<<: *script_unit_definition
|
||||||
|
|
||||||
test:unit:postgresql:
|
test:unit:postgresql:
|
||||||
stage: test
|
stage: test
|
||||||
tags:
|
<<: *services_postgresql
|
||||||
- core
|
|
||||||
- postgresql
|
|
||||||
<<: *script_unit_definition
|
<<: *script_unit_definition
|
||||||
|
|
||||||
## Integration tests
|
## Integration tests
|
||||||
|
|
||||||
test:integration:email_helper_deliver:
|
.test_integration_template: &test_integration_definition
|
||||||
<<: *artifacts_error
|
<<: *base_env
|
||||||
|
<<: *services_postgresql
|
||||||
stage: test
|
stage: test
|
||||||
variables:
|
variables:
|
||||||
RAILS_ENV: "test"
|
RAILS_ENV: "test"
|
||||||
tags:
|
|
||||||
- core
|
test:integration:email_helper_deliver:
|
||||||
|
<<: *test_integration_definition
|
||||||
script:
|
script:
|
||||||
- rake zammad:db:unseeded
|
- rake zammad:db:unseeded
|
||||||
- ruby -I test/ test/integration/email_helper_test.rb
|
- ruby -I test/ test/integration/email_helper_test.rb
|
||||||
- ruby -I test/ test/integration/email_deliver_test.rb
|
- ruby -I test/ test/integration/email_deliver_test.rb
|
||||||
- ruby -I test/ test/integration/email_keep_on_server_test.rb
|
- ruby -I test/ test/integration/email_keep_on_server_test.rb
|
||||||
- rake db:drop
|
|
||||||
|
|
||||||
test:integration:facebook:
|
test:integration:facebook:
|
||||||
<<: *artifacts_error
|
<<: *test_integration_definition
|
||||||
stage: test
|
|
||||||
variables:
|
|
||||||
RAILS_ENV: "test"
|
|
||||||
tags:
|
|
||||||
- core-facebook
|
|
||||||
script:
|
script:
|
||||||
- rake zammad:db:init
|
- rake zammad:db:init
|
||||||
- ruby -I test/ test/integration/facebook_test.rb
|
- ruby -I test/ test/integration/facebook_test.rb
|
||||||
- rake db:drop
|
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
|
||||||
test:integration:geo:
|
test:integration:geo:
|
||||||
<<: *artifacts_error
|
<<: *test_integration_definition
|
||||||
stage: test
|
|
||||||
variables:
|
|
||||||
RAILS_ENV: "test"
|
|
||||||
tags:
|
|
||||||
- core
|
|
||||||
script:
|
script:
|
||||||
- rake zammad:db:unseeded
|
- rake zammad:db:unseeded
|
||||||
- ruby -I test/ test/integration/geo_calendar_test.rb
|
- ruby -I test/ test/integration/geo_calendar_test.rb
|
||||||
- ruby -I test/ test/integration/geo_location_test.rb
|
- ruby -I test/ test/integration/geo_location_test.rb
|
||||||
- ruby -I test/ test/integration/geo_ip_test.rb
|
- ruby -I test/ test/integration/geo_ip_test.rb
|
||||||
- rake db:drop
|
|
||||||
|
|
||||||
test:integration:user_agent:
|
test:integration:user_agent:
|
||||||
<<: *artifacts_error
|
<<: *test_integration_definition
|
||||||
stage: test
|
|
||||||
variables:
|
|
||||||
RAILS_ENV: "test"
|
|
||||||
tags:
|
|
||||||
- core
|
|
||||||
script:
|
script:
|
||||||
- rake zammad:db:unseeded
|
- rake zammad:db:unseeded
|
||||||
- ruby -I test/ test/integration/user_agent_test.rb
|
- ruby -I test/ test/integration/user_agent_test.rb
|
||||||
- export ZAMMAD_PROXY_TEST=true
|
- export ZAMMAD_PROXY_TEST=true
|
||||||
- ruby -I test/ test/integration/user_agent_test.rb
|
- ruby -I test/ test/integration/user_agent_test.rb
|
||||||
- rake db:drop
|
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
|
||||||
test:integration:slack:
|
test:integration:slack:
|
||||||
<<: *artifacts_error
|
<<: *test_integration_definition
|
||||||
stage: test
|
|
||||||
variables:
|
|
||||||
RAILS_ENV: "test"
|
|
||||||
tags:
|
|
||||||
- core
|
|
||||||
script:
|
script:
|
||||||
- rake zammad:db:unseeded
|
- rake zammad:db:unseeded
|
||||||
- echo "gem 'slack-api'" >> Gemfile.local
|
- echo "gem 'slack-api'" >> Gemfile.local
|
||||||
- bundle install -j $(nproc)
|
- bundle install -j $(nproc)
|
||||||
- ruby -I test test/integration/slack_test.rb
|
- ruby -I test test/integration/slack_test.rb
|
||||||
- rake db:drop
|
|
||||||
|
|
||||||
test:integration:clearbit:
|
test:integration:clearbit:
|
||||||
<<: *artifacts_error
|
<<: *test_integration_definition
|
||||||
stage: test
|
|
||||||
variables:
|
|
||||||
RAILS_ENV: "test"
|
|
||||||
tags:
|
|
||||||
- core
|
|
||||||
script:
|
script:
|
||||||
- rake zammad:db:unseeded
|
- rake zammad:db:unseeded
|
||||||
- ruby -I test test/integration/clearbit_test.rb
|
- ruby -I test test/integration/clearbit_test.rb
|
||||||
- rake db:drop
|
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
|
||||||
### Elasticsearch
|
### Elasticsearch
|
||||||
|
|
||||||
.script_elasticsearch_template: &script_elasticsearch_definition
|
.script_elasticsearch_template: &script_elasticsearch_definition
|
||||||
<<: *artifacts_error
|
<<: *base_env
|
||||||
stage: test
|
stage: test
|
||||||
variables:
|
variables:
|
||||||
RAILS_ENV: "test"
|
RAILS_ENV: "test"
|
||||||
ES_INDEX_RAND: "true"
|
ES_INDEX_RAND: "true"
|
||||||
ES_URL: "http://localhost:9200"
|
ES_URL: "http://elasticsearch:9200"
|
||||||
script:
|
script:
|
||||||
- rake zammad:db:unseeded
|
- rake zammad:db:unseeded
|
||||||
- ruby -I test/ test/integration/elasticsearch_active_test.rb
|
- ruby -I test/ test/integration/elasticsearch_active_test.rb
|
||||||
- ruby -I test/ test/integration/elasticsearch_test.rb
|
- ruby -I test/ test/integration/elasticsearch_test.rb
|
||||||
- ruby -I test/ test/integration/report_test.rb
|
- ruby -I test/ test/integration/report_test.rb
|
||||||
- bundle exec rspec --tag searchindex
|
- bundle exec rspec --tag searchindex
|
||||||
- rake db:drop
|
|
||||||
|
|
||||||
test:integration:es_mysql:
|
test:integration:es_mysql:
|
||||||
tags:
|
|
||||||
- core
|
|
||||||
- mysql
|
|
||||||
<<: *script_elasticsearch_definition
|
<<: *script_elasticsearch_definition
|
||||||
|
services:
|
||||||
|
- name: registry.znuny.com/docker/zammad-mysql:latest
|
||||||
|
alias: mysql
|
||||||
|
- name: registry.znuny.com/docker/zammad-elasticsearch:latest
|
||||||
|
alias: elasticsearch
|
||||||
|
|
||||||
test:integration:es_postgresql:
|
test:integration:es_postgresql:
|
||||||
tags:
|
|
||||||
- core
|
|
||||||
- postgresql
|
|
||||||
<<: *script_elasticsearch_definition
|
<<: *script_elasticsearch_definition
|
||||||
|
services:
|
||||||
|
- name: registry.znuny.com/docker/zammad-postgresql:latest
|
||||||
|
alias: postgresql
|
||||||
|
- name: registry.znuny.com/docker/zammad-elasticsearch:latest
|
||||||
|
alias: elasticsearch
|
||||||
|
|
||||||
### Zendesk
|
### Zendesk
|
||||||
|
|
||||||
.script_integration_zendesk_template: &script_integration_zendesk_definition
|
.script_integration_zendesk_template: &script_integration_zendesk_definition
|
||||||
<<: *artifacts_error
|
<<: *base_env
|
||||||
|
<<: *services_postgresql
|
||||||
stage: test
|
stage: test
|
||||||
variables:
|
variables:
|
||||||
RAILS_ENV: "test"
|
RAILS_ENV: "test"
|
||||||
script:
|
script:
|
||||||
- rake zammad:db:unseeded
|
- rake zammad:db:unseeded
|
||||||
- ruby -I test/ test/integration/zendesk_import_test.rb
|
- ruby -I test/ test/integration/zendesk_import_test.rb
|
||||||
- rake db:drop
|
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
|
||||||
test:integration:zendesk_mysql:
|
test:integration:zendesk_mysql:
|
||||||
tags:
|
<<: *services_mysql
|
||||||
- core
|
|
||||||
- mysql
|
|
||||||
<<: *script_integration_zendesk_definition
|
<<: *script_integration_zendesk_definition
|
||||||
|
|
||||||
test:integration:zendesk_postgresql:
|
test:integration:zendesk_postgresql:
|
||||||
tags:
|
<<: *services_postgresql
|
||||||
- core
|
|
||||||
- postgresql
|
|
||||||
<<: *script_integration_zendesk_definition
|
<<: *script_integration_zendesk_definition
|
||||||
|
|
||||||
### OTRS
|
### OTRS
|
||||||
|
|
||||||
.script_integration_otrs_template: &script_integration_otrs_definition
|
.script_integration_otrs_template: &script_integration_otrs_definition
|
||||||
<<: *artifacts_error
|
<<: *base_env
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- rake zammad:db:unseeded
|
- rake zammad:db:unseeded
|
||||||
- ruby -I test/ test/integration/otrs_import_test.rb
|
- ruby -I test/ test/integration/otrs_import_test.rb
|
||||||
- rake db:drop
|
|
||||||
|
|
||||||
.variables_integration_otrs_6_template: &variables_integration_otrs_6_definition
|
.variables_integration_otrs_6_template: &variables_integration_otrs_6_definition
|
||||||
variables:
|
variables:
|
||||||
|
@ -263,54 +256,45 @@ test:integration:zendesk_postgresql:
|
||||||
IMPORT_OTRS_ENDPOINT: "https://vz1185.test.znuny.com/otrs/public.pl?Action=ZammadMigrator"
|
IMPORT_OTRS_ENDPOINT: "https://vz1185.test.znuny.com/otrs/public.pl?Action=ZammadMigrator"
|
||||||
|
|
||||||
test:integration:otrs_6_mysql:
|
test:integration:otrs_6_mysql:
|
||||||
tags:
|
<<: *services_mysql
|
||||||
- core
|
|
||||||
- mysql
|
|
||||||
<<: *script_integration_otrs_definition
|
<<: *script_integration_otrs_definition
|
||||||
<<: *variables_integration_otrs_6_definition
|
<<: *variables_integration_otrs_6_definition
|
||||||
|
|
||||||
test:integration:otrs_6_postgresql:
|
test:integration:otrs_6_postgresql:
|
||||||
tags:
|
<<: *services_postgresql
|
||||||
- core
|
|
||||||
- postgresql
|
|
||||||
<<: *script_integration_otrs_definition
|
<<: *script_integration_otrs_definition
|
||||||
<<: *variables_integration_otrs_6_definition
|
<<: *variables_integration_otrs_6_definition
|
||||||
|
|
||||||
test:integration:otrs_5:
|
test:integration:otrs_5:
|
||||||
tags:
|
<<: *services_postgresql
|
||||||
- core
|
|
||||||
variables:
|
variables:
|
||||||
RAILS_ENV: "test"
|
RAILS_ENV: "test"
|
||||||
IMPORT_OTRS_ENDPOINT: "http://vz1109.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator"
|
IMPORT_OTRS_ENDPOINT: "http://vz1109.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator"
|
||||||
<<: *script_integration_otrs_definition
|
<<: *script_integration_otrs_definition
|
||||||
|
|
||||||
test:integration:otrs_4:
|
test:integration:otrs_4:
|
||||||
tags:
|
<<: *services_postgresql
|
||||||
- core
|
|
||||||
variables:
|
variables:
|
||||||
RAILS_ENV: "test"
|
RAILS_ENV: "test"
|
||||||
IMPORT_OTRS_ENDPOINT: "http://vz383.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator"
|
IMPORT_OTRS_ENDPOINT: "http://vz383.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator"
|
||||||
<<: *script_integration_otrs_definition
|
<<: *script_integration_otrs_definition
|
||||||
|
|
||||||
test:integration:otrs_33:
|
test:integration:otrs_33:
|
||||||
tags:
|
<<: *services_postgresql
|
||||||
- core
|
|
||||||
variables:
|
variables:
|
||||||
RAILS_ENV: "test"
|
RAILS_ENV: "test"
|
||||||
IMPORT_OTRS_ENDPOINT: "http://vz305.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator"
|
IMPORT_OTRS_ENDPOINT: "http://vz305.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator"
|
||||||
<<: *script_integration_otrs_definition
|
<<: *script_integration_otrs_definition
|
||||||
|
|
||||||
test:integration:otrs_32:
|
test:integration:otrs_32:
|
||||||
tags:
|
<<: *services_postgresql
|
||||||
- core
|
|
||||||
variables:
|
variables:
|
||||||
RAILS_ENV: "test"
|
RAILS_ENV: "test"
|
||||||
IMPORT_OTRS_ENDPOINT: "http://vz382.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator"
|
IMPORT_OTRS_ENDPOINT: "http://vz382.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator"
|
||||||
<<: *script_integration_otrs_definition
|
<<: *script_integration_otrs_definition
|
||||||
|
|
||||||
test:integration:otrs_31:
|
test:integration:otrs_31:
|
||||||
tags:
|
<<: *services_postgresql
|
||||||
- core
|
|
||||||
variables:
|
variables:
|
||||||
RAILS_ENV: "test"
|
RAILS_ENV: "test"
|
||||||
IMPORT_OTRS_ENDPOINT: "http://vz381.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator"
|
IMPORT_OTRS_ENDPOINT: "http://vz381.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator"
|
||||||
|
@ -321,15 +305,14 @@ test:integration:otrs_31:
|
||||||
## preparation (asset precompile)
|
## preparation (asset precompile)
|
||||||
|
|
||||||
browser:build:
|
browser:build:
|
||||||
|
<<: *base_env
|
||||||
|
<<: *services_postgresql
|
||||||
stage: test
|
stage: test
|
||||||
tags:
|
|
||||||
- core
|
|
||||||
variables:
|
variables:
|
||||||
RAILS_ENV: "production"
|
RAILS_ENV: "production"
|
||||||
script:
|
script:
|
||||||
- rake zammad:db:unseeded
|
- rake zammad:db:unseeded
|
||||||
- rake assets:precompile
|
- rake assets:precompile
|
||||||
- rake db:drop
|
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
paths:
|
paths:
|
||||||
|
@ -340,13 +323,11 @@ browser:build:
|
||||||
## Browser core tests
|
## Browser core tests
|
||||||
|
|
||||||
.variables_browser_template: &variables_browser_definition
|
.variables_browser_template: &variables_browser_definition
|
||||||
RAILS_SERVE_STATIC_FILES: "true"
|
|
||||||
RAILS_ENV: "production"
|
RAILS_ENV: "production"
|
||||||
BROWSER_URL: "http://$IP:$BROWSER_PORT"
|
|
||||||
APP_RESTART_CMD: "rake zammad:ci:app:restart"
|
APP_RESTART_CMD: "rake zammad:ci:app:restart"
|
||||||
|
|
||||||
.test_browser_core_template: &test_browser_core_definition
|
.test_browser_core_template: &test_browser_core_definition
|
||||||
<<: *artifacts_error
|
<<: *base_env
|
||||||
stage: browser-core
|
stage: browser-core
|
||||||
dependencies:
|
dependencies:
|
||||||
- browser:build
|
- browser:build
|
||||||
|
@ -355,47 +336,42 @@ browser:build:
|
||||||
|
|
||||||
test:browser:integration:api_client_ruby:
|
test:browser:integration:api_client_ruby:
|
||||||
<<: *test_browser_core_definition
|
<<: *test_browser_core_definition
|
||||||
|
<<: *services_postgresql
|
||||||
variables:
|
variables:
|
||||||
<<: *variables_browser_definition
|
<<: *variables_browser_definition
|
||||||
TEST_URL: "http://$IP:$BROWSER_PORT/"
|
|
||||||
tags:
|
|
||||||
- browser
|
|
||||||
script:
|
script:
|
||||||
- RAILS_ENV=test rake db:create
|
- RAILS_ENV=test rake db:create
|
||||||
- cp contrib/auto_wizard_test.json auto_wizard.json
|
- cp contrib/auto_wizard_test.json auto_wizard.json
|
||||||
- rake zammad:ci:test:start
|
- rake zammad:ci:test:start
|
||||||
- git clone git@github.com:zammad/zammad-api-client-ruby.git || rake zammad:ci:test:fail
|
- git clone https://github.com/zammad/zammad-api-client-ruby.git
|
||||||
- cd zammad-api-client-ruby
|
- cd zammad-api-client-ruby
|
||||||
- bundle install -j $(nproc)
|
- bundle install -j $(nproc)
|
||||||
- bundle exec rspec || (cd .. && rake zammad:ci:test:fail)
|
- bundle exec rspec
|
||||||
- cd .. && rake zammad:ci:test:stop
|
|
||||||
|
|
||||||
test:browser:integration:api_client_php:
|
test:browser:integration:api_client_php:
|
||||||
<<: *test_browser_core_definition
|
<<: *test_browser_core_definition
|
||||||
|
<<: *services_postgresql
|
||||||
variables:
|
variables:
|
||||||
<<: *variables_browser_definition
|
<<: *variables_browser_definition
|
||||||
ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_URL: "http://$IP:$BROWSER_PORT"
|
ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_URL: "http://localhost:3000"
|
||||||
ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_USERNAME: "master@example.com"
|
ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_USERNAME: "master@example.com"
|
||||||
ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_PASSWORD: "test"
|
ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_PASSWORD: "test"
|
||||||
tags:
|
|
||||||
- browser
|
|
||||||
script:
|
script:
|
||||||
- RAILS_ENV=test rake db:create
|
- RAILS_ENV=test rake db:create
|
||||||
- rake zammad:ci:test:start zammad:setup:auto_wizard
|
- rake zammad:ci:test:start zammad:setup:auto_wizard
|
||||||
- git clone git@github.com:zammad/zammad-api-client-php || rake zammad:ci:test:fail
|
- git clone https://github.com/zammad/zammad-api-client-php.git
|
||||||
|
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||||
|
- php composer-setup.php --install-dir=/usr/local/bin
|
||||||
|
- ln -s /usr/local/bin/composer.phar /usr/local/bin/composer
|
||||||
- cd zammad-api-client-php
|
- cd zammad-api-client-php
|
||||||
- composer install
|
- composer install
|
||||||
- vendor/bin/phpunit || (cd .. && rake zammad:ci:test:fail)
|
- vendor/bin/phpunit
|
||||||
- cd .. && rake zammad:ci:test:stop
|
|
||||||
|
|
||||||
### Browser test slices
|
### Browser test slices
|
||||||
|
|
||||||
#### Templates
|
#### Templates
|
||||||
|
|
||||||
.script_browser_slice_template: &script_browser_slice_definition
|
.script_browser_slice_template: &script_browser_slice_definition
|
||||||
stage: browser-core
|
|
||||||
dependencies:
|
|
||||||
- browser:build
|
|
||||||
script:
|
script:
|
||||||
# temporary workaround to check Yahoo! mailbox only in test:browser:core:ff_3_* tests
|
# temporary workaround to check Yahoo! mailbox only in test:browser:core:ff_3_* tests
|
||||||
- if [[ $CI_JOB_NAME != test:browser:core:ff_3_* ]]; then unset MAILBOX_AUTO1 ; fi
|
- if [[ $CI_JOB_NAME != test:browser:core:ff_3_* ]]; then unset MAILBOX_AUTO1 ; fi
|
||||||
|
@ -406,22 +382,33 @@ test:browser:integration:api_client_php:
|
||||||
- script/build/test_slice_tests.sh $TEST_SLICE
|
- script/build/test_slice_tests.sh $TEST_SLICE
|
||||||
- RAILS_ENV=test rake db:create
|
- RAILS_ENV=test rake db:create
|
||||||
- rake zammad:ci:test:start[with_elasticsearch]
|
- rake zammad:ci:test:start[with_elasticsearch]
|
||||||
- rake test:browser || rake zammad:ci:test:fail
|
- rake test:browser
|
||||||
- rake zammad:ci:test:stop
|
|
||||||
|
|
||||||
.test_browser_core_postgresql_template: &test_browser_core_postgresql_definition
|
.test_browser_core_postgresql_template: &test_browser_core_postgresql_definition
|
||||||
<<: *test_browser_core_definition
|
<<: *test_browser_core_definition
|
||||||
tags:
|
|
||||||
- browser
|
|
||||||
- postgresql
|
|
||||||
<<: *script_browser_slice_definition
|
<<: *script_browser_slice_definition
|
||||||
|
services:
|
||||||
|
- name: registry.znuny.com/docker/zammad-postgresql:latest
|
||||||
|
alias: postgresql
|
||||||
|
- name: registry.znuny.com/docker/zammad-elasticsearch:latest
|
||||||
|
alias: elasticsearch
|
||||||
|
- name: docker.io/elgalu/selenium:latest
|
||||||
|
alias: selenium
|
||||||
|
- name: registry.znuny.com/docker/docker-imap-devel:latest
|
||||||
|
alias: mail
|
||||||
|
|
||||||
.test_browser_core_mysql_template: &test_browser_core_mysql_definition
|
.test_browser_core_mysql_template: &test_browser_core_mysql_definition
|
||||||
<<: *test_browser_core_definition
|
<<: *test_browser_core_definition
|
||||||
tags:
|
|
||||||
- browser
|
|
||||||
- mysql
|
|
||||||
<<: *script_browser_slice_definition
|
<<: *script_browser_slice_definition
|
||||||
|
services:
|
||||||
|
- name: registry.znuny.com/docker/zammad-mysql:latest
|
||||||
|
alias: mysql
|
||||||
|
- name: registry.znuny.com/docker/zammad-elasticsearch:latest
|
||||||
|
alias: elasticsearch
|
||||||
|
- name: docker.io/elgalu/selenium:latest
|
||||||
|
alias: selenium
|
||||||
|
- name: registry.znuny.com/docker/docker-imap-devel:latest
|
||||||
|
alias: mail
|
||||||
|
|
||||||
#### Firefox
|
#### Firefox
|
||||||
|
|
||||||
|
@ -597,8 +584,16 @@ test:browser:core:chrome_6_postgresql:
|
||||||
|
|
||||||
### Auto wizard
|
### Auto wizard
|
||||||
|
|
||||||
|
.auto_wizard_services_template: &auto_wizard_services
|
||||||
|
services:
|
||||||
|
- name: registry.znuny.com/docker/zammad-postgresql:latest
|
||||||
|
alias: postgresql
|
||||||
|
- name: docker.io/elgalu/selenium:latest
|
||||||
|
alias: selenium
|
||||||
|
|
||||||
.test_browser_integration_template: &test_browser_integration_definition
|
.test_browser_integration_template: &test_browser_integration_definition
|
||||||
<<: *artifacts_error
|
<<: *base_env
|
||||||
|
<<: *auto_wizard_services
|
||||||
stage: browser-integration
|
stage: browser-integration
|
||||||
dependencies:
|
dependencies:
|
||||||
- browser:build
|
- browser:build
|
||||||
|
@ -607,18 +602,16 @@ test:browser:core:chrome_6_postgresql:
|
||||||
script:
|
script:
|
||||||
- RAILS_ENV=test rake db:create
|
- RAILS_ENV=test rake db:create
|
||||||
- cp $AUTO_WIZARD_FILE auto_wizard.json
|
- cp $AUTO_WIZARD_FILE auto_wizard.json
|
||||||
- rake zammad:ci:test:start[with_elasticsearch]
|
- rake zammad:ci:test:start
|
||||||
- ruby -I test/ $TEST_FILE || rake zammad:ci:test:fail
|
- ruby -I test/ $TEST_FILE
|
||||||
- rake zammad:ci:test:stop
|
|
||||||
|
|
||||||
.browser_core_auto_wizard_template: &browser_core_auto_wizard_definition
|
.browser_core_auto_wizard_template: &browser_core_auto_wizard_definition
|
||||||
<<: *test_browser_core_definition
|
<<: *test_browser_core_definition
|
||||||
|
<<: *auto_wizard_services
|
||||||
<<: *script_integration_auto_wizard_definition
|
<<: *script_integration_auto_wizard_definition
|
||||||
|
|
||||||
test:browser:autowizard_chrome:
|
test:browser:autowizard_chrome:
|
||||||
<<: *browser_core_auto_wizard_definition
|
<<: *browser_core_auto_wizard_definition
|
||||||
tags:
|
|
||||||
- browser
|
|
||||||
variables:
|
variables:
|
||||||
<<: *variables_browser_definition
|
<<: *variables_browser_definition
|
||||||
BROWSER: "chrome"
|
BROWSER: "chrome"
|
||||||
|
@ -627,8 +620,6 @@ test:browser:autowizard_chrome:
|
||||||
|
|
||||||
test:browser:autowizard_ff:
|
test:browser:autowizard_ff:
|
||||||
<<: *browser_core_auto_wizard_definition
|
<<: *browser_core_auto_wizard_definition
|
||||||
tags:
|
|
||||||
- browser
|
|
||||||
variables:
|
variables:
|
||||||
<<: *variables_browser_definition
|
<<: *variables_browser_definition
|
||||||
BROWSER: "firefox"
|
BROWSER: "firefox"
|
||||||
|
@ -643,9 +634,6 @@ test:browser:autowizard_ff:
|
||||||
|
|
||||||
test:browser:integration:twitter_chrome:
|
test:browser:integration:twitter_chrome:
|
||||||
<<: *browser_integration_auto_wizard_definition
|
<<: *browser_integration_auto_wizard_definition
|
||||||
tags:
|
|
||||||
- browser
|
|
||||||
- twitter
|
|
||||||
variables:
|
variables:
|
||||||
<<: *variables_browser_definition
|
<<: *variables_browser_definition
|
||||||
BROWSER: "chrome"
|
BROWSER: "chrome"
|
||||||
|
@ -654,9 +642,6 @@ test:browser:integration:twitter_chrome:
|
||||||
|
|
||||||
test:browser:integration:twitter_ff:
|
test:browser:integration:twitter_ff:
|
||||||
<<: *browser_integration_auto_wizard_definition
|
<<: *browser_integration_auto_wizard_definition
|
||||||
tags:
|
|
||||||
- browser
|
|
||||||
- twitter
|
|
||||||
variables:
|
variables:
|
||||||
<<: *variables_browser_definition
|
<<: *variables_browser_definition
|
||||||
BROWSER: "firefox"
|
BROWSER: "firefox"
|
||||||
|
@ -665,9 +650,6 @@ test:browser:integration:twitter_ff:
|
||||||
|
|
||||||
test:browser:integration:facebook_chrome:
|
test:browser:integration:facebook_chrome:
|
||||||
<<: *browser_integration_auto_wizard_definition
|
<<: *browser_integration_auto_wizard_definition
|
||||||
tags:
|
|
||||||
- browser
|
|
||||||
- facebook
|
|
||||||
variables:
|
variables:
|
||||||
<<: *variables_browser_definition
|
<<: *variables_browser_definition
|
||||||
BROWSER: "chrome"
|
BROWSER: "chrome"
|
||||||
|
@ -676,9 +658,6 @@ test:browser:integration:facebook_chrome:
|
||||||
|
|
||||||
test:browser:integration:facebook_ff:
|
test:browser:integration:facebook_ff:
|
||||||
<<: *browser_integration_auto_wizard_definition
|
<<: *browser_integration_auto_wizard_definition
|
||||||
tags:
|
|
||||||
- browser
|
|
||||||
- facebook
|
|
||||||
variables:
|
variables:
|
||||||
<<: *variables_browser_definition
|
<<: *variables_browser_definition
|
||||||
BROWSER: "firefox"
|
BROWSER: "firefox"
|
||||||
|
@ -687,8 +666,6 @@ test:browser:integration:facebook_ff:
|
||||||
|
|
||||||
test:browser:integration:idoit_chrome:
|
test:browser:integration:idoit_chrome:
|
||||||
<<: *browser_integration_auto_wizard_definition
|
<<: *browser_integration_auto_wizard_definition
|
||||||
tags:
|
|
||||||
- browser
|
|
||||||
variables:
|
variables:
|
||||||
<<: *variables_browser_definition
|
<<: *variables_browser_definition
|
||||||
BROWSER: "chrome"
|
BROWSER: "chrome"
|
||||||
|
@ -699,17 +676,15 @@ test:browser:integration:idoit_chrome:
|
||||||
|
|
||||||
.variables_browser_import_template: &variables_browser_import_definition
|
.variables_browser_import_template: &variables_browser_import_definition
|
||||||
BROWSER: "chrome"
|
BROWSER: "chrome"
|
||||||
BROWSER_URL: "http://$IP:$BROWSER_PORT"
|
RAILS_SERVE_STATIC_FILES: "true"
|
||||||
|
RAILS_ENV: "production"
|
||||||
|
|
||||||
.browser_integration_import_template: &browser_integration_import_definition
|
.browser_integration_import_template: &browser_integration_import_definition
|
||||||
<<: *test_browser_integration_definition
|
<<: *test_browser_integration_definition
|
||||||
tags:
|
|
||||||
- browser
|
|
||||||
script:
|
script:
|
||||||
- RAILS_ENV=test rake db:create
|
- RAILS_ENV=test rake db:create
|
||||||
- rake zammad:ci:test:start
|
- rake zammad:ci:test:start
|
||||||
- ruby -I test/ $TEST_FILE
|
- ruby -I test/ $TEST_FILE
|
||||||
- rake zammad:ci:test:stop
|
|
||||||
|
|
||||||
test:browser:integration:otrs_chrome:
|
test:browser:integration:otrs_chrome:
|
||||||
<<: *browser_integration_import_definition
|
<<: *browser_integration_import_definition
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace :zammad do
|
||||||
|
|
||||||
next if args[:elasticsearch] != 'with_elasticsearch'
|
next if args[:elasticsearch] != 'with_elasticsearch'
|
||||||
|
|
||||||
Setting.set('es_url', 'http://localhost:9200')
|
Setting.set('es_url', 'http://elasticsearch:9200')
|
||||||
Setting.set('es_index', "browser_test_#{ENV['CI_BUILD_ID']}")
|
Setting.set('es_index', "browser_test_#{ENV['CI_BUILD_ID']}")
|
||||||
|
|
||||||
Rake::Task['searchindex:rebuild'].invoke
|
Rake::Task['searchindex:rebuild'].invoke
|
||||||
|
|
38
script/build/database_config.rb
Normal file
38
script/build/database_config.rb
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
require 'yaml'
|
||||||
|
|
||||||
|
cnf = YAML.load_file(File.join(__dir__, '../../config/database/database.yml'))
|
||||||
|
|
||||||
|
cnf.delete('default')
|
||||||
|
|
||||||
|
hostsfile = '/etc/hosts'
|
||||||
|
database = %w[postgresql mysql].find do |possible_database|
|
||||||
|
File.foreach(hostsfile).any? { |l| l[possible_database] }
|
||||||
|
end
|
||||||
|
|
||||||
|
raise "Can't find any supported database in #{hostsfile}." if database.nil?
|
||||||
|
|
||||||
|
db_settings_map = {
|
||||||
|
'postgresql' => {
|
||||||
|
'adapter' => 'postgresql',
|
||||||
|
'username' => 'zammad',
|
||||||
|
'password' => 'zammad',
|
||||||
|
'host' => 'postgresql', # db alias from gitlab-ci.yml
|
||||||
|
},
|
||||||
|
'mysql' => {
|
||||||
|
'adapter' => 'mysql2',
|
||||||
|
'username' => 'root',
|
||||||
|
'password' => 'zammad',
|
||||||
|
'host' => 'mysql', # db alias from gitlab-ci.yml
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# fetch DB settings from settings map and fallback to postgresql
|
||||||
|
db_settings = db_settings_map.fetch(database) { db_settings_map['postgresql'] }
|
||||||
|
|
||||||
|
%w[development test production].each do |environment|
|
||||||
|
cnf[environment].merge!(db_settings)
|
||||||
|
end
|
||||||
|
|
||||||
|
File.open('config/database.yml', 'w') do |file|
|
||||||
|
file.write(Psych.dump(cnf))
|
||||||
|
end
|
|
@ -1,4 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
rake db:drop RAILS_ENV=test
|
|
||||||
rake db:drop RAILS_ENV=production
|
|
|
@ -1,74 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
if [ "$RNAME" == '' ]; then
|
|
||||||
echo "ERROR: Env RNAME is missing!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$RDB" == '' ]; then
|
|
||||||
echo "ERROR: Env RDB is missing!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
export RAND=`perl -e 'print int(rand(999999999))'`
|
|
||||||
DBNAME="$RNAME-$RAND"
|
|
||||||
DBFILE=config/database.yml
|
|
||||||
DB_PRODUCTION=$DBNAME"_production"
|
|
||||||
DB_TEST=$DBNAME"_test"
|
|
||||||
DB_DEVELOPMENT=$DBNAME"_development"
|
|
||||||
|
|
||||||
echo "Creating $DBFILE for $RDB tests with $DBNAME"
|
|
||||||
|
|
||||||
if [ "$RDB" == 'mysql' ]; then
|
|
||||||
echo "production:" > $DBFILE
|
|
||||||
echo " adapter: mysql2" >> $DBFILE
|
|
||||||
echo " database: $DB_PRODUCTION" >> $DBFILE
|
|
||||||
echo " pool: 50" >> $DBFILE
|
|
||||||
echo " timeout: 5000" >> $DBFILE
|
|
||||||
echo " encoding: utf8" >> $DBFILE
|
|
||||||
echo " username: root" >> $DBFILE
|
|
||||||
echo " password:" >> $DBFILE
|
|
||||||
echo "test:" >> $DBFILE
|
|
||||||
echo " adapter: mysql2" >> $DBFILE
|
|
||||||
echo " database: $DB_TEST" >> $DBFILE
|
|
||||||
echo " pool: 50" >> $DBFILE
|
|
||||||
echo " timeout: 5000" >> $DBFILE
|
|
||||||
echo " encoding: utf8" >> $DBFILE
|
|
||||||
echo " username: root" >> $DBFILE
|
|
||||||
echo " password:" >> $DBFILE
|
|
||||||
echo "development:" >> $DBFILE
|
|
||||||
echo " adapter: mysql2" >> $DBFILE
|
|
||||||
echo " database: $DB_DEVELOPMENT" >> $DBFILE
|
|
||||||
echo " pool: 50" >> $DBFILE
|
|
||||||
echo " timeout: 5000" >> $DBFILE
|
|
||||||
echo " encoding: utf8" >> $DBFILE
|
|
||||||
echo " username: root" >> $DBFILE
|
|
||||||
echo " password:" >> $DBFILE
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$RDB" == 'postgresql' ]; then
|
|
||||||
echo "production:" > $DBFILE
|
|
||||||
echo " adapter: postgresql" >> $DBFILE
|
|
||||||
echo " database: $DB_PRODUCTION" >> $DBFILE
|
|
||||||
echo " pool: 50" >> $DBFILE
|
|
||||||
echo " timeout: 5000" >> $DBFILE
|
|
||||||
echo " encoding: utf8" >> $DBFILE
|
|
||||||
echo " username: gitlab-runner" >> $DBFILE
|
|
||||||
echo " password:" >> $DBFILE
|
|
||||||
echo "test:" >> $DBFILE
|
|
||||||
echo " adapter: postgresql" >> $DBFILE
|
|
||||||
echo " database: $DB_TEST" >> $DBFILE
|
|
||||||
echo " pool: 50" >> $DBFILE
|
|
||||||
echo " timeout: 5000" >> $DBFILE
|
|
||||||
echo " encoding: utf8" >> $DBFILE
|
|
||||||
echo " username: gitlab-runner" >> $DBFILE
|
|
||||||
echo " password:" >> $DBFILE
|
|
||||||
echo "development:" >> $DBFILE
|
|
||||||
echo " adapter: postgresql" >> $DBFILE
|
|
||||||
echo " database: $DB_DEVELOPMENT" >> $DBFILE
|
|
||||||
echo " pool: 50" >> $DBFILE
|
|
||||||
echo " timeout: 5000" >> $DBFILE
|
|
||||||
echo " encoding: utf8" >> $DBFILE
|
|
||||||
echo " username: gitlab-runner" >> $DBFILE
|
|
||||||
echo " password:" >> $DBFILE
|
|
||||||
fi
|
|
|
@ -1,36 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
RAILS_ENV=$1
|
|
||||||
APP_PORT=$2
|
|
||||||
WS_PORT=$3
|
|
||||||
EXIT=$4 || 0
|
|
||||||
WITH_DB=$5 || 0
|
|
||||||
WITH_ELASTICSEARCH=$6 || 0
|
|
||||||
|
|
||||||
SERVER_PID='tmp/pids/server.pid'
|
|
||||||
LOG_HOST='cilog@schneeberg.znuny.com'
|
|
||||||
|
|
||||||
bundle exec script/scheduler.rb stop
|
|
||||||
bundle exec script/websocket-server.rb stop
|
|
||||||
kill $(cat $SERVER_PID)
|
|
||||||
|
|
||||||
sleep 5
|
|
||||||
if [ -f $SERVER_PID ]; then
|
|
||||||
kill -9 $(cat $SERVER_PID)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test $WITH_DB -eq 1; then
|
|
||||||
script/build/test_cleanup.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test $WITH_ELASTICSEARCH -eq 1; then
|
|
||||||
rake searchindex:drop
|
|
||||||
fi
|
|
||||||
|
|
||||||
# if build has failed, copy logs for analyzing
|
|
||||||
if test $EXIT -eq 1; then
|
|
||||||
ssh $LOG_HOST "mkdir -p logs/$CI_BUILD_ID"
|
|
||||||
scp -C log/* $LOG_HOST:logs/$CI_BUILD_ID/
|
|
||||||
scp -C tmp/screenshot* $LOG_HOST:logs/$CI_BUILD_ID/
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit $EXIT
|
|
|
@ -1,33 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
RAILS_ENV=$1
|
|
||||||
APP_PORT=$2
|
|
||||||
WS_PORT=$3
|
|
||||||
WITH_DB=$4 || 0
|
|
||||||
WITH_ELASTICSEARCH=$5 || 0
|
|
||||||
|
|
||||||
if test $WITH_DB -eq 1; then
|
|
||||||
script/bootstrap.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
export ZAMMAD_SETTING_TTL=15
|
|
||||||
|
|
||||||
rails r "Setting.set('developer_mode', true)"
|
|
||||||
rails r "Setting.set('websocket_port', '$WS_PORT')"
|
|
||||||
rails r "Setting.set('fqdn', '$IP:$BROWSER_PORT')"
|
|
||||||
rails r "Setting.set('chat_agent_idle_timeout', '45')"
|
|
||||||
|
|
||||||
if test $WITH_ELASTICSEARCH -eq 1; then
|
|
||||||
rails r "Setting.set('es_url', 'http://localhost:9200')"
|
|
||||||
rails r "Setting.set('es_index', 'browser_test_$CI_BUILD_ID')"
|
|
||||||
rake searchindex:rebuild
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "env used for script/build/test_startup.sh $1 $2 $3"
|
|
||||||
echo "export RAILS_ENV=$RAILS_ENV"
|
|
||||||
echo "export IP=$IP"
|
|
||||||
echo "export BROWSER_PORT=$BROWSER_PORT"
|
|
||||||
|
|
||||||
#rails s puma -d --pid tmp/pids/server.pid --bind 0.0.0.0 --port $APP_PORT
|
|
||||||
bundle exec puma --pidfile tmp/pids/server.pid -d -p $APP_PORT -e $RAILS_ENV
|
|
||||||
bundle exec script/websocket-server.rb start -d -p $WS_PORT
|
|
||||||
bundle exec script/scheduler.rb start
|
|
|
@ -6,7 +6,7 @@ VCR.configure do |config|
|
||||||
config.ignore_request do |request|
|
config.ignore_request do |request|
|
||||||
uri = URI(request.uri)
|
uri = URI(request.uri)
|
||||||
|
|
||||||
['zammad.com', 'google.com'].any? do |site|
|
['zammad.com', 'google.com', 'elasticsearch', 'selenium'].any? do |site|
|
||||||
uri.host.include?(site)
|
uri.host.include?(site)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -46,7 +46,15 @@ class TestCase < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def browser_url
|
def browser_url
|
||||||
ENV['BROWSER_URL'] || 'http://localhost:3000'
|
return ENV['BROWSER_URL'] if ENV['BROWSER_URL'].present?
|
||||||
|
|
||||||
|
"http://#{host}:3000"
|
||||||
|
end
|
||||||
|
|
||||||
|
def host
|
||||||
|
return 'localhost' if ENV['CI'].blank?
|
||||||
|
|
||||||
|
Socket.ip_address_list.detect(&:ipv4_private?).ip_address
|
||||||
end
|
end
|
||||||
|
|
||||||
def browser_instance
|
def browser_instance
|
||||||
|
|
Loading…
Reference in a new issue