source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/retriable.rb | Ruby | apache-2.0 | 225 | master | 290 | # frozen_string_literal: true
require 'retriable'
Retriable.configure do |config|
# Retry with exponential backoff, for a maximum of ~6 minutes
#
# Ideal for waiting for package publish to succeed.
config.contexts[:package_publish] = {
base_interval: 5,
tries: 10
}
end |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/build.rb | Ruby | apache-2.0 | 225 | master | 402 | require_relative "util"
module Build
def self.log_level
if Gitlab::Util.get_env('BUILD_LOG_LEVEL') && !Gitlab::Util.get_env('BUILD_LOG_LEVEL').empty?
Gitlab::Util.get_env('BUILD_LOG_LEVEL')
else
'info'
end
end
def self.exec(project)
system(*cmd(project))
end
def self.cmd(project... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/aws_helper.rb | Ruby | apache-2.0 | 225 | master | 5,220 | require 'aws-sdk-ec2'
require 'aws-sdk-marketplacecatalog'
require 'json'
require_relative 'build/info/ci'
require_relative 'util'
class AWSHelper
def initialize(version, type)
# version specifies the GitLab version being processed
# type specifies whether it is CE or EE being processed
@version = vers... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/gcloud_helper.rb | Ruby | apache-2.0 | 225 | master | 1,411 | require 'google/cloud/storage'
require_relative 'build/check'
require_relative 'util'
class GCloudHelper
class << self
def upload_packages_and_print_urls(dir)
if sa_file.nil? || !File.exist?(sa_file)
warn "Error finding service account file. Can not upload packages to bucket."
return
... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/manifest/uploader.rb | Ruby | apache-2.0 | 225 | master | 2,911 | # Regenerate the versions-manifest.json file setting ALTERNATIVE_SOURCES to true
# so we get the public versions of the repositories. This file is then published
# at https://gitlab-org.gitlab.io/omnibus-gitlab/gitlab-manifests/manifests.html
# using the CI "pages" job.
require 'omnibus'
require 'yaml'
require_relati... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/manifest/base.rb | Ruby | apache-2.0 | 225 | master | 612 | require_relative '../util'
module Manifest
class Base
def s3_sync(source, destination)
system(
{
'AWS_ACCESS_KEY_ID' => Gitlab::Util.get_env('LICENSE_AWS_ACCESS_KEY_ID'),
'AWS_SECRET_ACCESS_KEY' => Gitlab::Util.get_env('LICENSE_AWS_SECRET_ACCESS_KEY')
},
*%W[aws ... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/manifest/collector.rb | Ruby | apache-2.0 | 225 | master | 1,149 | require 'erb'
require 'fileutils'
require_relative '../util'
require_relative 'base'
module Manifest
# Roots through the LICENSE_S3_BUCKET'and creates an html page with links to
# all version manifests. The gitlab.com CI "pages" job is later used to upload
# the results (along with the bucket itself) to the web... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/package_repository/base.rb | Ruby | apache-2.0 | 225 | master | 4,656 | require 'English'
require_relative '../build/info/package'
require_relative '../retriable'
require_relative '../util'
class PackageRepository
# Base class for package repository implementations.
# Provides common functionality for uploading packages to different repository types.
class Base
PackageUploadErr... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/package_repository/pulp_repository.rb | Ruby | apache-2.0 | 225 | master | 9,179 | require_relative 'base'
require_relative 'package_type'
require 'pathname'
class PackageRepository
# Pulp repository implementation for uploading packages to Pulp servers.
# Uses the pulp CLI to upload Debian and RPM packages.
class PulpRepository < Base
# Default chunk size for uploading packages (10 MB)
... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/package_repository/package_cloud_repository.rb | Ruby | apache-2.0 | 225 | master | 5,167 | require_relative 'base'
require 'pathname'
class PackageRepository
# PackageCloud repository implementation for uploading packages to PackageCloud.
# Uses the package_cloud CLI to upload packages to various Linux distributions.
class PackageCloudRepository < Base
# Returns the PackageCloud user/owner
# @... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/package_repository/package_type.rb | Ruby | apache-2.0 | 225 | master | 5,032 | class PackageRepository
class PulpRepository < Base
# Base class for package types
class PackageType
attr_reader :file_extension
def initialize(file_extension)
@file_extension = file_extension
end
# Factory method to create the appropriate package type
# @param package_... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/build/image.rb | Ruby | apache-2.0 | 225 | master | 2,851 | require_relative '../util'
require_relative '../skopeo_helper'
require_relative '../docker_operations'
require_relative 'info/docker'
module Build
module Image
def pull
Docker::Image.create(
'fromImage' => "#{gitlab_registry_image_address}:#{Build::Info::Docker.tag}"
)
puts "Pulled tag:... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/build/trigger.rb | Ruby | apache-2.0 | 225 | master | 2,845 | require 'cgi'
require 'json'
require 'net/http'
require_relative '../util'
module Build
module Trigger
def invoke!(image: nil)
uri = URI("https://gitlab.com/api/v4/projects/#{CGI.escape(get_project_path)}/trigger/pipeline")
params = get_params(image: image)
params_without_token = params.dup
... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/build/check.rb | Ruby | apache-2.0 | 225 | master | 3,838 | require_relative '../util'
require_relative 'info/git'
require_relative 'info/package'
module Build
class Check
AUTO_DEPLOY_TAG_REGEX = /^\d+\.\d+\.\d+\+[^ ]{7,}\.[^ ]{7,}$/.freeze
class << self
def is_ee?
Gitlab::Util.get_env('ee') == 'true' || \
Gitlab::Util.get_env('GITLAB_VERSION'... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/build/gitlab_image.rb | Ruby | apache-2.0 | 225 | master | 395 | require_relative 'image'
require_relative 'info/package'
module Build
class GitlabImage
extend Image
def self.dockerhub_image_name
"gitlab/#{Build::Info::Package.name}"
end
def self.gitlab_registry_image_name
Build::Info::Package.name
end
def self.source_image_address
git... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/build/qa_image.rb | Ruby | apache-2.0 | 225 | master | 418 | require_relative 'gitlab_image'
require_relative 'image'
require_relative 'info/qa'
module Build
class QAImage
extend Image
def self.dockerhub_image_name
"#{Build::GitlabImage.dockerhub_image_name}-qa"
end
def self.gitlab_registry_image_name
"#{Build::GitlabImage.gitlab_registry_image_n... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/build/ubt.rb | Ruby | apache-2.0 | 225 | master | 929 | module Build
class UBT
UBT_PROJECT = CGI.escape(Gitlab::Util.get_env('UBT_REGISTRY_PROJECT') || "gitlab-org/distribution/build-architecture/framework/foundation/gitlab-toolchain")
class << self
def source_args(name, version, sha_checksum, arch = "x86_64")
ubt_bundle_url = "#{Build::Info::CI.api_... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/build/facts.rb | Ruby | apache-2.0 | 225 | master | 5,057 | require_relative 'gitlab_image'
require_relative 'info/docker'
require_relative 'info/git'
require_relative 'info/package'
require_relative 'info/qa'
module Build
class Facts
class << self
def generate
generate_tag_files
generate_version_files
generate_env_file
end
def ... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/build/qa.rb | Ruby | apache-2.0 | 225 | master | 1,194 | require_relative 'check'
require_relative 'info/components'
# To use PROCESS_ID instead of $$ to randomize the target directory for cloning
# GitLab repository. Rubocop requirement to increase readability.
require 'English'
module Build
class QA
def self.repo_path
File.absolute_path("/tmp/gitlab")
end... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/build/info/ci.rb | Ruby | apache-2.0 | 225 | master | 3,288 | require_relative '../../api_client'
require_relative '../../util'
require_relative '../check'
module Build
class Info
class CI
class << self
def branch_name
Gitlab::Util.get_env('CI_COMMIT_BRANCH') || Gitlab::Util.get_env('CI_MERGE_REQUEST_SOURCE_BRANCH_NAME')
end
def tag... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/build/info/package.rb | Ruby | apache-2.0 | 225 | master | 4,190 | require 'omnibus'
require_relative '../../build_iteration'
require_relative '../../util'
require_relative '../check'
module Build
class Info
class Package
PACKAGE_GLOB = "pkg/**/*.{deb,rpm}".freeze
class << self
def name(fips: Check.use_system_ssl?)
return "gitlab-fips" if fips
... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/build/info/docker.rb | Ruby | apache-2.0 | 225 | master | 1,467 | require_relative '../../util'
require_relative '../check'
require_relative '../info/ci'
require_relative '../info/package'
module Build
class Info
class Docker
class << self
def tag
Gitlab::Util.get_env('IMAGE_TAG') || Build::Info::Package.release_version.tr('+', '-')
end
... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/build/info/deploy.rb | Ruby | apache-2.0 | 225 | master | 551 | require_relative '../check'
module Build
class Info
class Deploy
class << self
def environment_key
'PATCH_DEPLOY_ENVIRONMENT' if Build::Check.is_rc_tag?
end
def environment
key = environment_key
return nil if key.nil?
env = Gitlab::Util.get... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/build/info/git.rb | Ruby | apache-2.0 | 225 | master | 4,433 | # `branch_name` and `tag_name` methods in this class calls
# `Gitlab::Util.shellout_stdout` which uses `mixlib/shellout` under the hood.
# However, we can't require `mixlib/shellout` in `Gitlab::Util` since it is
# required by `Gitlab::Version`, which is in turn required by Gemfile. So, when
# Gemfile is being evaluate... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/build/info/qa.rb | Ruby | apache-2.0 | 225 | master | 445 | require_relative '../../util'
require_relative 'components'
require_relative 'package'
module Build
class Info
class QA
class << self
def image
Gitlab::Util.get_env('QA_IMAGE') || "#{Gitlab::Util.get_env('CI_REGISTRY')}/#{Build::Info::Components::GitLabRails.project_path}/#{Build::Info::P... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/build/info/secrets.rb | Ruby | apache-2.0 | 225 | master | 430 | require_relative '../../util'
require_relative 'ci'
module Build
class Info
class Secrets
class << self
def api_token(scope: 'reporter')
Gitlab::Util.get_env("GITLAB_API_#{scope.upcase}_TOKEN")
end
def ci_job_token
Build::Info::CI.job_token
end
... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/build/info/components.rb | Ruby | apache-2.0 | 225 | master | 2,340 | require_relative '../../util'
require_relative '../check'
module Build
class Info
class Components
class GitLabRails
class << self
def name
Build::Info::Package.name == "gitlab-ce" ? "gitlab-rails" : "gitlab-rails-ee"
end
def version
# Get the ... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/license/uploader.rb | Ruby | apache-2.0 | 225 | master | 2,372 | require 'erb'
require 'fileutils'
require_relative '../build/info/package'
require_relative '../util'
require_relative 'base'
module License
class Uploader < Base
def initialize
@edition = Build::Info::Package.name
@license_bucket = Gitlab::Util.get_env('LICENSE_S3_BUCKET')
@licenses_path = Fi... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/license/collector.rb | Ruby | apache-2.0 | 225 | master | 800 | require 'erb'
require 'fileutils'
require_relative '../util'
require_relative 'base'
module License
class Collector < License::Base
def initialize
@license_bucket = Gitlab::Util.get_env('LICENSE_S3_BUCKET')
@licenses_path = File.absolute_path(@license_bucket)
@license_bucket_region = "eu-west-... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/license/base.rb | Ruby | apache-2.0 | 225 | master | 581 | require_relative '../util'
module License
class Base
def s3_sync(source, destination)
system(
{
'AWS_ACCESS_KEY_ID' => Gitlab::Util.get_env('LICENSE_AWS_ACCESS_KEY_ID'),
'AWS_SECRET_ACCESS_KEY' => Gitlab::Util.get_env('LICENSE_AWS_SECRET_ACCESS_KEY')
},
*%W[aws s... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/license/analyzer.rb | Ruby | apache-2.0 | 225 | master | 8,752 | require_relative '../build/info/package'
module License
class Analyzer
@license_acceptable = Regexp.union([/MIT/i, /LGPL/i, /Apache/i, /Ruby/i, /BSD/i,
/ISO/i, /ISC/i, /Public[- ]Domain/i,
/Unlicense/i, /Artistic/i, /MPL/i, /AFL/i,
... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/tasks/aws.rake | Ruby | apache-2.0 | 225 | master | 857 | require 'omnibus'
require_relative '../aws_helper'
require_relative '../build/check'
require_relative '../build/info/package'
namespace :aws do
namespace :ami do
desc "Create AWS AMI"
task :create do
next unless Build::Check.on_tag?
next if Build::Check.is_auto_deploy? || Build::Check.is_rc_tag... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/tasks/release.rake | Ruby | apache-2.0 | 225 | master | 802 | require_relative '../gitlab_release_helper'
namespace :release do
desc "Release omnibus package"
task package: ["check:on_tag", "build:project", "build:package:sync"]
desc "Release docker image"
task docker: ["docker:push:stable", "docker:push:rc", "docker:push:latest"]
desc "Release QA image"
# For down... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/tasks/docker_tasks.rake | Ruby | apache-2.0 | 225 | master | 4,972 | require 'docker'
require_relative '../build/check'
require_relative '../build/gitlab_image'
require_relative '../build/info/ci'
require_relative '../build/info/docker'
require_relative '../docker_operations'
require_relative '../docker_helper'
require_relative '../util'
namespace :docker do
namespace :build do
... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/tasks/repository.rake | Ruby | apache-2.0 | 225 | master | 647 | require_relative '../package_repository'
desc 'Package repository where the package will be stored'
namespace :repository do
task :target do
puts PackageRepository.new.target
end
task :rc do
puts PackageRepository.new.repository_for_rc
end
namespace :upload do
task :staging, [:staging_repo, :d... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/tasks/qa.rake | Ruby | apache-2.0 | 225 | master | 5,666 | require 'docker'
require 'json'
require_relative '../build/check'
require_relative '../build/gitlab_image'
require_relative '../build/info/components'
require_relative '../build/info/git'
require_relative '../build/qa'
require_relative '../build/qa_image'
require_relative '../docker_operations'
require_relative '../ut... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/tasks/check.rake | Ruby | apache-2.0 | 225 | master | 690 | require_relative '../build/check'
require_relative '../package_size'
namespace :check do
desc "Check if working tree is clean"
task :no_changes do
raise "Files have been modified after commit" unless Build::Check.no_changes?
end
desc "Check if on a tag"
task :on_tag do
raise "Build happening not on ... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/tasks/docs.rake | Ruby | apache-2.0 | 225 | master | 1,987 | # frozen_string_literal: true
require 'date'
require 'pathname'
require 'yaml'
#
# https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page
#
namespace :gitlab do
namespace :docs do
desc 'GitLab | Docs | Create a doc redirect'
task :redirect, [:old_path, :new_path] do |_, args|
if a... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/tasks/build.rake | Ruby | apache-2.0 | 225 | master | 3,560 | require 'fileutils'
require 'json'
require 'net/http'
require_relative '../build'
require_relative '../build/check'
require_relative '../build/facts'
require_relative '../build/info/git'
require_relative '../build/info/package'
require_relative '../gcloud_helper'
require_relative '../ohai_helper'
require_relative '../... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/tasks/cache.rake | Ruby | apache-2.0 | 225 | master | 1,330 | require 'fileutils'
require_relative '../ohai_helper'
namespace :cache do
desc "Populate cache"
task :populate do
Gitlab::Util.section('cache:populate') do
system(*%w[bin/omnibus cache populate])
end
end
desc "Purge existing cache"
task :purge do
[
# Force a new clone of gitlab-rail... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/tasks/license.rake | Ruby | apache-2.0 | 225 | master | 1,858 | require 'fileutils'
require 'json'
require_relative '../build/check'
require_relative '../license/analyzer'
require_relative '../license/collector'
require_relative '../license/uploader'
require_relative '../util'
namespace :license do
desc "Check licenses of bundled softwares"
task :check do
Gitlab::Util.sec... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/tasks/manifest.rake | Ruby | apache-2.0 | 225 | master | 594 | require_relative '../manifest/collector'
require_relative '../manifest/uploader'
namespace :manifest do
desc "Generate version manifest file of current release and push to AWS bucket"
task :upload do
Gitlab::Util.section('manifest:upload') do
# This is done on Ubuntu 18.04 non-rc tag pipeline only
... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/tasks/gitlab_com.rake | Ruby | apache-2.0 | 225 | master | 1,604 | require_relative '../build/check'
require_relative '../build/info/deploy'
require_relative '../build/info/package'
require_relative '../deployer_helper'
require_relative '../util'
namespace :gitlab_com do
desc 'Tasks related to gitlab.com.'
task :deployer do
abort "This task requires DEPLOYER_TRIGGER_TOKEN to ... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | lib/gitlab/tasks/infrastructure.rake | Ruby | apache-2.0 | 225 | master | 510 | desc 'Infrastructure maintenance tasks and utilities'
namespace :infrastructure do
# Use this task to add/update `known_hosts` file, in the unlikely case of a change in
# `gitlab.com` and `dev.gitlab.org` SSH keys.
# Note: After running this task you need to add and commit `support/known_hosts`.
desc 'Updates ... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | support/gitlab_yml_converter.rb | Ruby | apache-2.0 | 225 | master | 1,179 | # This script translates settings from a gitlab.yml file to the format of
# omnibus-gitlab's /etc/gitlab/gitlab.rb file.
#
# The output is NOT a valid gitlab.rb file! The purpose of this script is only
# to reduce copy and paste work.
#
# Usage: ruby gitlab_yml_converter.rb /path/to/gitlab.yml
require 'yaml'
module G... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/spec_helper.rb | Ruby | apache-2.0 | 225 | master | 1,742 | # Just the basic rspec configuration common to all spec testing.
# Use this if you do not need the full weight of `chef_helper`
require 'simplecov-cobertura'
SimpleCov.start do
formatter SimpleCov::Formatter::CoberturaFormatter
# SimpleCov does not work for Chef recipes as Chef dynamically loads and
# evaluates... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef_helper.rb | Ruby | apache-2.0 | 225 | master | 5,846 | # `chef_helper` is a superset of `spec_helper` that configures `chefspec` for
# testing our cookbooks.
require 'spec_helper'
require 'chefspec'
require 'ohai'
# Load chef specific support libraries to provide common convenience methods for our tests
Dir["./spec/chef/support/**/*.rb"].each { |library| require library ... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/gitlab-ctl-commands/completion_spec.rb | Ruby | apache-2.0 | 225 | master | 2,098 | require 'spec_helper'
require 'omnibus-ctl'
RSpec.describe 'gitlab-ctl completion command' do
let(:ctl) { Omnibus::Ctl.new('testing-ctl') }
let(:completion_script_path) { '/opt/testing-ctl/embedded/share/bash-completion/completions/gitlab-ctl-bash-completion' }
let(:ctl_file) { File.join(File.dirname(__FILE__), ... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/gitlab-ctl-commands/gitlab_ctl_spec.rb | Ruby | apache-2.0 | 225 | master | 861 | require 'spec_helper'
require 'omnibus-ctl'
RSpec.describe 'gitlab-ctl' do
before do
allow_any_instance_of(Omnibus::Ctl).to receive(:require).and_call_original
allow_any_instance_of(Omnibus::Ctl).to receive(:require).with(
'/opt/testing-ctl/embedded/service/omnibus-ctl/lib/gitlab_ctl'
) do
re... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/gitlab-ctl-commands/lib/praefect_spec.rb | Ruby | apache-2.0 | 225 | master | 10,377 | require 'spec_helper'
require 'optparse'
require_relative('../../../../files/gitlab-ctl-commands/lib/praefect')
RSpec.describe Praefect do
describe '.parse_options!' do
before do
allow(Kernel).to receive(:exit) { |code| raise "Kernel.exit(#{code})" }
end
shared_examples 'unknown option is specifi... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/gitlab-ctl-commands/lib/upgrade_check_spec.rb | Ruby | apache-2.0 | 225 | master | 1,160 | require 'chef_helper'
$LOAD_PATH << File.join(__dir__, '../../../files/gitlab-ctl-commands/lib')
require 'gitlab_ctl/upgrade_check'
RSpec.describe GitlabCtl::UpgradeCheck do
using RSpec::Parameterized::TableSyntax
context 'not an upgrade' do
it 'returns true' do
expect(described_class.valid?(nil)).to ... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/gitlab-ctl-commands/lib/gitlab_ctl_backup_spec.rb | Ruby | apache-2.0 | 225 | master | 10,898 | require 'chef_helper'
$LOAD_PATH << File.join(__dir__, '../../../files/gitlab-ctl-commands/lib')
require 'gitlab_ctl'
RSpec.describe GitlabCtl::Backup do
let(:backup_dir_path) { '/etc/gitlab/config_backup' }
# Valid backup files match the regular expression
let(:future_valid_backup_files) do
['gitlab_conf... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/gitlab-ctl-commands/lib/util_spec.rb | Ruby | apache-2.0 | 225 | master | 9,471 | require 'spec_helper'
$LOAD_PATH << File.join(__dir__, '../../../files/gitlab-ctl-commands/lib')
require 'gitlab_ctl'
RSpec.describe GitlabCtl::Util do
context 'when there is no TTY available' do
before do
allow(STDIN).to receive(:tty?).and_return(false)
end
it 'asks for a database password in a... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/gitlab-ctl-commands/lib/gitlab_ctl_pg_upgrade_spec.rb | Ruby | apache-2.0 | 225 | master | 5,437 | require 'spec_helper'
$LOAD_PATH << File.join(__dir__, '../../../files/gitlab-ctl-commands/lib')
require 'gitlab_ctl'
def stub_postgresql_json_attributes(config = nil)
options = config || {}
options['port'] ||= '5432'
node_data = { postgresql: options.transform_keys(&:to_sym) }
public_data = { 'postgresql' =... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/gitlab-ctl-commands/lib/gitlab_ctl/postgresql_spec.rb | Ruby | apache-2.0 | 225 | master | 1,654 | require 'spec_helper'
$LOAD_PATH << File.join(__dir__, '../../../../../files/gitlab-ctl-commands/lib')
require 'gitlab_ctl/postgresql'
RSpec.describe GitlabCtl::PostgreSQL do
describe "#postgresql_username" do
before do
allow(GitlabCtl::Util).to receive(:get_node_attributes).and_return(
{
... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/gitlab-ctl-commands/lib/gitlab_ctl/postgresql/decomposition_migration_spec.rb | Ruby | apache-2.0 | 225 | master | 6,081 | require 'spec_helper'
$LOAD_PATH << File.join(__dir__, '../../../../../../files/gitlab-ctl-commands/lib')
require 'gitlab_ctl/util'
require 'gitlab_ctl/postgresql/decomposition_migration'
RSpec.describe GitlabCtl::PostgreSQL::DecompositionMigration do
let(:ctl) { spy('gitlab ctl') }
let(:confirmation) { StringIO.... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/gitlab-ctl-commands/lib/gitlab_ctl/postgresql/replication_spec.rb | Ruby | apache-2.0 | 225 | master | 3,065 | require 'spec_helper'
$LOAD_PATH << File.join(__dir__, '../../../../files/gitlab-ctl-commands/lib/gitlab_ctl')
require 'gitlab_ctl/postgresql/replication'
RSpec.describe GitlabCtl::PostgreSQL::Replication do
let(:ctl) { spy('gitlab ctl') }
let(:util) { spy('gitlab ctl util', error?: false) }
let(:attributes) { ... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/gitlab-ctl-commands/lib/gitlab_ctl/registry/migrate_spec.rb | Ruby | apache-2.0 | 225 | master | 5,006 | require 'optparse'
require_relative '../../../../../../files/gitlab-ctl-commands/lib/gitlab_ctl/registry/migrate'
RSpec.describe GitlabCtl::Registry::Migrate do
describe '.parse_options!' do
before do
allow(Kernel).to receive(:exit) { |code| raise "Kernel.exit(#{code})" }
end
shared_examples 'unk... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/gitlab-ctl-commands/lib/gitlab_ctl/registry/garbage_collect_spec.rb | Ruby | apache-2.0 | 225 | master | 1,136 | $LOAD_PATH << File.join(__dir__, '../../../../../../files/gitlab-ctl-commands/lib')
require 'gitlab_ctl'
require_relative '../../../../../../files/gitlab-ctl-commands/lib/gitlab_ctl/registry/garbage_collect'
RSpec.describe GitlabCtl::Registry::GarbageCollect do
describe '#execute!' do
let(:ctl) { double('ctl') ... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/gitlab-ctl-commands/lib/gitlab_ctl/registry/gc_stats_spec.rb | Ruby | apache-2.0 | 225 | master | 2,840 | require 'optparse'
require_relative '../../../../../../files/gitlab-ctl-commands/lib/gitlab_ctl/registry/gc_stats'
RSpec.describe GitlabCtl::Registry::GcStats do
describe '.parse_options!' do
before do
allow(Kernel).to receive(:exit) { |code| raise "Kernel.exit(#{code})" }
allow(Kernel).to receive(:... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/gitlab-ctl-commands/lib/gitlab_ctl/registry/registry_database_spec.rb | Ruby | apache-2.0 | 225 | master | 7,797 | $LOAD_PATH << File.join(__dir__, '../../../../../../files/gitlab-ctl-commands/lib')
require 'gitlab_ctl'
require 'optparse'
require_relative '../../../../../../files/gitlab-ctl-commands/lib/gitlab_ctl/registry/database'
RSpec.describe GitlabCtl::Registry::Database do
describe '.parse_options!' do
let(:migrate_o... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/gitlab-ctl-commands/lib/gitlab_ctl/registry/import_spec.rb | Ruby | apache-2.0 | 225 | master | 1,215 | require 'optparse'
require_relative '../../../../../../files/gitlab-ctl-commands/lib/gitlab_ctl/registry/import'
RSpec.describe GitlabCtl::Registry::Import do
describe '.parse_options!' do
before do
allow(Kernel).to receive(:exit) { |code| raise "Kernel.exit(#{code})" }
end
options_data = [
... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/support/shared_context/object_store_shared_context.rb | Ruby | apache-2.0 | 225 | master | 2,494 | require 'spec_helper'
require 'omnibus-ctl'
RSpec.shared_context 'object storage config' do
let(:object_config) do
{
artifacts: { bucket: 'artifacts' },
lfs: { bucket: 'lfs-objects' },
dependency_proxy: { bucket: 'dependency_proxy' },
external_diffs: { bucket: 'external_diffs' },
pa... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/support/shared_context/gitlab_rails_shared_context.rb | Ruby | apache-2.0 | 225 | master | 652 | require 'chef_helper'
RSpec.shared_context 'gitlab-rails' do
let(:chef_run) { ChefSpec::SoloRunner.new(step_into: 'templatesymlink').converge('gitlab::default') }
let(:gitlab_yml_template) { chef_run.template('/var/opt/gitlab/gitlab-rails/etc/gitlab.yml') }
let(:gitlab_yml_file_content) { ChefSpec::Renderer.new(... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/support/shared_context/ctl_shared_context.rb | Ruby | apache-2.0 | 225 | master | 814 | require 'spec_helper'
require 'omnibus-ctl'
RSpec.shared_context 'ctl' do
let(:ctl) { Omnibus::Ctl.new('testing-ctl') }
before do
allow_any_instance_of(Omnibus::Ctl).to receive(:require).and_call_original
allow_any_instance_of(Omnibus::Ctl).to receive(:require).with(
"/opt/testing-ctl/embedded/cook... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/support/shared_context/recipes_shared_context.rb | Ruby | apache-2.0 | 225 | master | 3,890 | require 'chef_helper'
RSpec.shared_context 'recipes' do
let(:chef_run) { ChefSpec::SoloRunner.converge('gitlab-ee::default') }
let(:mandatory_recipes) do
recipes =
[
"gitlab-ee::default",
"pgbouncer::user",
"gitlab::default",
"package::config",
"postgresql::direct... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/support/shared_examples/registry_service.rb | Ruby | apache-2.0 | 225 | master | 4,271 | RSpec.shared_examples 'enabled registry service' do
it 'creates default set of directories' do
expect(chef_run.node['registry']['dir'])
.to eql('/var/opt/gitlab/registry')
expect(chef_run.node['gitlab']['gitlab_rails']['registry_path'])
.to eql('/var/opt/gitlab/gitlab-rails/shared/registry')
... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/support/shared_examples/gitlab_yml_object_storage_shared_examples.rb | Ruby | apache-2.0 | 225 | master | 1,681 | RSpec.shared_examples 'renders object storage settings in gitlab.yml' do |component, component_default = {}, workhorse_accelerated = true|
include_context 'gitlab-rails'
include_context 'object storage config'
describe "for #{component}" do
context 'with default values' do
it 'renders gitlab.yml with o... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/support/shared_examples/logged_service.rb | Ruby | apache-2.0 | 225 | master | 1,917 | RSpec.shared_examples 'enabled logged service' do |svc_name, is_runit = false, settings = {}|
log_directory = settings[:log_directory] || "/var/log/gitlab/#{svc_name}"
expected_log_dir_owner = settings[:log_directory_owner] || 'root'
expected_log_dir_group = settings[:log_group] || settings[:log_directory_group] ... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/support/shared_examples/geo_promotion_command_accepts_option_shared_examples.rb | Ruby | apache-2.0 | 225 | master | 581 | require 'spec_helper'
RSpec.shared_examples 'geo promotion command accepts option' do |passed_option, expected_option|
it 'accepts given option' do
allow_any_instance_of(klass).to receive(:execute).and_return(true)
# ARGV contains the commands that were passed to rspec, which are
# invalid for the omnib... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/support/shared_examples/git_data_dirs.rb | Ruby | apache-2.0 | 225 | master | 228 | RSpec.shared_examples 'git data directory' do |git_data_path|
it 'creates the repositories directory' do
expect(chef_run).to create_storage_directory(git_data_path).with(owner: 'git', group: 'git', mode: '2770')
end
end |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/support/shared_examples/yaml_check.rb | Ruby | apache-2.0 | 225 | master | 260 | require 'yaml'
RSpec.shared_examples 'renders a valid YAML file' do |filename|
it 'parses YAML with no errors' do
expect(chef_run).to render_file(filename).with_content { |content|
expect { YAML.parse(content) }.not_to raise_error
}
end
end |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/support/shared_examples/runit_service.rb | Ruby | apache-2.0 | 225 | master | 5,040 | def get_env_string(username, groupname)
env_string = ""
env_string << username if username
env_string << ":#{groupname}" if groupname
env_string
end
RSpec.shared_examples 'enabled runit service' do |svc_name, owner, group, username = nil, groupname = nil, has_supervisor = nil|
it 'creates directories' do
... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/support/shared_examples/gitlab_geo_promotion_commands_shared_examples.rb | Ruby | apache-2.0 | 225 | master | 539 | require 'spec_helper'
RSpec.shared_examples 'gitlab geo promotion commands' do
it 'appends a geo replication command' do
expect(ctl.get_all_commands_hash).to include(command_name)
end
it 'executes the command when called' do
# ARGV contains the commands that were passed to rspec, which are
# invalid... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/support/shared_examples/consul_service_name.rb | Ruby | apache-2.0 | 225 | master | 1,204 | RSpec.shared_examples 'consul service discovery' do |gitlab_rb_key, service_name|
let(:gitlab_rb_setting) do
{
consul: {
enable: true,
monitoring_service_discovery: true
}
}
end
describe 'consul service discovery' do
let(:chef_run) { ChefSpec::SoloRunner.converge('gitlab-e... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/support/shared_examples/logrotate_config.rb | Ruby | apache-2.0 | 225 | master | 413 | RSpec.shared_examples 'configured logrotate service' do |svc, username = 'git', group = 'git'|
it 'creates logrotate config file' do
expect(chef_run).to render_file("/var/opt/gitlab/logrotate/logrotate.d/#{svc}")
end
it 'specifies su parameter in logrotate config' do
expect(chef_run).to render_file("/var... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/consul/libraries/watch_helper_spec.rb | Ruby | apache-2.0 | 225 | master | 422 | require 'chef_helper'
RSpec.describe WatchHelper::WatcherConfig do
cached(:chef_run) { converge_config }
let(:node) { chef_run.node }
subject { described_class.new(node) }
let(:standard_watcher_names) { ['postgresql'] }
context 'when initialized' do
it 'should have standard watchers defined' do
e... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/consul/libraries/consul_helper_spec.rb | Ruby | apache-2.0 | 225 | master | 4,981 | require 'chef_helper'
RSpec.describe ConsulHelper do
let(:chef_run) { converge_config }
subject { described_class.new(chef_run.node) }
describe '#running_version' do
let(:consul_api_output) { ['200', '{"Config": { "Version": "1.8.10" }}'] }
before do
# Un-doing the stub added in chef_helper
... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/consul/libraries/failover_helper_spec.rb | Ruby | apache-2.0 | 225 | master | 5,421 | require 'chef_helper'
require 'json'
require 'logger'
NodeData = Struct.new('NodeData', :name, :address, :leader?)
RSpec.describe FailoverHelper::SplitBrain do
let(:node_list) { %w(cats kittens) }
context 'when passed a list of nodes' do
it 'sets primary_nodes to that list' do
brain = FailoverHelper::... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/consul/recipes/disable_service_postgresql_spec.rb | Ruby | apache-2.0 | 225 | master | 612 | require 'chef_helper'
RSpec.describe 'consul::disable_service_postgresql' do
let(:chef_run) { ChefSpec::SoloRunner.new(step_into: %w(runit_service)).converge('gitlab-ee::default', 'consul::disable_service_postgresql') }
before do
allow(Gitlab).to receive(:[]).and_call_original
end
context 'default' do
... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/consul/recipes/consul_watcher_spec.rb | Ruby | apache-2.0 | 225 | master | 1,950 | require 'chef_helper'
RSpec.describe 'consul::watchers' do
let(:chef_run) { ChefSpec::SoloRunner.converge('gitlab-ee::default') }
let(:watcher_conf) { '/var/opt/gitlab/consul/config.d/watcher_postgresql.json' }
let(:watcher_check) { '/var/opt/gitlab/consul/scripts/failover_postgresql_in_pgbouncer' }
let(:any_s... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/consul/recipes/consul_spec.rb | Ruby | apache-2.0 | 225 | master | 16,868 | require 'chef_helper'
RSpec.describe 'consul' do
let(:chef_run) { ChefSpec::SoloRunner.new(step_into: %w(runit_service)).converge('gitlab-ee::default') }
let(:consul_conf) { '/var/opt/gitlab/consul/config.json' }
let(:consul_conf_chef_file) { chef_run.file(consul_conf) }
let(:consul_conf_file_content) { ChefSp... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/consul/recipes/configure_services_spec.rb | Ruby | apache-2.0 | 225 | master | 917 | require 'chef_helper'
RSpec.describe 'consul::configure_services' do
let(:chef_run) { ChefSpec::SoloRunner.new(step_into: %w(runit_service)).converge('gitlab-ee::default') }
before do
allow(Gitlab).to receive(:[]).and_call_original
end
describe 'enabling services' do
before do
stub_gitlab_rb(
... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/consul/recipes/enable_service_postgresq_spec.rb | Ruby | apache-2.0 | 225 | master | 2,191 | require 'chef_helper'
RSpec.describe 'consul::enable_service_postgresql' do
let(:chef_run) { ChefSpec::SoloRunner.new(step_into: %w(runit_service)).converge('gitlab-ee::default') }
before do
allow(Gitlab).to receive(:[]).and_call_original
end
context 'default' do
context 'on a regular cluster' do
... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/consul/resources/consul_service_spec.rb | Ruby | apache-2.0 | 225 | master | 2,727 | require 'chef_helper'
RSpec.describe 'consul_service' do
let(:runner) do
ChefSpec::SoloRunner.new(step_into: %w(consul_service))
end
context 'create' do
before do
runner.node.automatic['ipaddress'] = '10.1.1.1'
end
context 'with service address and port properties' do
let(:chef_run)... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/pgbouncer/resources/pgbouncer_user_spec.rb | Ruby | apache-2.0 | 225 | master | 812 | require 'chef_helper'
RSpec.describe 'pgbouncer_user' do
let(:runner) { ChefSpec::SoloRunner.new(step_into: %w(pgbouncer_user)) }
context 'create' do
let(:chef_run) { runner.converge('test_pgbouncer::pgbouncer_user_create') }
it 'ensures the auth function is owned by the correct user' do
allow_any_... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/pgbouncer/recipes/pgbouncer_user_spec.rb | Ruby | apache-2.0 | 225 | master | 5,913 | #
# Copyright:: Copyright (c) 2017 GitLab Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/pgbouncer/recipes/pgbouncer_spec.rb | Ruby | apache-2.0 | 225 | master | 16,572 | #
# Copyright:: Copyright (c) 2017 GitLab Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/pgbouncer/libraries/pgbouncer_helper_spec.rb | Ruby | apache-2.0 | 225 | master | 3,979 | require 'chef_helper'
RSpec.describe PgbouncerHelper do
let(:chef_run) { converge_config(is_ee: true) }
subject { described_class.new(chef_run.node) }
before do
allow(Gitlab).to receive(:[]).and_call_original
end
describe '#running?' do
cached(:chef_run) { converge_config(is_ee: true) }
it 're... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/gitlab/templates/registry-env-db_connection_spec.rb | Ruby | apache-2.0 | 225 | master | 4,408 | require 'chef_helper'
RSpec.describe 'registry-env-db_connection.erb template' do
let(:chef_runner) do
ChefSpec::SoloRunner.new(step_into: %w(registry_enable))
end
let(:chef_run) do
chef_runner.converge('gitlab-ee::default')
end
let(:template_path) { '/opt/gitlab/etc/gitlab-backup/env/env-connectio... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/gitlab/resources/rails_migration_spec.rb | Ruby | apache-2.0 | 225 | master | 2,462 | require 'chef_helper'
RSpec.describe 'rails_migration' do
let(:runner) { ChefSpec::SoloRunner.new(step_into: %w(rails_migration)) }
before do
allow_any_instance_of(PgHelper).to receive(:postgresql_user).and_return('fakeuser')
allow(Gitlab).to receive(:[]).and_call_original
end
context 'run' do
le... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/gitlab/resources/puma_config_spec.rb | Ruby | apache-2.0 | 225 | master | 2,439 | require 'chef_helper'
RSpec.describe 'puma_config' do
let(:runner) do
ChefSpec::SoloRunner.new(step_into: %w(puma_config))
end
context 'create' do
let(:chef_run) { runner.converge('test_gitlab::puma_config_create') }
it 'creates necessary directories' do
expect(chef_run).to create_directory('... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/gitlab/recipes/nginx_spec.rb | Ruby | apache-2.0 | 225 | master | 56,733 | require 'chef_helper'
RSpec.describe 'gitlab::nginx' do
let(:chef_runner) do
ChefSpec::SoloRunner.new(step_into: %w(runit_service nginx_configuration)) do |node|
node.normal['gitlab']['nginx']['enable'] = true
node.normal['package']['install-dir'] = '/opt/gitlab'
end
end
let(:chef_run) do
... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/gitlab/recipes/database_reindexing_disable_spec.rb | Ruby | apache-2.0 | 225 | master | 343 | require 'chef_helper'
RSpec.describe 'gitlab::database-reindexing' do
let(:chef_run) { converge_config('gitlab::database_reindexing_disable') }
before do
allow(Gitlab).to receive(:[]).and_call_original
end
it 'removes the database-reindexing cronjob' do
expect(chef_run).to delete_crond_job('database-... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/gitlab/recipes/gitlab-healthcheck_spec.rb | Ruby | apache-2.0 | 225 | master | 3,490 | require 'chef_helper'
RSpec.describe 'gitlab::gitlab-healthcheck' do
let(:chef_run) { ChefSpec::SoloRunner.converge('gitlab::default') }
before do
allow(Gitlab).to receive(:[]).and_call_original
end
context 'nginx is enabled' do
before do
stub_gitlab_rb(nginx: { enable: true })
end
it ... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/gitlab/recipes/config_spec.rb | Ruby | apache-2.0 | 225 | master | 7,444 | require 'chef_helper'
RSpec.describe 'gitlab-base::config' do
cached(:chef_run) { converge_config }
let(:node) { chef_run.node }
before do
allow(Gitlab).to receive(:[]).and_call_original
end
shared_examples 'regular services are disabled' do
it 'disables regular services' do
expect(node['gitl... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/gitlab/recipes/database_migrations_spec.rb | Ruby | apache-2.0 | 225 | master | 7,017 | require 'chef_helper'
# NOTE: These specs do not verify whether the code actually ran
# Nor whether the resource inside of the recipe was notified correctly.
# At this moment they only verify whether the expected commands are passed
# to the resource block.
RSpec.describe 'gitlab::database-migrations' do
let(:chef_... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/gitlab/recipes/generate_secrets_spec.rb | Ruby | apache-2.0 | 225 | master | 5,009 | # These tests confirm that calling the generate_secrets recipe works correctly
# both when using the default path and and when using anoptional path to the
# secrets file. It tests that the file is created and contains secrets. It does
# not exhaustively test the resulting secrets file contents. Those tests are
# left ... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/gitlab/recipes/registry_enable_backup_restore_credentials_spec.rb | Ruby | apache-2.0 | 225 | master | 6,025 | require 'chef_helper'
RSpec.describe 'gitlab::registry_enable_backup_restore_credentials' do
let(:chef_runner) do
ChefSpec::SoloRunner.new(step_into: %w(registry_enable))
end
let(:chef_run) do
chef_runner.converge('gitlab-ee::default')
end
before do
allow(Gitlab).to receive(:[]).and_call_origin... |
github | gitlabhq/omnibus-gitlab | https://github.com/gitlabhq/omnibus-gitlab | spec/chef/cookbooks/gitlab/recipes/gitlab-workhorse_spec.rb | Ruby | apache-2.0 | 225 | master | 35,725 | require 'chef_helper'
RSpec.describe 'gitlab::gitlab-workhorse' do
let(:node_cpus) { 1 }
let(:chef_run) do
ChefSpec::SoloRunner.new(step_into: %w(runit_service)) do |node|
node.automatic['cpu']['total'] = node_cpus
end.converge('gitlab::default')
end
let(:default_vars) do
{
'SSL_CERT_DI... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.