.gitlab-ci.yml 21 KB

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