Maintenance: Add support for collapsible sections in GitLab job logs.

This commit is contained in:
Martin Gruner 2022-02-21 21:07:15 +01:00 committed by Dominik Klein
parent b18a28bdbe
commit f7f6291504
12 changed files with 38 additions and 0 deletions

View file

@ -56,6 +56,8 @@ cache:
before_script:
- source /etc/profile.d/rvm.sh
- source /opt/rh/rh-nodejs*/enable
- echo -e "\\e[0Ksection_start:`date +%s`:bundle_install[collapsed=true]\\r\\e[0Kbundle install"
- bundle install -j $(nproc) --path vendor
- echo -e "\\e[0Ksection_end:`date +%s`:bundle_install\\r\\e[0K"
- bundle exec ruby .gitlab/configure_environment.rb
- source .gitlab/environment.env

View file

@ -24,7 +24,9 @@ include:
script:
- script/build/test_slice_tests.sh $TEST_SLICE
- RAILS_ENV=test bundle exec rake db:create
- echo -e "\\e[0Ksection_start:`date +%s`:zammad_ci_test_start[collapsed=true]\\r\\e[0Kbundle exec rake zammad:ci:test:start"
- bundle exec rake zammad:ci:test:start[with_elasticsearch]
- echo -e "\\e[0Ksection_end:`date +%s`:zammad_ci_test_start\\r\\e[0K"
- time bundle exec rails test --fail-fast test/browser
.template_browser-core_chrome: &template_browser-core_chrome
@ -51,7 +53,9 @@ include:
script:
- RAILS_ENV=test bundle exec rake db:create
- cp $AUTO_WIZARD_FILE auto_wizard.json
- echo -e "\\e[0Ksection_start:`date +%s`:zammad_ci_test_start[collapsed=true]\\r\\e[0Kbundle exec rake zammad:ci:test:start"
- bundle exec rake zammad:ci:test:start
- echo -e "\\e[0Ksection_end:`date +%s`:zammad_ci_test_start\\r\\e[0K"
- bundle exec rails test $TEST_FILE
.template_browser-core_autowizard_chrome: &template_browser-core_autowizard_chrome
@ -86,7 +90,9 @@ include:
variables:
RAILS_ENV: "test"
script:
- echo -e "\\e[0Ksection_start:`date +%s`:zammad_ci_test_prepare[collapsed=true]\\r\\e[0Kbundle exec rake zammad:ci:test:prepare"
- bundle exec rake zammad:ci:test:prepare
- echo -e "\\e[0Ksection_end:`date +%s`:zammad_ci_test_prepare\\r\\e[0K"
- echo "RSpec filter:" "$RSPEC_EXAMPLE_MATCHES"
- bundle exec rspec --require ./spec/rspec_extensions.rb --example-matches "$RSPEC_EXAMPLE_MATCHES" --fail-fast -t ~integration --profile 10 spec/system

View file

@ -7,7 +7,9 @@ api_client_php:
ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_PASSWORD: "test"
script:
- RAILS_ENV=test bundle exec rake db:create
- echo -e "\\e[0Ksection_start:`date +%s`:zammad_ci_test_start[collapsed=true]\\r\\e[0Kbundle exec rake zammad:ci:test:start"
- RAILS_ENV=test bundle exec rake zammad:ci:test:start zammad:setup:auto_wizard
- echo -e "\\e[0Ksection_end:`date +%s`:zammad_ci_test_start\\r\\e[0K"
- git clone https://github.com/zammad/zammad-api-client-php.git
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php composer-setup.php --install-dir=/usr/local/bin

View file

@ -4,7 +4,9 @@ api_client_ruby:
script:
- RAILS_ENV=test bundle exec rake db:create
- cp contrib/auto_wizard_test.json auto_wizard.json
- echo -e "\\e[0Ksection_start:`date +%s`:zammad_ci_test_start[collapsed=true]\\r\\e[0Kbundle exec rake zammad:ci:test:start"
- bundle exec rake zammad:ci:test:start
- echo -e "\\e[0Ksection_end:`date +%s`:zammad_ci_test_start\\r\\e[0K"
- git clone https://github.com/zammad/zammad-api-client-ruby.git
- cd zammad-api-client-ruby
- bundle update --bundler

