.gitlab-ci.yml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755
  1. image: registry.znuny.com/docker/zammad-ruby:2.4.4
  2. # Global variables added to the ENV of each job
  3. variables:
  4. # for faster translation loading
  5. Z_LOCALES: "en-us:de-de"
  6. # Browser tests and variables
  7. RAILS_SERVE_STATIC_FILES: "true"
  8. REMOTE_URL: "http://selenium:24444/wd/hub"
  9. TZ: "Europe/London"
  10. # docker elgalu/selenium variables for parallel browser instance creation
  11. MAX_INSTANCES: "50"
  12. MAX_SESSIONS: "50"
  13. # docker-imap-devel variables required for browser tests
  14. MAILNAME: "mail.test.dc.zammad.com"
  15. MAILBOX_INIT: "zammad@mail.test.dc.zammad.com:zammad"
  16. MAIL_ADDRESS: "zammad@mail.test.dc.zammad.com"
  17. MAIL_PASS: "zammad"
  18. # Artifacts are stored for failed jobs for 2 days
  19. .artifacts_error_template: &artifacts_error
  20. artifacts:
  21. expire_in: 2 days
  22. when: on_failure
  23. paths:
  24. - tmp/screenshot*
  25. - tmp/screenshots/*
  26. - log/*.log
  27. # Workaround to enable usage of mixed SSH and Docker GitLab CI runners
  28. .docker_env_template: &docker_env
  29. tags:
  30. - docker
  31. .base_env_template: &base_env
  32. <<: *docker_env
  33. <<: *artifacts_error
  34. # General required Docker services for different DB envs
  35. .services_mysql_template: &services_mysql
  36. services:
  37. - name: registry.znuny.com/docker/zammad-mysql:latest
  38. alias: mysql
  39. .services_postgresql_template: &services_postgresql
  40. services:
  41. - name: registry.znuny.com/docker/zammad-postgresql:latest
  42. alias: postgresql
  43. # Cache gems in between jobs and pipelines
  44. cache:
  45. key: "ruby24"
  46. paths:
  47. - vendor/ruby
  48. # Initialize application env
  49. before_script:
  50. - bundle install -j $(nproc) --path vendor
  51. - bundle exec ruby script/build/database_config.rb
  52. # Stages
  53. stages:
  54. - pre
  55. - test
  56. - browser-core
  57. - browser-integration
  58. # pre stage
  59. # Workaround to enable usage of mixed SSH and Docker GitLab CI runners
  60. .pre_stage_template: &pre_stage
  61. <<: *docker_env
  62. stage: pre
  63. before_script:
  64. - '' # disable before_script for pre "non-application" env
  65. pre:rubocop:
  66. <<: *pre_stage
  67. script:
  68. - bundle install -j $(nproc) --path vendor
  69. - bundle exec rubocop
  70. pre:coffeelint:
  71. <<: *pre_stage
  72. script:
  73. - coffeelint app/
  74. pre:bundle-audit:
  75. <<: *pre_stage
  76. script:
  77. - gem install bundler-audit
  78. - bundle-audit update
  79. - bundle-audit
  80. pre:github:
  81. <<: *pre_stage
  82. tags:
  83. - deploy
  84. script:
  85. - script/build/sync_repo.sh git@github.com:zammad/zammad.git
  86. # test stage
  87. ## RSpec
  88. .script_rspec_template: &script_rspec_definition
  89. <<: *base_env
  90. variables:
  91. RAILS_ENV: "test"
  92. script:
  93. - bundle exec rake zammad:db:init
  94. - bundle exec rspec -t ~type:system
  95. test:rspec:mysql:
  96. stage: test
  97. <<: *services_mysql
  98. <<: *script_rspec_definition
  99. test:rspec:postgresql:
  100. stage: test
  101. <<: *services_postgresql
  102. <<: *script_rspec_definition
  103. ## Unit and Controller tests
  104. .script_unit_template: &script_unit_definition
  105. <<: *base_env
  106. variables:
  107. RAILS_ENV: "test"
  108. script:
  109. - bundle exec rake zammad:db:init
  110. - bundle exec rake test:units
  111. - bundle exec ruby -I test/ test/integration/object_manager_test.rb
  112. - bundle exec ruby -I test/ test/integration/package_test.rb
  113. test:unit:mysql:
  114. stage: test
  115. <<: *services_mysql
  116. <<: *script_unit_definition
  117. test:unit:postgresql:
  118. stage: test
  119. <<: *services_postgresql
  120. <<: *script_unit_definition
  121. ## Integration tests
  122. .test_integration_template: &test_integration_definition
  123. <<: *base_env
  124. <<: *services_postgresql
  125. stage: test
  126. variables:
  127. RAILS_ENV: "test"
  128. test:integration:email_helper_deliver:
  129. <<: *test_integration_definition
  130. script:
  131. - bundle exec rake zammad:db:unseeded
  132. - bundle exec ruby -I test/ test/integration/email_helper_test.rb
  133. - bundle exec ruby -I test/ test/integration/email_deliver_test.rb
  134. - bundle exec ruby -I test/ test/integration/email_keep_on_server_test.rb
  135. test:integration:facebook:
  136. <<: *test_integration_definition
  137. script:
  138. - bundle exec rake zammad:db:init
  139. - bundle exec ruby -I test/ test/integration/facebook_test.rb
  140. allow_failure: true
  141. test:integration:geo:
  142. <<: *test_integration_definition
  143. script:
  144. - bundle exec rake zammad:db:unseeded
  145. - bundle exec ruby -I test/ test/integration/geo_calendar_test.rb
  146. - bundle exec ruby -I test/ test/integration/geo_location_test.rb
  147. - bundle exec ruby -I test/ test/integration/geo_ip_test.rb
  148. test:integration:user_agent:
  149. <<: *test_integration_definition
  150. script:
  151. - bundle exec rake zammad:db:unseeded
  152. - bundle exec ruby -I test/ test/integration/user_agent_test.rb
  153. - export ZAMMAD_PROXY_TEST=true
  154. - bundle exec ruby -I test/ test/integration/user_agent_test.rb
  155. allow_failure: true
  156. test:integration:slack:
  157. <<: *test_integration_definition
  158. script:
  159. - bundle exec rake zammad:db:unseeded
  160. - echo "gem 'slack-api'" >> Gemfile.local
  161. - bundle install -j $(nproc)
  162. - bundle exec ruby -I test test/integration/slack_test.rb
  163. test:integration:clearbit:
  164. <<: *test_integration_definition
  165. script:
  166. - bundle exec rake zammad:db:unseeded
  167. - bundle exec ruby -I test test/integration/clearbit_test.rb
  168. allow_failure: true
  169. ### Elasticsearch
  170. .script_elasticsearch_template: &script_elasticsearch_definition
  171. <<: *base_env
  172. stage: test
  173. variables:
  174. RAILS_ENV: "test"
  175. ES_INDEX_RAND: "true"
  176. ES_URL: "http://elasticsearch:9200"
  177. script:
  178. - bundle exec rake zammad:db:unseeded
  179. - bundle exec ruby -I test/ test/integration/elasticsearch_active_test.rb
  180. - bundle exec ruby -I test/ test/integration/elasticsearch_test.rb
  181. - bundle exec ruby -I test/ test/integration/report_test.rb
  182. - bundle exec rspec --tag searchindex
  183. test:integration:es_mysql:
  184. <<: *script_elasticsearch_definition
  185. services:
  186. - name: registry.znuny.com/docker/zammad-mysql:latest
  187. alias: mysql
  188. - name: registry.znuny.com/docker/zammad-elasticsearch:latest
  189. alias: elasticsearch
  190. test:integration:es_postgresql:
  191. <<: *script_elasticsearch_definition
  192. services:
  193. - name: registry.znuny.com/docker/zammad-postgresql:latest
  194. alias: postgresql
  195. - name: registry.znuny.com/docker/zammad-elasticsearch:latest
  196. alias: elasticsearch
  197. ### Zendesk
  198. .script_integration_zendesk_template: &script_integration_zendesk_definition
  199. <<: *base_env
  200. <<: *services_postgresql
  201. stage: test
  202. variables:
  203. RAILS_ENV: "test"
  204. script:
  205. - bundle exec rake zammad:db:unseeded
  206. - bundle exec ruby -I test/ test/integration/zendesk_import_test.rb
  207. allow_failure: true
  208. test:integration:zendesk_mysql:
  209. <<: *services_mysql
  210. <<: *script_integration_zendesk_definition
  211. test:integration:zendesk_postgresql:
  212. <<: *services_postgresql
  213. <<: *script_integration_zendesk_definition
  214. ### OTRS
  215. .script_integration_otrs_template: &script_integration_otrs_definition
  216. <<: *base_env
  217. stage: test
  218. script:
  219. - bundle exec rake zammad:db:unseeded
  220. - bundle exec ruby -I test/ test/integration/otrs_import_test.rb
  221. .variables_integration_otrs_6_template: &variables_integration_otrs_6_definition
  222. variables:
  223. RAILS_ENV: "test"
  224. IMPORT_OTRS_ENDPOINT: "https://vz1185.test.znuny.com/otrs/public.pl?Action=ZammadMigrator"
  225. test:integration:otrs_6_mysql:
  226. <<: *services_mysql
  227. <<: *script_integration_otrs_definition
  228. <<: *variables_integration_otrs_6_definition
  229. test:integration:otrs_6_postgresql:
  230. <<: *services_postgresql
  231. <<: *script_integration_otrs_definition
  232. <<: *variables_integration_otrs_6_definition
  233. test:integration:otrs_5:
  234. <<: *services_postgresql
  235. variables:
  236. RAILS_ENV: "test"
  237. IMPORT_OTRS_ENDPOINT: "http://vz1109.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator"
  238. <<: *script_integration_otrs_definition
  239. test:integration:otrs_4:
  240. <<: *services_postgresql
  241. variables:
  242. RAILS_ENV: "test"
  243. IMPORT_OTRS_ENDPOINT: "http://vz383.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator"
  244. <<: *script_integration_otrs_definition
  245. test:integration:otrs_33:
  246. <<: *services_postgresql
  247. variables:
  248. RAILS_ENV: "test"
  249. IMPORT_OTRS_ENDPOINT: "http://vz305.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator"
  250. <<: *script_integration_otrs_definition
  251. test:integration:otrs_32:
  252. <<: *services_postgresql
  253. variables:
  254. RAILS_ENV: "test"
  255. IMPORT_OTRS_ENDPOINT: "http://vz382.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator"
  256. <<: *script_integration_otrs_definition
  257. test:integration:otrs_31:
  258. <<: *services_postgresql
  259. variables:
  260. RAILS_ENV: "test"
  261. IMPORT_OTRS_ENDPOINT: "http://vz381.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator"
  262. <<: *script_integration_otrs_definition
  263. # Browser tests
  264. ## preparation (asset precompile)
  265. browser:build:
  266. <<: *base_env
  267. <<: *services_postgresql
  268. stage: test
  269. variables:
  270. RAILS_ENV: "production"
  271. script:
  272. - bundle exec rake zammad:db:unseeded
  273. - bundle exec rake assets:precompile
  274. artifacts:
  275. expire_in: 1 week
  276. paths:
  277. - public/assets/.sprockets-manifest*
  278. - public/assets/application-*
  279. - public/assets/print-*
  280. .services_browser_postgresql_template: &services_browser_postgresql_definition
  281. services:
  282. - name: registry.znuny.com/docker/zammad-postgresql:latest
  283. alias: postgresql
  284. - name: registry.znuny.com/docker/zammad-elasticsearch:latest
  285. alias: elasticsearch
  286. - name: docker.io/elgalu/selenium:latest
  287. alias: selenium
  288. - name: registry.znuny.com/docker/docker-imap-devel:latest
  289. alias: mail
  290. .services_browser_mysql_template: &services_browser_mysql_definition
  291. services:
  292. - name: registry.znuny.com/docker/zammad-mysql:latest
  293. alias: mysql
  294. - name: registry.znuny.com/docker/zammad-elasticsearch:latest
  295. alias: elasticsearch
  296. - name: docker.io/elgalu/selenium:latest
  297. alias: selenium
  298. - name: registry.znuny.com/docker/docker-imap-devel:latest
  299. alias: mail
  300. ## Capybara
  301. .test_capybara_template: &test_capybara_definition
  302. <<: *base_env
  303. stage: browser-core
  304. script:
  305. - bundle exec rake zammad:ci:test:prepare[with_elasticsearch]
  306. - bundle exec rspec --fail-fast -t type:system
  307. .variables_capybara_chrome_template: &variables_capybara_chrome_definition
  308. <<: *test_capybara_definition
  309. variables:
  310. RAILS_ENV: "test"
  311. NO_RESET_BEFORE_SUITE: "true"
  312. BROWSER: "chrome"
  313. .variables_capybara_ff_template: &variables_capybara_ff_definition
  314. <<: *test_capybara_definition
  315. variables:
  316. RAILS_ENV: "test"
  317. NO_RESET_BEFORE_SUITE: "true"
  318. BROWSER: "firefox"
  319. test:browser:core:capybara_chrome_postgresql:
  320. <<: *variables_capybara_chrome_definition
  321. <<: *services_browser_postgresql_definition
  322. test:browser:core:capybara_chrome_mysql:
  323. <<: *variables_capybara_chrome_definition
  324. <<: *services_browser_mysql_definition
  325. test:browser:core:capybara_ff_postgresql:
  326. <<: *variables_capybara_ff_definition
  327. <<: *services_browser_postgresql_definition
  328. test:browser:core:capybara_ff_mysql:
  329. <<: *variables_capybara_ff_definition
  330. <<: *services_browser_mysql_definition
  331. ## Browser core tests
  332. .variables_browser_template: &variables_browser_definition
  333. RAILS_ENV: "production"
  334. APP_RESTART_CMD: "bundle exec rake zammad:ci:app:restart"
  335. .test_browser_core_template: &test_browser_core_definition
  336. <<: *base_env
  337. stage: browser-core
  338. dependencies:
  339. - browser:build
  340. ### API clients
  341. test:browser:integration:api_client_ruby:
  342. <<: *test_browser_core_definition
  343. <<: *services_postgresql
  344. variables:
  345. <<: *variables_browser_definition
  346. script:
  347. - RAILS_ENV=test bundle exec rake db:create
  348. - cp contrib/auto_wizard_test.json auto_wizard.json
  349. - bundle exec rake zammad:ci:test:start
  350. - git clone https://github.com/zammad/zammad-api-client-ruby.git
  351. - cd zammad-api-client-ruby
  352. - bundle install -j $(nproc)
  353. - bundle exec rspec
  354. test:browser:integration:api_client_php:
  355. <<: *test_browser_core_definition
  356. <<: *services_postgresql
  357. variables:
  358. <<: *variables_browser_definition
  359. ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_URL: "http://localhost:3000"
  360. ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_USERNAME: "master@example.com"
  361. ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_PASSWORD: "test"
  362. script:
  363. - RAILS_ENV=test bundle exec rake db:create
  364. - bundle exec rake zammad:ci:test:start zammad:setup:auto_wizard
  365. - git clone https://github.com/zammad/zammad-api-client-php.git
  366. - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
  367. - php composer-setup.php --install-dir=/usr/local/bin
  368. - ln -s /usr/local/bin/composer.phar /usr/local/bin/composer
  369. - cd zammad-api-client-php
  370. - composer install
  371. - vendor/bin/phpunit
  372. ### Browser test slices
  373. #### Templates
  374. .script_browser_slice_template: &script_browser_slice_definition
  375. script:
  376. # temporary workaround to check Yahoo! mailbox only in test:browser:core:ff_3_* tests
  377. - if [[ $CI_JOB_NAME != test:browser:core:ff_3_* ]]; then unset MAILBOX_AUTO1 ; fi
  378. - if [[ $CI_JOB_NAME != test:browser:core:ff_3_* ]]; then unset MAILBOX_AUTO2 ; fi
  379. - if [[ $CI_JOB_NAME != test:browser:core:ff_3_* ]]; then unset MAILBOX_MANUAL1 ; fi
  380. - if [[ $CI_JOB_NAME != test:browser:core:ff_3_* ]]; then unset MAILBOX_MANUAL2 ; fi
  381. - env
  382. - script/build/test_slice_tests.sh $TEST_SLICE
  383. - RAILS_ENV=test bundle exec rake db:create
  384. - bundle exec rake zammad:ci:test:start[with_elasticsearch]
  385. - bundle exec rake test:browser
  386. .test_browser_core_postgresql_template: &test_browser_core_postgresql_definition
  387. <<: *test_browser_core_definition
  388. <<: *script_browser_slice_definition
  389. <<: *services_browser_postgresql_definition
  390. .test_browser_core_mysql_template: &test_browser_core_mysql_definition
  391. <<: *test_browser_core_definition
  392. <<: *script_browser_slice_definition
  393. <<: *services_browser_mysql_definition
  394. #### Firefox
  395. test:browser:core:ff_1_mysql:
  396. <<: *test_browser_core_mysql_definition
  397. variables:
  398. <<: *variables_browser_definition
  399. BROWSER: "firefox"
  400. TEST_SLICE: "1"
  401. test:browser:core:ff_2_mysql:
  402. <<: *test_browser_core_mysql_definition
  403. variables:
  404. <<: *variables_browser_definition
  405. BROWSER: "firefox"
  406. TEST_SLICE: "2"
  407. test:browser:core:ff_3_mysql:
  408. <<: *test_browser_core_mysql_definition
  409. variables:
  410. <<: *variables_browser_definition
  411. BROWSER: "firefox"
  412. TEST_SLICE: "3"
  413. test:browser:core:ff_4_mysql:
  414. <<: *test_browser_core_mysql_definition
  415. variables:
  416. <<: *variables_browser_definition
  417. BROWSER: "firefox"
  418. TEST_SLICE: "4"
  419. test:browser:core:ff_5_mysql:
  420. <<: *test_browser_core_mysql_definition
  421. variables:
  422. <<: *variables_browser_definition
  423. BROWSER: "firefox"
  424. TEST_SLICE: "5"
  425. test:browser:core:ff_6_mysql:
  426. <<: *test_browser_core_mysql_definition
  427. variables:
  428. <<: *variables_browser_definition
  429. BROWSER: "firefox"
  430. TEST_SLICE: "6"
  431. test:browser:core:ff_1_postgresql:
  432. <<: *test_browser_core_postgresql_definition
  433. variables:
  434. <<: *variables_browser_definition
  435. BROWSER: "firefox"
  436. TEST_SLICE: "1"
  437. test:browser:core:ff_2_postgresql:
  438. <<: *test_browser_core_postgresql_definition
  439. variables:
  440. <<: *variables_browser_definition
  441. BROWSER: "firefox"
  442. TEST_SLICE: "2"
  443. test:browser:core:ff_3_postgresql:
  444. <<: *test_browser_core_postgresql_definition
  445. variables:
  446. <<: *variables_browser_definition
  447. BROWSER: "firefox"
  448. TEST_SLICE: "3"
  449. test:browser:core:ff_4_postgresql:
  450. <<: *test_browser_core_postgresql_definition
  451. variables:
  452. <<: *variables_browser_definition
  453. BROWSER: "firefox"
  454. TEST_SLICE: "4"
  455. test:browser:core:ff_5_postgresql:
  456. <<: *test_browser_core_postgresql_definition
  457. variables:
  458. <<: *variables_browser_definition
  459. BROWSER: "firefox"
  460. TEST_SLICE: "5"
  461. test:browser:core:ff_6_postgresql:
  462. <<: *test_browser_core_postgresql_definition
  463. variables:
  464. <<: *variables_browser_definition
  465. BROWSER: "firefox"
  466. TEST_SLICE: "6"
  467. ### Chrome
  468. test:browser:core:chrome_1_mysql:
  469. <<: *test_browser_core_mysql_definition
  470. variables:
  471. <<: *variables_browser_definition
  472. BROWSER: "chrome"
  473. TEST_SLICE: "1"
  474. test:browser:core:chrome_2_mysql:
  475. <<: *test_browser_core_mysql_definition
  476. variables:
  477. <<: *variables_browser_definition
  478. BROWSER: "chrome"
  479. TEST_SLICE: "2"
  480. test:browser:core:chrome_3_mysql:
  481. <<: *test_browser_core_mysql_definition
  482. variables:
  483. <<: *variables_browser_definition
  484. BROWSER: "chrome"
  485. TEST_SLICE: "3"
  486. test:browser:core:chrome_4_mysql:
  487. <<: *test_browser_core_mysql_definition
  488. variables:
  489. <<: *variables_browser_definition
  490. BROWSER: "chrome"
  491. TEST_SLICE: "4"
  492. test:browser:core:chrome_5_mysql:
  493. <<: *test_browser_core_mysql_definition
  494. variables:
  495. <<: *variables_browser_definition
  496. BROWSER: "chrome"
  497. TEST_SLICE: "5"
  498. test:browser:core:chrome_6_mysql:
  499. <<: *test_browser_core_mysql_definition
  500. variables:
  501. <<: *variables_browser_definition
  502. BROWSER: "chrome"
  503. TEST_SLICE: "6"
  504. test:browser:core:chrome_1_postgresql:
  505. <<: *test_browser_core_postgresql_definition
  506. variables:
  507. <<: *variables_browser_definition
  508. BROWSER: "chrome"
  509. TEST_SLICE: "1"
  510. test:browser:core:chrome_2_postgresql:
  511. <<: *test_browser_core_postgresql_definition
  512. variables:
  513. <<: *variables_browser_definition
  514. BROWSER: "chrome"
  515. TEST_SLICE: "2"
  516. test:browser:core:chrome_3_postgresql:
  517. <<: *test_browser_core_postgresql_definition
  518. variables:
  519. <<: *variables_browser_definition
  520. BROWSER: "chrome"
  521. TEST_SLICE: "3"
  522. test:browser:core:chrome_4_postgresql:
  523. <<: *test_browser_core_postgresql_definition
  524. variables:
  525. <<: *variables_browser_definition
  526. BROWSER: "chrome"
  527. TEST_SLICE: "4"
  528. test:browser:core:chrome_5_postgresql:
  529. <<: *test_browser_core_postgresql_definition
  530. variables:
  531. <<: *variables_browser_definition
  532. BROWSER: "chrome"
  533. TEST_SLICE: "5"
  534. test:browser:core:chrome_6_postgresql:
  535. <<: *test_browser_core_postgresql_definition
  536. variables:
  537. <<: *variables_browser_definition
  538. BROWSER: "chrome"
  539. TEST_SLICE: "6"
  540. ### Auto wizard
  541. .auto_wizard_services_template: &auto_wizard_services
  542. services:
  543. - name: registry.znuny.com/docker/zammad-postgresql:latest
  544. alias: postgresql
  545. - name: docker.io/elgalu/selenium:latest
  546. alias: selenium
  547. .test_browser_integration_template: &test_browser_integration_definition
  548. <<: *base_env
  549. <<: *auto_wizard_services
  550. stage: browser-integration
  551. dependencies:
  552. - browser:build
  553. .script_integration_auto_wizard_template: &script_integration_auto_wizard_definition
  554. script:
  555. - RAILS_ENV=test bundle exec rake db:create
  556. - cp $AUTO_WIZARD_FILE auto_wizard.json
  557. - bundle exec rake zammad:ci:test:start
  558. - bundle exec ruby -I test/ $TEST_FILE
  559. .browser_core_auto_wizard_template: &browser_core_auto_wizard_definition
  560. <<: *test_browser_core_definition
  561. <<: *auto_wizard_services
  562. <<: *script_integration_auto_wizard_definition
  563. test:browser:autowizard_chrome:
  564. <<: *browser_core_auto_wizard_definition
  565. variables:
  566. <<: *variables_browser_definition
  567. BROWSER: "chrome"
  568. AUTO_WIZARD_FILE: "contrib/auto_wizard_example.json"
  569. TEST_FILE: "test/integration/auto_wizard_browser_test.rb"
  570. test:browser:autowizard_ff:
  571. <<: *browser_core_auto_wizard_definition
  572. variables:
  573. <<: *variables_browser_definition
  574. BROWSER: "firefox"
  575. AUTO_WIZARD_FILE: "contrib/auto_wizard_example.json"
  576. TEST_FILE: "test/integration/auto_wizard_browser_test.rb"
  577. ### Browser integration tests
  578. .browser_integration_auto_wizard_template: &browser_integration_auto_wizard_definition
  579. <<: *test_browser_integration_definition
  580. <<: *script_integration_auto_wizard_definition
  581. test:browser:integration:twitter_chrome:
  582. <<: *browser_integration_auto_wizard_definition
  583. variables:
  584. <<: *variables_browser_definition
  585. BROWSER: "chrome"
  586. AUTO_WIZARD_FILE: "contrib/auto_wizard_test.json"
  587. TEST_FILE: "test/integration/twitter_browser_test.rb"
  588. test:browser:integration:twitter_ff:
  589. <<: *browser_integration_auto_wizard_definition
  590. variables:
  591. <<: *variables_browser_definition
  592. BROWSER: "firefox"
  593. AUTO_WIZARD_FILE: "contrib/auto_wizard_test.json"
  594. TEST_FILE: "test/integration/twitter_browser_test.rb"
  595. test:browser:integration:facebook_chrome:
  596. <<: *browser_integration_auto_wizard_definition
  597. variables:
  598. <<: *variables_browser_definition
  599. BROWSER: "chrome"
  600. AUTO_WIZARD_FILE: "contrib/auto_wizard_test.json"
  601. TEST_FILE: "test/integration/facebook_browser_test.rb"
  602. test:browser:integration:facebook_ff:
  603. <<: *browser_integration_auto_wizard_definition
  604. variables:
  605. <<: *variables_browser_definition
  606. BROWSER: "firefox"
  607. AUTO_WIZARD_FILE: "contrib/auto_wizard_test.json"
  608. TEST_FILE: "test/integration/facebook_browser_test.rb"
  609. test:browser:integration:idoit_chrome:
  610. <<: *browser_integration_auto_wizard_definition
  611. variables:
  612. <<: *variables_browser_definition
  613. BROWSER: "chrome"
  614. AUTO_WIZARD_FILE: "contrib/auto_wizard_test.json"
  615. TEST_FILE: "test/integration/idoit_browser_test.rb"
  616. ### Browser integration tests
  617. .variables_browser_import_template: &variables_browser_import_definition
  618. BROWSER: "chrome"
  619. RAILS_SERVE_STATIC_FILES: "true"
  620. RAILS_ENV: "production"
  621. .browser_integration_import_template: &browser_integration_import_definition
  622. <<: *test_browser_integration_definition
  623. script:
  624. - RAILS_ENV=test bundle exec rake db:create
  625. - bundle exec rake zammad:ci:test:start
  626. - bundle exec ruby -I test/ $TEST_FILE
  627. test:browser:integration:otrs_chrome:
  628. <<: *browser_integration_import_definition
  629. variables:
  630. <<: *variables_browser_import_definition
  631. TEST_FILE: "test/integration/otrs_import_browser_test.rb"
  632. test:browser:integration:zendesk_chrome:
  633. <<: *browser_integration_import_definition
  634. variables:
  635. <<: *variables_browser_import_definition
  636. TEST_FILE: "test/integration/zendesk_import_browser_test.rb"