Skip to content
代码片段 群组 项目
选择Git版本
  • 7d45055dbce17e446fdf8579600fc8bedecc2b23
  • main-jh 默认 受保护
  • pre-main-jh 受保护
  • 18-3-stable-ee 受保护
  • master 受保护
  • 18-2-stable-jh-patch-8
  • 18-3-stable-jh-patch-4
  • 18-2-stable-ee 受保护
  • 18-4-stable-ee 受保护
  • 18-4-stable-jh-patch-2
  • license-bind-ha
  • 18-3-stable-jh 受保护
  • 18-4-stable-jh 受保护
  • 18-2-stable-jh 受保护
  • set-ai-endpoint-metadata-on-saas
  • 18-1-stable-ee 受保护
  • 18-4-stable-jh-prepare
  • feat-duo-i18n
  • 18-1-stable-jh 受保护
  • test-duo-mr
  • fix-pipeline-4301465
  • v18.2.8-ee 受保护
  • v18.3.4-ee 受保护
  • v18.4.2-ee 受保护
  • v18.3.3-jh 受保护
  • v18.4.1-jh 受保护
  • v18.2.7-jh 受保护
  • v18.2.7-ee 受保护
  • v18.3.3-ee 受保护
  • v18.4.1-ee 受保护
  • v18.4.0-jh 受保护
  • v18.4.0-ee 受保护
  • v18.4.0-rc43-ee 受保护
  • v18.4.0-rc42-ee 受保护
  • v18.3.2-jh 受保护
  • v18.1.6-jh 受保护
  • v18.2.6-jh 受保护
  • v18.1.6-ee 受保护
  • v18.2.6-ee 受保护
  • v18.3.2-ee 受保护
  • v18.3.1-jh 受保护
41 个结果

gitaly-test-build

Blame
  • 用户头像
    Sami Hiltunen authored
    Gitaly has a configuration flag that enables support
    for transactions with ACID properties. With the flag
    enabled, Gitaly runs each RPC in a transaction leading
    to improved reliability.
    
    As a preliminary step towards rolling out transactions,
    this commit adds support for configuring transactions in
    the test setup by setting `GITALY_TRANSACTIONS_ENABLED=true`
    environment variable.
    
    In the CI, Gitaly's configuration is generated ahead of the
    running the rspec jobs that conditionally run with
    transactions enabled. If we're running in CI, transactions
    are by default disabled. We generate an additional configuration
    file with transactions enabled and run Gitaly with it if
    transactions are enabled. This is similar to the setup we
    currently have with Praefect as it generates a config with
    and without database being enabled in the setup-test-env job.
    93495651
    历史
    用户头像 93495651
    代码所有者
    将用户和群组指定为特定文件更改的核准人。 了解更多。
    gitaly-test-build 1.45 KiB
    #!/usr/bin/env ruby
    # frozen_string_literal: true
    
    require_relative '../config/bundler_setup'
    require 'fileutils'
    
    require_relative '../spec/support/helpers/gitaly_setup'
    
    # This script assumes tmp/tests/gitaly already contains the correct
    # Gitaly version. We just have to compile it.
    # We have this separate script for that to avoid bundle
    # poisoning in CI. This script should only be run in CI.
    class GitalyTestBuild
      include GitalySetup
    
      def run
        # If we have the binaries from the cache, we can skip building them again
        if File.exist?(tmp_tests_gitaly_bin_dir)
          GitalySetup::LOGGER.debug "Gitaly binary already built. Skip building...\n"
        else
          abort 'gitaly build failed' unless build_gitaly
        end
    
        ensure_gitlab_shell_secret!
    
        # Starting gitaly further validates its configuration
        gitaly_pid = start_gitaly(:gitaly)
        gitaly2_pid = start_gitaly(:gitaly2)
        praefect_pid = start_praefect
        Process.kill('TERM', gitaly_pid)
        Process.kill('TERM', gitaly2_pid)
        Process.kill('TERM', praefect_pid)
    
        # Make the 'gitaly' executable look newer than 'GITALY_SERVER_VERSION'.
        # Without this a gitaly executable created in the setup-test-env job
        # will look stale compared to GITALY_SERVER_VERSION.
        FileUtils.touch(File.join(tmp_tests_gitaly_bin_dir, 'gitaly'), mtime: Time.now + (1 << 24))
        FileUtils.touch(File.join(tmp_tests_gitaly_bin_dir, 'praefect'), mtime: Time.now + (1 << 24))
      end
    end
    
    GitalyTestBuild.new.run