View file

@ -13,5 +13,7 @@ browser:build:
variables:
RAILS_ENV: "production"
script:
- echo -e "\\e[0Ksection_start:`date +%s`:zammad_db_unseeded[collapsed=true]\\r\\e[0Kbundle exec rake zammad:db:unseeded"
- bundle exec rake zammad:db:unseeded
- echo -e "\\e[0Ksection_end:`date +%s`:zammad_db_unseeded\\r\\e[0K"
- bundle exec rake assets:precompile

View file

@ -17,7 +17,9 @@ include:
variables:
RAILS_ENV: "test"
script:
- echo -e "\\e[0Ksection_start:`date +%s`:zammad_ci_test_prepare[collapsed=true]\\r\\e[0Kbundle exec rake zammad:ci:test:prepare"
- bundle exec rake zammad:ci:test:prepare
- echo -e "\\e[0Ksection_end:`date +%s`:zammad_ci_test_prepare\\r\\e[0K"
- bundle exec rspec --fail-fast --pattern "spec/system/**/*_spec.rb" -t integration --profile 10
.template_browser-integration_capybara_chrome: &template_browser-integration_capybara_chrome
@ -44,7 +46,9 @@ include:
script:
- RAILS_ENV=test bundle exec rake db:create
- cp $AUTO_WIZARD_FILE auto_wizard.json
- echo -e "\\e[0Ksection_start:`date +%s`:zammad_ci_test_start[collapsed=true]\\r\\e[0Kbundle exec rake zammad:ci:test:start"
- bundle exec rake zammad:ci:test:start
- echo -e "\\e[0Ksection_end:`date +%s`:zammad_ci_test_start\\r\\e[0K"
- bundle exec rails test $TEST_FILE
.template_browser-integration_import_chrome: &template_browser-integration_import_chrome
@ -59,7 +63,9 @@ include:
RAILS_SERVE_STATIC_FILES: "true"
script:
- RAILS_ENV=test bundle exec rake db:create
- echo -e "\\e[0Ksection_start:`date +%s`:zammad_ci_test_start[collapsed=true]\\r\\e[0Kbundle exec rake zammad:ci:test:start"
- bundle exec rake zammad:ci:test:start
- echo -e "\\e[0Ksection_end:`date +%s`:zammad_ci_test_start\\r\\e[0K"
- bundle exec rails test $TEST_FILE
# we need at least one job to store and include this template

View file

@ -7,7 +7,9 @@
tags:
- integration
script:
- echo -e "\\e[0Ksection_start:`date +%s`:zammad_db_unseeded[collapsed=true]\\r\\e[0Kbundle exec rake zammad:db:unseeded"
- bundle exec rake zammad:db:unseeded
- echo -e "\\e[0Ksection_end:`date +%s`:zammad_db_unseeded\\r\\e[0K"
- bundle exec rails test test/integration/elasticsearch_active_test.rb
- bundle exec rails test test/integration/elasticsearch_test.rb
- bundle exec rspec --tag searchindex --tag ~type:system --profile 10

View file

@ -2,7 +2,9 @@
extends:
- .template_integration
script:
- echo -e "\\e[0Ksection_start:`date +%s`:zammad_db_unseeded[collapsed=true]\\r\\e[0Kbundle exec rake zammad:db:unseeded"
- bundle exec rake zammad:db:unseeded
- echo -e "\\e[0Ksection_end:`date +%s`:zammad_db_unseeded\\r\\e[0K"
- echo "email_helper_deliver tests..."
- bundle exec rails test test/integration/email_helper_test.rb
- bundle exec rails test test/integration/email_deliver_test.rb

