123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773 |
- variables:
- Z_LOCALES: "en-us:de-de"
- .artifacts_error_template: &artifacts_error
- artifacts:
- expire_in: 2 days
- when: on_failure
- paths:
- - tmp/screenshot*
- - log/*.log
- before_script:
- - ruby -v
- - which ruby
- - env
- - test -n "$RNAME" && script/build/test_db_config.sh
- - test -n "$RNAME" && bundle install -j $(nproc)
- stages:
- - pre
- - test
- - browser-core
- - browser-integration
- # pre stage
- pre:rubocop:
- stage: pre
- tags:
- - core
- script:
- - bundle exec rubocop
- pre:coffeelint:
- stage: pre
- tags:
- - core
- script:
- - coffeelint app/
- pre:bundle-audit:
- stage: pre
- tags:
- - core
- script:
- - gem install bundler-audit
- - bundle-audit update
- - bundle-audit
- pre:github:
- stage: pre
- tags:
- - deploy
- script:
- - script/build/sync_repo.sh git@github.com:zammad/zammad.git
- # test stage
- ## RSpec
- .script_rspec_template: &script_rspec_definition
- <<: *artifacts_error
- variables:
- RAILS_ENV: "test"
- script:
- - rake zammad:db:init
- - bundle exec rspec
- - rake db:drop
- test:rspec:mysql:
- stage: test
- tags:
- - core
- - mysql
- <<: *script_rspec_definition
- test:rspec:postgresql:
- stage: test
- tags:
- - core
- - postgresql
- <<: *script_rspec_definition
- ## Unit and Controller tests
- .script_unit_template: &script_unit_definition
- <<: *artifacts_error
- variables:
- RAILS_ENV: "test"
- script:
- - rake zammad:db:init
- - rake test:units
- - ruby -I test/ test/integration/object_manager_test.rb
- - ruby -I test/ test/integration/object_manager_attributes_controller_test.rb
- - ruby -I test/ test/integration/package_test.rb
- - ruby -I test/ test/integration/monitoring_controller_test.rb
- - rake db:drop
- test:unit:mysql:
- stage: test
- tags:
- - core
- - mysql
- <<: *script_unit_definition
- test:unit:postgresql:
- stage: test
- tags:
- - core
- - postgresql
- <<: *script_unit_definition
- ## Integration tests
- test:integration:email_helper_deliver:
- <<: *artifacts_error
- stage: test
- variables:
- RAILS_ENV: "test"
- tags:
- - core
- script:
- - rake zammad:db:unseeded
- - ruby -I test/ test/integration/email_helper_test.rb
- - ruby -I test/ test/integration/email_deliver_test.rb
- - ruby -I test/ test/integration/email_keep_on_server_test.rb
- - rake db:drop
- test:integration:twitter:
- <<: *artifacts_error
- stage: test
- variables:
- RAILS_ENV: "test"
- tags:
- - core-twitter
- script:
- - rake zammad:db:init
- - ruby -I test/ test/integration/twitter_test.rb
- - rake db:drop
- allow_failure: true
- test:integration:facebook:
- <<: *artifacts_error
- stage: test
- variables:
- RAILS_ENV: "test"
- tags:
- - core-facebook
- script:
- - rake zammad:db:init
- - ruby -I test/ test/integration/facebook_test.rb
- - rake db:drop
- allow_failure: true
- test:integration:geo:
- <<: *artifacts_error
- stage: test
- variables:
- RAILS_ENV: "test"
- tags:
- - core
- script:
- - rake zammad:db:unseeded
- - ruby -I test/ test/integration/geo_calendar_test.rb
- - ruby -I test/ test/integration/geo_location_test.rb
- - ruby -I test/ test/integration/geo_ip_test.rb
- - rake db:drop
- test:integration:user_agent:
- <<: *artifacts_error
- stage: test
- variables:
- RAILS_ENV: "test"
- tags:
- - core
- script:
- - rake zammad:db:unseeded
- - ruby -I test/ test/integration/user_agent_test.rb
- - export ZAMMAD_PROXY_TEST=true
- - ruby -I test/ test/integration/user_agent_test.rb
- - rake db:drop
- allow_failure: true
- test:integration:user_device:
- <<: *artifacts_error
- stage: test
- variables:
- RAILS_ENV: "test"
- tags:
- - core
- script:
- - rake zammad:db:unseeded
- - ruby -I test/ test/integration/user_device_controller_test.rb
- - rake db:drop
- test:integration:slack:
- <<: *artifacts_error
- stage: test
- variables:
- RAILS_ENV: "test"
- tags:
- - core
- script:
- - rake zammad:db:unseeded
- - echo "gem 'slack-api'" >> Gemfile.local
- - bundle install -j $(nproc)
- - ruby -I test test/integration/slack_test.rb
- - rake db:drop
- test:integration:clearbit:
- <<: *artifacts_error
- stage: test
- variables:
- RAILS_ENV: "test"
- tags:
- - core
- script:
- - rake zammad:db:unseeded
- - ruby -I test test/integration/clearbit_test.rb
- - rake db:drop
- allow_failure: true
- test:integration:telegram:
- <<: *artifacts_error
- stage: test
- variables:
- RAILS_ENV: "test"
- tags:
- - core
- script:
- - rake zammad:db:init
- - ruby -I test test/integration/telegram_controller_test.rb
- - rake db:drop
- test:integration:idoit:
- <<: *artifacts_error
- stage: test
- variables:
- RAILS_ENV: "test"
- tags:
- - core
- script:
- - rake zammad:db:init
- - ruby -I test test/integration/idoit_controller_test.rb
- - rake db:drop
- ### Elasticsearch
- .script_elasticsearch_template: &script_elasticsearch_definition
- <<: *artifacts_error
- stage: test
- variables:
- RAILS_ENV: "test"
- ES_INDEX_RAND: "true"
- ES_URL: "http://localhost:9200"
- script:
- - rake zammad:db:unseeded
- - ruby -I test/ test/integration/elasticsearch_active_test.rb
- - ruby -I test/ test/integration/elasticsearch_test.rb
- - ruby -I test/ test/integration/report_test.rb
- - bundle exec rspec --tag searchindex
- - rake db:drop
- test:integration:es_mysql:
- tags:
- - core
- - mysql
- <<: *script_elasticsearch_definition
- test:integration:es_postgresql:
- tags:
- - core
- - postgresql
- <<: *script_elasticsearch_definition
- ### Zendesk
- .script_integration_zendesk_template: &script_integration_zendesk_definition
- <<: *artifacts_error
- stage: test
- variables:
- RAILS_ENV: "test"
- script:
- - rake zammad:db:unseeded
- - ruby -I test/ test/integration/zendesk_import_test.rb
- - rake db:drop
- allow_failure: true
- test:integration:zendesk_mysql:
- tags:
- - core
- - mysql
- <<: *script_integration_zendesk_definition
- test:integration:zendesk_postgresql:
- tags:
- - core
- - postgresql
- <<: *script_integration_zendesk_definition
- ### OTRS
- .script_integration_otrs_template: &script_integration_otrs_definition
- <<: *artifacts_error
- stage: test
- script:
- - rake zammad:db:unseeded
- - ruby -I test/ test/integration/otrs_import_test.rb
- - rake db:drop
- .variables_integration_otrs_6_template: &variables_integration_otrs_6_definition
- variables:
- RAILS_ENV: "test"
- IMPORT_OTRS_ENDPOINT: "https://vz1185.test.znuny.com/otrs/public.pl?Action=ZammadMigrator"
- test:integration:otrs_6_mysql:
- tags:
- - core
- - mysql
- <<: *script_integration_otrs_definition
- <<: *variables_integration_otrs_6_definition
- test:integration:otrs_6_postgresql:
- tags:
- - core
- - postgresql
- <<: *script_integration_otrs_definition
- <<: *variables_integration_otrs_6_definition
- test:integration:otrs_5:
- tags:
- - core
- variables:
- RAILS_ENV: "test"
- IMPORT_OTRS_ENDPOINT: "http://vz1109.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator"
- <<: *script_integration_otrs_definition
- test:integration:otrs_4:
- tags:
- - core
- variables:
- RAILS_ENV: "test"
- IMPORT_OTRS_ENDPOINT: "http://vz383.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator"
- <<: *script_integration_otrs_definition
- test:integration:otrs_33:
- tags:
- - core
- variables:
- RAILS_ENV: "test"
- IMPORT_OTRS_ENDPOINT: "http://vz305.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator"
- <<: *script_integration_otrs_definition
- test:integration:otrs_32:
- tags:
- - core
- variables:
- RAILS_ENV: "test"
- IMPORT_OTRS_ENDPOINT: "http://vz382.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator"
- <<: *script_integration_otrs_definition
- test:integration:otrs_31:
- tags:
- - core
- variables:
- RAILS_ENV: "test"
- IMPORT_OTRS_ENDPOINT: "http://vz381.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator"
- <<: *script_integration_otrs_definition
- # Browser tests
- ## preparation (asset precompile)
- browser:build:
- stage: test
- tags:
- - core
- variables:
- RAILS_ENV: "production"
- script:
- - rake zammad:db:unseeded
- - rake assets:precompile
- - rake db:drop
- artifacts:
- expire_in: 1 week
- paths:
- - public/assets/.sprockets-manifest*
- - public/assets/application-*
- - public/assets/print-*
- ## Browser core tests
- .variables_browser_template: &variables_browser_definition
- RAILS_SERVE_STATIC_FILES: "true"
- RAILS_ENV: "production"
- BROWSER_URL: "http://$IP:$BROWSER_PORT"
- APP_RESTART_CMD: "rake zammad:ci:app:restart"
- .test_browser_core_template: &test_browser_core_definition
- <<: *artifacts_error
- stage: browser-core
- dependencies:
- - browser:build
- ### API clients
- test:browser:integration:api_client_ruby:
- <<: *test_browser_core_definition
- variables:
- <<: *variables_browser_definition
- TEST_URL: "http://$IP:$BROWSER_PORT/"
- tags:
- - browser
- script:
- - RAILS_ENV=test rake db:create
- - cp contrib/auto_wizard_test.json auto_wizard.json
- - rake zammad:ci:test:start
- - git clone git@github.com:zammad/zammad-api-client-ruby.git || rake zammad:ci:test:fail
- - cd zammad-api-client-ruby
- - bundle install -j $(nproc)
- - bundle exec rspec || (cd .. && rake zammad:ci:test:fail)
- - cd .. && rake zammad:ci:test:stop
- test:browser:integration:api_client_php:
- <<: *test_browser_core_definition
- variables:
- <<: *variables_browser_definition
- ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_URL: "http://$IP:$BROWSER_PORT"
- ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_USERNAME: "master@example.com"
- ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_PASSWORD: "test"
- tags:
- - browser
- script:
- - RAILS_ENV=test rake db:create
- - rake zammad:ci:test:start zammad:setup:auto_wizard
- - git clone git@github.com:zammad/zammad-api-client-php || rake zammad:ci:test:fail
- - cd zammad-api-client-php
- - composer install
- - vendor/bin/phpunit || (cd .. && rake zammad:ci:test:fail)
- - cd .. && rake zammad:ci:test:stop
- ### Browser test slices
- #### Templates
- .script_browser_slice_template: &script_browser_slice_definition
- stage: browser-core
- dependencies:
- - browser:build
- script:
- # 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_AUTO2 ; fi
- - if [[ $CI_JOB_NAME != test:browser:core:ff_3_* ]]; then unset MAILBOX_MANUAL1 ; fi
- - if [[ $CI_JOB_NAME != test:browser:core:ff_3_* ]]; then unset MAILBOX_MANUAL2 ; fi
- - env
- - script/build/test_slice_tests.sh $TEST_SLICE
- - RAILS_ENV=test rake db:create
- - rake zammad:ci:test:start[with_elasticsearch]
- - rake test:browser || rake zammad:ci:test:fail
- - rake zammad:ci:test:stop
- .test_browser_core_postgresql_template: &test_browser_core_postgresql_definition
- <<: *test_browser_core_definition
- tags:
- - browser
- - postgresql
- <<: *script_browser_slice_definition
- .test_browser_core_mysql_template: &test_browser_core_mysql_definition
- <<: *test_browser_core_definition
- tags:
- - browser
- - mysql
- <<: *script_browser_slice_definition
- #### Firefox
- test:browser:core:ff_1_mysql:
- <<: *test_browser_core_mysql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "firefox"
- TEST_SLICE: "1"
- test:browser:core:ff_2_mysql:
- <<: *test_browser_core_mysql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "firefox"
- TEST_SLICE: "2"
- test:browser:core:ff_3_mysql:
- <<: *test_browser_core_mysql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "firefox"
- TEST_SLICE: "3"
- test:browser:core:ff_4_mysql:
- <<: *test_browser_core_mysql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "firefox"
- TEST_SLICE: "4"
- test:browser:core:ff_5_mysql:
- <<: *test_browser_core_mysql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "firefox"
- TEST_SLICE: "5"
- test:browser:core:ff_6_mysql:
- <<: *test_browser_core_mysql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "firefox"
- TEST_SLICE: "6"
- test:browser:core:ff_1_postgresql:
- <<: *test_browser_core_postgresql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "firefox"
- TEST_SLICE: "1"
- test:browser:core:ff_2_postgresql:
- <<: *test_browser_core_postgresql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "firefox"
- TEST_SLICE: "2"
- test:browser:core:ff_3_postgresql:
- <<: *test_browser_core_postgresql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "firefox"
- TEST_SLICE: "3"
- test:browser:core:ff_4_postgresql:
- <<: *test_browser_core_postgresql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "firefox"
- TEST_SLICE: "4"
- test:browser:core:ff_5_postgresql:
- <<: *test_browser_core_postgresql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "firefox"
- TEST_SLICE: "5"
- test:browser:core:ff_6_postgresql:
- <<: *test_browser_core_postgresql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "firefox"
- TEST_SLICE: "6"
- ### Chrome
- test:browser:core:chrome_1_mysql:
- <<: *test_browser_core_mysql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "chrome"
- TEST_SLICE: "1"
- test:browser:core:chrome_2_mysql:
- <<: *test_browser_core_mysql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "chrome"
- TEST_SLICE: "2"
- test:browser:core:chrome_3_mysql:
- <<: *test_browser_core_mysql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "chrome"
- TEST_SLICE: "3"
- test:browser:core:chrome_4_mysql:
- <<: *test_browser_core_mysql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "chrome"
- TEST_SLICE: "4"
- test:browser:core:chrome_5_mysql:
- <<: *test_browser_core_mysql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "chrome"
- TEST_SLICE: "5"
- test:browser:core:chrome_6_mysql:
- <<: *test_browser_core_mysql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "chrome"
- TEST_SLICE: "6"
- test:browser:core:chrome_1_postgresql:
- <<: *test_browser_core_postgresql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "chrome"
- TEST_SLICE: "1"
- test:browser:core:chrome_2_postgresql:
- <<: *test_browser_core_postgresql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "chrome"
- TEST_SLICE: "2"
- test:browser:core:chrome_3_postgresql:
- <<: *test_browser_core_postgresql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "chrome"
- TEST_SLICE: "3"
- test:browser:core:chrome_4_postgresql:
- <<: *test_browser_core_postgresql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "chrome"
- TEST_SLICE: "4"
- test:browser:core:chrome_5_postgresql:
- <<: *test_browser_core_postgresql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "chrome"
- TEST_SLICE: "5"
- test:browser:core:chrome_6_postgresql:
- <<: *test_browser_core_postgresql_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "chrome"
- TEST_SLICE: "6"
- ### Auto wizard
- .test_browser_integration_template: &test_browser_integration_definition
- <<: *artifacts_error
- stage: browser-integration
- dependencies:
- - browser:build
- .script_integration_auto_wizard_template: &script_integration_auto_wizard_definition
- script:
- - RAILS_ENV=test rake db:create
- - cp $AUTO_WIZARD_FILE auto_wizard.json
- - rake zammad:ci:test:start[with_elasticsearch]
- - ruby -I test/ $TEST_FILE || rake zammad:ci:test:fail
- - rake zammad:ci:test:stop
- .browser_core_auto_wizard_template: &browser_core_auto_wizard_definition
- <<: *test_browser_core_definition
- <<: *script_integration_auto_wizard_definition
- test:browser:autowizard_chrome:
- <<: *browser_core_auto_wizard_definition
- tags:
- - browser
- variables:
- <<: *variables_browser_definition
- BROWSER: "chrome"
- AUTO_WIZARD_FILE: "contrib/auto_wizard_example.json"
- TEST_FILE: "test/integration/auto_wizard_browser_test.rb"
- test:browser:autowizard_ff:
- <<: *browser_core_auto_wizard_definition
- tags:
- - browser
- variables:
- <<: *variables_browser_definition
- BROWSER: "firefox"
- AUTO_WIZARD_FILE: "contrib/auto_wizard_example.json"
- TEST_FILE: "test/integration/auto_wizard_browser_test.rb"
- ### Browser integration tests
- .browser_integration_auto_wizard_template: &browser_integration_auto_wizard_definition
- <<: *test_browser_integration_definition
- <<: *script_integration_auto_wizard_definition
- test:browser:integration:twitter_chrome:
- <<: *browser_integration_auto_wizard_definition
- tags:
- - browser
- - twitter
- variables:
- <<: *variables_browser_definition
- BROWSER: "chrome"
- AUTO_WIZARD_FILE: "contrib/auto_wizard_test.json"
- TEST_FILE: "test/integration/twitter_browser_test.rb"
- test:browser:integration:twitter_ff:
- <<: *browser_integration_auto_wizard_definition
- tags:
- - browser
- - twitter
- variables:
- <<: *variables_browser_definition
- BROWSER: "firefox"
- AUTO_WIZARD_FILE: "contrib/auto_wizard_test.json"
- TEST_FILE: "test/integration/twitter_browser_test.rb"
- test:browser:integration:facebook_chrome:
- <<: *browser_integration_auto_wizard_definition
- tags:
- - browser
- - facebook
- variables:
- <<: *variables_browser_definition
- BROWSER: "chrome"
- AUTO_WIZARD_FILE: "contrib/auto_wizard_test.json"
- TEST_FILE: "test/integration/facebook_browser_test.rb"
- test:browser:integration:facebook_ff:
- <<: *browser_integration_auto_wizard_definition
- tags:
- - browser
- - facebook
- variables:
- <<: *variables_browser_definition
- BROWSER: "firefox"
- AUTO_WIZARD_FILE: "contrib/auto_wizard_test.json"
- TEST_FILE: "test/integration/facebook_browser_test.rb"
- test:browser:integration:idoit_chrome:
- <<: *browser_integration_auto_wizard_definition
- variables:
- <<: *variables_browser_definition
- BROWSER: "chrome"
- AUTO_WIZARD_FILE: "contrib/auto_wizard_test.json"
- TEST_FILE: "test/integration/idoit_browser_test.rb"
- ### Browser integration tests
- .variables_browser_import_template: &variables_browser_import_definition
- BROWSER: "chrome"
- BROWSER_URL: "http://$IP:$BROWSER_PORT"
- .browser_integration_import_template: &browser_integration_import_definition
- <<: *test_browser_integration_definition
- tags:
- - browser
- script:
- - RAILS_ENV=test rake db:create
- - rake zammad:ci:test:start
- - ruby -I test/ $TEST_FILE
- - rake zammad:ci:test:stop
- test:browser:integration:otrs_chrome:
- <<: *browser_integration_import_definition
- variables:
- <<: *variables_browser_import_definition
- TEST_FILE: "test/integration/otrs_import_browser_test.rb"
- test:browser:integration:zendesk_chrome:
- <<: *browser_integration_import_definition
- variables:
- <<: *variables_browser_import_definition
- TEST_FILE: "test/integration/zendesk_import_browser_test.rb"
|