From f7f62915047559b408f7a35952c71ac14f56ee5f Mon Sep 17 00:00:00 2001 From: Martin Gruner Date: Mon, 21 Feb 2022 21:07:15 +0100 Subject: [PATCH] Maintenance: Add support for collapsible sections in GitLab job logs. --- .gitlab-ci.yml | 2 ++ .gitlab/ci/browser-core.yml | 6 ++++++ .gitlab/ci/browser-core/api_client_php.yml | 2 ++ .gitlab/ci/browser-core/api_client_ruby.yml | 2 ++ .gitlab/ci/browser-core/build.yml | 2 ++ .gitlab/ci/browser-integration.yml | 6 ++++++ .gitlab/ci/integration/es.yml | 2 ++ .gitlab/ci/integration/other.yml | 2 ++ .gitlab/ci/integration/otrs.yml | 2 ++ .gitlab/ci/pre.yml | 6 ++++++ .gitlab/ci/rspec.yml | 4 ++++ .gitlab/ci/unit.yml | 2 ++ 12 files changed, 38 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3a4db5d1a..bfb077c83 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/.gitlab/ci/browser-core.yml b/.gitlab/ci/browser-core.yml index 12ac1ca86..e1cfbaadd 100644 --- a/.gitlab/ci/browser-core.yml +++ b/.gitlab/ci/browser-core.yml @@ -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 diff --git a/.gitlab/ci/browser-core/api_client_php.yml b/.gitlab/ci/browser-core/api_client_php.yml index 7ded57e08..42b987823 100644 --- a/.gitlab/ci/browser-core/api_client_php.yml +++ b/.gitlab/ci/browser-core/api_client_php.yml @@ -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 diff --git a/.gitlab/ci/browser-core/api_client_ruby.yml b/.gitlab/ci/browser-core/api_client_ruby.yml index f71755f20..b2003aeb1 100644 --- a/.gitlab/ci/browser-core/api_client_ruby.yml +++ b/.gitlab/ci/browser-core/api_client_ruby.yml @@ -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 diff --git a/.gitlab/ci/browser-core/build.yml b/.gitlab/ci/browser-core/build.yml index 443d9b143..237f67756 100644 --- a/.gitlab/ci/browser-core/build.yml +++ b/.gitlab/ci/browser-core/build.yml @@ -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 diff --git a/.gitlab/ci/browser-integration.yml b/.gitlab/ci/browser-integration.yml index 88ed70398..74ab63c54 100644 --- a/.gitlab/ci/browser-integration.yml +++ b/.gitlab/ci/browser-integration.yml @@ -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 diff --git a/.gitlab/ci/integration/es.yml b/.gitlab/ci/integration/es.yml index 0663c1167..dd0f72132 100644 --- a/.gitlab/ci/integration/es.yml +++ b/.gitlab/ci/integration/es.yml @@ -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 diff --git a/.gitlab/ci/integration/other.yml b/.gitlab/ci/integration/other.yml index 8eb5f13da..ce78fb59a 100644 --- a/.gitlab/ci/integration/other.yml +++ b/.gitlab/ci/integration/other.yml @@ -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 diff --git a/.gitlab/ci/integration/otrs.yml b/.gitlab/ci/integration/otrs.yml index c87add3a8..5c0a94841 100644 --- a/.gitlab/ci/integration/otrs.yml +++ b/.gitlab/ci/integration/otrs.yml @@ -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 diff --git a/.gitlab/ci/pre.yml b/.gitlab/ci/pre.yml index 8dbdb4dab..f431fd35b 100644 --- a/.gitlab/ci/pre.yml +++ b/.gitlab/ci/pre.yml @@ -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. diff --git a/.gitlab/ci/rspec.yml b/.gitlab/ci/rspec.yml index 9ee5c4906..5104303da 100644 --- a/.gitlab/ci/rspec.yml +++ b/.gitlab/ci/rspec.yml @@ -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 diff --git a/.gitlab/ci/unit.yml b/.gitlab/ci/unit.yml index 38f19e863..4a7488327 100644 --- a/.gitlab/ci/unit.yml +++ b/.gitlab/ci/unit.yml @@ -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