View file

@ -2,7 +2,9 @@
extends:
- .template_integration
script:
- echo -e "\\e[0Ksection_start:`date +%s`:zammad_db_unseeded[collapsed=true]\\r\\e[0Kbundle exec rake zammad:db:unseeded"
- bundle exec rake zammad:db:unseeded
- echo -e "\\e[0Ksection_end:`date +%s`:zammad_db_unseeded\\r\\e[0K"
- bundle exec rails test test/integration/otrs_import_test.rb
variables:
FF_NETWORK_PER_BUILD: 1 # https://docs.gitlab.com/runner/configuration/feature-flags.html

View file

@ -17,10 +17,14 @@
before_script:
- source /etc/profile.d/rvm.sh # ensure RVM is loaded
- source /opt/rh/rh-nodejs*/enable # ensure Node.js is available
- echo -e "\\e[0Ksection_start:`date +%s`:bundle_install[collapsed=true]\\r\\e[0Kbundle install"
- bundle install -j $(nproc) --path vendor
- echo -e "\\e[0Ksection_end:`date +%s`:bundle_install\\r\\e[0K"
- bundle exec ruby .gitlab/configure_environment.rb
- source .gitlab/environment.env
- echo -e "\\e[0Ksection_start:`date +%s`:zammad_db_init[collapsed=true]\\r\\e[0Kbundle exec rake zammad:db:init"
- bundle exec rake zammad:db:init
- echo -e "\\e[0Ksection_end:`date +%s`:zammad_db_init\\r\\e[0K"
# Must be a separate job because it uses a custom image.
"lint: shellcheck":
@ -61,7 +65,9 @@
- yarn install
- yarn lint:css
- echo "Rubocop check..."
- echo -e "\\e[0Ksection_start:`date +%s`:bundle_install[collapsed=true]\\r\\e[0Kbundle install"
- bundle install -j $(nproc) --path vendor
- echo -e "\\e[0Ksection_end:`date +%s`:bundle_install\\r\\e[0K"
- bundle exec rubocop --parallel
# Must be a separate job because it may fail and is only executed for develop.

View file

@ -7,7 +7,9 @@ include:
- .env_base
- .variables_rspec_slicing
script:
- echo -e "\\e[0Ksection_start:`date +%s`:zammad_db_init[collapsed=true]\\r\\e[0Kbundle exec rake zammad:db:init"
- bundle exec rake zammad:db:init
- echo -e "\\e[0Ksection_end:`date +%s`:zammad_db_init\\r\\e[0K"
- echo "RSpec filter:" "$RSPEC_EXAMPLE_MATCHES"
- bundle exec rspec --require ./spec/rspec_extensions.rb --example-matches "$RSPEC_EXAMPLE_MATCHES" --exclude-pattern "spec/{system,integration}/**/*_spec.rb" -t ~searchindex --profile 10
@ -24,5 +26,7 @@ rspec:integration:
variables:
RAILS_ENV: "test"
script:
- echo -e "\\e[0Ksection_start:`date +%s`:zammad_db_init[collapsed=true]\\r\\e[0Kbundle exec rake zammad:db:init"
- bundle exec rake zammad:db:init
- echo -e "\\e[0Ksection_end:`date +%s`:zammad_db_init\\r\\e[0K"
- bundle exec rspec -t type:integration --profile 10

View file

@ -8,7 +8,9 @@ include:
variables:
RAILS_ENV: "test"
script:
- echo -e "\\e[0Ksection_start:`date +%s`:zammad_db_init[collapsed=true]\\r\\e[0Kbundle exec rake zammad:db:init"
- bundle exec rake zammad:db:init
- echo -e "\\e[0Ksection_end:`date +%s`:zammad_db_init\\r\\e[0K"
- bundle exec rake test:units
- bundle exec rails test test/integration/object_manager_test.rb
- bundle exec rails test test/integration/package_test.rb