.gitlab-ci.yml 21 KB

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