From b98c89133e2e4b3e4bcaf52d5c84c621ef0bfd31 Mon Sep 17 00:00:00 2001 From: Balasankar 'Balu' C Date: Thu, 24 Mar 2022 04:38:17 +0000 Subject: [PATCH] Restructure chef rspecs to match code structure Moving around the chef rspec tests allows developers to more easily discover and maintain them. Additionally, this restructuring clears the path to use projectionist and more clearly see if any test coverage is missing. Related https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/6721 Signed-off-by: Balasankar "Balu" C --- .projections.json.example | 24 +++++++++++ .rubocop_todo.yml | 40 +++++++++---------- .../consul/libraries/consul_helper_spec.rb | 0 .../consul/libraries/failover_helper_spec.rb | 0 .../consul/recipes/configure_services_spec.rb | 0 .../consul/recipes/consul_spec.rb | 0 .../consul/recipes/consul_watcher_spec.rb | 0 .../disable_service_postgresql_spec.rb | 0 .../recipes/enable_service_postgresq_spec.rb | 0 .../consul/resources/consul_service_spec.rb | 0 .../crond}/recipes/crond_enable_spec.rb | 0 .../crond/resources/crond_job_spec.rb | 0 .../gitaly}/libraries/gitaly_spec.rb | 0 .../gitaly}/recipes/gitaly_spec.rb | 0 .../libraries/gitlab_geo_helper_spec.rb | 1 - .../libraries/sentinel_helper_spec.rb | 0 .../gitlab-ee}/libraries/sentinel_spec.rb | 0 .../gitlab-ee/recipes/default_spec.rb | 0 .../gitlab-ee/recipes/geo-logcursor_spec.rb | 0 .../gitlab-ee/recipes/geo-postgresql_spec.rb | 0 .../recipes/geo-secondary_disable_spec.rb | 0 .../gitlab-ee/recipes/geo-secondary_spec.rb | 0 .../recipes/geo_database_migrations_spec.rb | 0 .../gitlab-ee/recipes/geo_spec.rb | 0 .../gitlab-ee/recipes/sentinel_spec.rb | 0 .../resources/pgbouncer_user_spec.rb | 0 .../gitlab-kas}/recipes/gitlab-kas_spec.rb | 0 .../gitlab-pages/recipes/gitlab-pages_spec.rb | 0 .../gitlab/libraries/account_helper_spec.rb | 0 .../libraries/helpers/base_pg_helper_spec.rb | 0 .../helpers/gitlab_workhorse_helper_spec.rb | 0 .../gitlab/libraries/helpers}/helper_spec.rb | 0 .../helpers/pg_status_helper_spec.rb | 0 .../gitlab}/libraries/pg_version_spec.rb | 0 .../libraries/rails_migration_helper_spec.rb | 0 .../gitlab}/libraries/redis_helper_spec.rb | 0 .../cookbooks/gitlab}/libraries/redis_spec.rb | 0 .../gitlab}/libraries/redis_uri_spec.rb | 1 - .../gitlab}/libraries/registry_spec.rb | 1 - .../gitlab}/libraries/workhorse_spec.rb | 0 .../gitlab}/recipes/add_trusted_certs_spec.rb | 0 .../gitlab}/recipes/config_spec.rb | 0 .../recipes/database_migrations_spec.rb | 0 .../database_reindexing_disable_spec.rb | 0 .../database_reindexing_enable_spec.rb | 0 .../gitlab}/recipes/default_spec.rb | 0 .../recipes/gitlab-healthcheck_spec.rb | 0 .../recipes/gitlab-rails/database_yml_spec.rb | 0 .../gitlab-rails/gitlab_yml/backup_spec.rb | 0 .../gitlab-rails/gitlab_yml/consul_spec.rb | 0 .../gitlab-rails/gitlab_yml/cron_jobs_spec.rb | 0 .../gitlab-rails/gitlab_yml/extra_spec.rb | 0 .../gitlab_yml/forti_authenticator_spec.rb | 0 .../gitlab_yml/forti_token_cloud_spec.rb | 0 .../gitlab-rails/gitlab_yml/geo_spec.rb | 0 .../gitlab-rails/gitlab_yml/gitaly_spec.rb | 0 .../gitlab_yml/gitlab_shell_spec.rb | 0 .../gitlab-rails/gitlab_yml/gitlab_spec.rb | 0 .../gitlab_yml/incoming_email_spec.rb | 0 .../gitlab-rails/gitlab_yml/ldap_spec.rb | 0 .../gitlab_yml/mattermost_spec.rb | 0 .../gitlab_yml/monitoring_spec.rb | 0 .../gitlab_yml/object_storage_spec.rb | 0 .../gitlab-rails/gitlab_yml/omniauth_spec.rb | 0 .../gitlab-rails/gitlab_yml/pages_spec.rb | 0 .../gitlab_yml/prometheus_spec.rb | 0 .../gitlab_yml/pseudonymizer_spec.rb | 0 .../gitlab-rails/gitlab_yml/registry_spec.rb | 0 .../gitlab_yml/repositories_storages_spec.rb | 0 .../gitlab-rails/gitlab_yml/sentry_spec.rb | 0 .../gitlab_yml/service_desk_email_spec.rb | 0 .../gitlab-rails/gitlab_yml/shutdown_spec.rb | 0 .../gitlab-rails/gitlab_yml/sidekiq_spec.rb | 0 .../gitlab-rails/gitlab_yml/smartcard_spec.rb | 0 .../gitlab-rails/gitlab_yml/unleash_spec.rb | 0 .../gitlab}/recipes/gitlab-rails_spec.rb | 0 .../gitlab}/recipes/gitlab-shell_spec.rb | 0 .../gitlab}/recipes/gitlab-workhorse_spec.rb | 0 .../gitlab}/recipes/mailroom_spec.rb | 0 .../gitlab}/recipes/nginx_spec.rb | 0 .../gitlab}/recipes/puma_spec.rb | 8 ++-- .../gitlab}/recipes/rails_cache_clear_spec.rb | 0 .../gitlab}/recipes/remote-syslog_spec.rb | 0 .../gitlab}/recipes/selinux_spec.rb | 0 .../gitlab/recipes/show_config_spec.rb | 0 .../gitlab}/recipes/sidekiq_spec.rb | 2 +- .../gitlab}/recipes/storage-check_spec.rb | 0 .../gitlab}/recipes/users_spec.rb | 0 .../gitlab/resources/puma_config_spec.rb | 0 .../gitlab/resources/rails_migration_spec.rb | 0 .../libraries/lets_encrypt_spec.rb | 0 .../letsencrypt}/recipes/letsencrypt_spec.rb | 0 .../resources/letsencrypt_certificate_spec.rb | 0 .../recipes/folders_and_configs_spec.rb | 0 .../logrotate/recipes/logrotate_spec.rb | 0 .../mattermost}/recipes/mattermost_spec.rb | 0 .../libraries/prometheus_helper_spec.rb | 0 .../monitoring/libraries/prometheus_spec.rb | 0 .../monitoring/recipes/alertmanager_spec.rb | 0 .../recipes/gitlab-exporter_spec.rb | 0 .../monitoring/recipes/grafana_spec.rb | 0 .../monitoring/recipes/node-exporter_spec.rb | 0 .../recipes/pgbouncer-exporter_spec.rb | 0 .../recipes/postgres_exporter_spec.rb | 0 .../monitoring/recipes/prometheus_spec.rb | 0 .../monitoring/recipes/redis_exporter_spec.rb | 0 .../package/libraries/config}/gitlab_spec.rb | 1 - .../package/libraries/config}/roles_spec.rb | 0 .../libraries/config}/services_spec.rb | 0 .../package}/libraries/config_mash_spec.rb | 1 - .../package}/libraries/deprecations_spec.rb | 1 - .../package/libraries}/gitlab_cluster_spec.rb | 1 - .../libraries/helpers}/logging_helper_spec.rb | 0 .../libraries/helpers/node_helper_spec.rb | 0 .../libraries/helpers}/output_helper_spec.rb | 1 - .../helpers/shell_out_helper_spec.rb | 0 .../package/libraries/omnibus_helper_spec.rb | 0 .../package/libraries/secrets_helper_spec.rb} | 0 .../package/libraries/services_helper_spec.rb | 0 .../storage_directory_helper_spec.rb | 0 .../package}/libraries/systemd_helper_spec.rb | 1 - .../package/recipes/runit_spec.rb | 0 .../package/recipes/runit_systemd_spec.rb | 0 .../package/resources/account_spec.rb | 0 .../package/resources/env_dir_spec.rb | 0 .../package/resources/gitlab_sysctl_spec.rb | 0 .../resources/storage_directory_spec.rb | 0 .../package/resources/templatesymlink_spec.rb | 0 .../package/resources/version_file_spec.rb | 0 .../patroni/libraries/patroni_helper_spec.rb | 0 .../patroni/recipes/patroni_spec.rb | 0 .../libraries/pgbouncer_helper_spec.rb | 0 .../pgbouncer/recipes/pgbouncer_spec.rb | 0 .../pgbouncer/recipes/pgbouncer_user_spec.rb | 0 .../postgresql}/recipes/postgresql_spec.rb | 0 .../postgresql/recipes/sysctl_spec.rb | 0 .../postgresql/recipes/user_spec.rb | 0 .../postgresql/resources/config_spec.rb | 0 .../postgresql/resources/database_spec.rb | 0 .../postgresql/resources/extension_spec.rb | 0 .../postgresql/resources/query_spec.rb | 0 .../postgresql/resources/schema_spec.rb | 0 .../postgresql/resources/user_spec.rb | 0 .../praefect}/recipes/praefect_spec.rb | 0 .../redis/recipes}/redis_spec.rb | 0 .../registry}/recipes/registry_spec.rb | 0 .../spamcheck/recipes/spamcheck_spec.rb | 0 .../cookbooks/acme/attributes/default.rb | 0 .../fixtures/cookbooks/acme/metadata.rb | 0 .../cookbooks/acme/resources/certificate.rb | 0 .../cookbooks/acme/resources/selfsigned.rb | 0 .../cookbooks/test_consul/metadata.rb | 0 .../recipes/consul_service_address_port.rb | 0 .../recipes/consul_service_delete.rb | 0 .../consul_service_delete_no_reload.rb | 0 .../recipes/consul_service_meta.rb | 0 .../recipes/consul_service_socket.rb | 0 .../test_consul/recipes/reload_consul.rb | 0 .../fixtures/cookbooks/test_crond/metadata.rb | 0 .../test_crond/recipes/crond_job_delete.rb | 0 .../test_crond/recipes/crond_job_minimal.rb | 0 .../cookbooks/test_gitlab/metadata.rb | 0 .../test_gitlab/recipes/puma_config_create.rb | 0 .../test_gitlab/recipes/puma_config_custom.rb | 0 .../recipes/rails_migration_run.rb | 0 .../cookbooks/test_gitlab_ee/metadata.rb | 0 .../recipes/pgbouncer_user_create_geo.rb | 0 .../recipes/pgbouncer_user_create_rails.rb | 0 .../cookbooks/test_package/metadata.rb | 0 .../test_package/recipes/account_create.rb | 0 .../test_package/recipes/account_remove.rb | 0 .../test_package/recipes/env_dir_create.rb | 0 .../recipes/gitlab_sysctl_create.rb | 0 .../recipes/storage_directory_create.rb | 0 .../recipes/templatesymlink_create.rb | 0 .../recipes/templatesymlink_delete.rb | 0 .../recipes/version_file_create.rb | 0 .../templates/default/test-template.erb | 0 .../cookbooks/test_postgresql/metadata.rb | 0 .../recipes/postgresql_config.rb | 0 .../recipes/postgresql_database_create.rb | 0 ...postgresql_database_create_with_options.rb | 0 .../recipes/postgresql_extension_enable.rb | 0 .../recipes/postgresql_query_run.rb | 2 - .../recipes/postgresql_schema_create.rb | 0 .../recipes/postgresql_user_create.rb | 0 .../postgresql_user_options_superuser.rb | 0 .../postgresql_user_options_unspecified.rb | 0 .../recipes/postgresql_user_password_empty.rb | 0 .../recipes/postgresql_user_password_md5.rb | 0 .../recipes/postgresql_user_password_nil.rb | 0 .../postgresql_user_password_unspecified.rb | 0 .../fixtures/fauxhai/ubuntu/16.04-docker.json | 0 .../fauxhai/ubuntu/16.04-more-cpus.json | 0 .../fauxhai/ubuntu/16.04-no-run-tmpfs.json | 0 .../fixtures/fauxhai/ubuntu/16.04.json | 0 .../migration/failed-migration-status-file | 0 .../successful-migration-status-file | 0 .../geo_replication_spec.rb | 4 +- .../gitlab-ctl-commands-ee/geo_spec.rb | 4 +- .../gitlab-ctl-commands-ee/lib/consul_spec.rb | 0 .../lib/geo/pitr_file_spec.rb | 0 .../lib/geo/promote_db_spec.rb | 0 .../lib/geo/promote_spec.rb | 2 +- .../lib/geo/promote_to_primary_node_spec.rb | 0 .../geo/promotion_preflight_checks_spec.rb | 0 .../lib/geo/replication_process_spec.rb | 0 .../lib/geo/replication_spec.rb | 0 .../geo/replication_toggle_command_spec.rb | 0 .../lib/patroni_spec.rb | 4 +- .../lib/pgbouncer_spec.rb | 0 .../lib/postgresql/ee_spec.rb | 0 .../gitlab-ctl-commands-ee/promote_db_spec.rb | 2 +- .../promote_to_primary_node_spec.rb | 0 .../promotion_preflight_checks_spec.rb | 2 +- .../replicate_geo_database_spec.rb | 2 +- .../gitlab-ctl-commands/gitlab_ctl_spec.rb | 4 +- .../lib/gitlab_ctl_backup_spec.rb | 0 .../lib/gitlab_ctl_pg_upgrade_spec.rb | 0 .../lib/postgresql/replication_spec.rb | 0 .../lib/postgresql_spec.rb | 0 .../gitlab-ctl-commands/lib/praefect_spec.rb | 2 +- .../lib/upgrade_check_spec.rb | 0 .../gitlab-ctl-commands/lib/util_spec.rb | 0 .../shared_context/ctl_shared_context.rb | 4 +- .../gitlab_rails_shared_context.rb | 0 .../object_store_shared_context.rb | 0 .../shared_examples/consul_service_name.rb | 2 +- ..._command_accepts_option_shared_examples.rb | 0 ..._geo_promotion_commands_shared_examples.rb | 0 ...tlab_yml_object_storage_shared_examples.rb | 2 +- .../shared_examples/logrotate_config.rb | 2 +- .../shared_examples/registry_service.rb | 2 +- .../support/shared_examples/runit_service.rb | 4 +- .../support/shared_examples/yaml_check.rb | 2 +- spec/chef_helper.rb | 19 ++++++--- spec/support/macros.rb | 2 +- 237 files changed, 86 insertions(+), 64 deletions(-) rename spec/chef/{ => cookbooks}/consul/libraries/consul_helper_spec.rb (100%) rename spec/chef/{ => cookbooks}/consul/libraries/failover_helper_spec.rb (100%) rename spec/chef/{ => cookbooks}/consul/recipes/configure_services_spec.rb (100%) rename spec/chef/{ => cookbooks}/consul/recipes/consul_spec.rb (100%) rename spec/chef/{ => cookbooks}/consul/recipes/consul_watcher_spec.rb (100%) rename spec/chef/{ => cookbooks}/consul/recipes/disable_service_postgresql_spec.rb (100%) rename spec/chef/{ => cookbooks}/consul/recipes/enable_service_postgresq_spec.rb (100%) rename spec/chef/{ => cookbooks}/consul/resources/consul_service_spec.rb (100%) rename spec/chef/{ => cookbooks/crond}/recipes/crond_enable_spec.rb (100%) rename spec/chef/{ => cookbooks}/crond/resources/crond_job_spec.rb (100%) rename spec/{ => chef/cookbooks/gitaly}/libraries/gitaly_spec.rb (100%) rename spec/chef/{ => cookbooks/gitaly}/recipes/gitaly_spec.rb (100%) rename spec/chef/{ => cookbooks}/gitlab-ee/libraries/gitlab_geo_helper_spec.rb (94%) rename spec/{ => chef/cookbooks/gitlab-ee}/libraries/sentinel_helper_spec.rb (100%) rename spec/{ => chef/cookbooks/gitlab-ee}/libraries/sentinel_spec.rb (100%) rename spec/chef/{ => cookbooks}/gitlab-ee/recipes/default_spec.rb (100%) rename spec/chef/{ => cookbooks}/gitlab-ee/recipes/geo-logcursor_spec.rb (100%) rename spec/chef/{ => cookbooks}/gitlab-ee/recipes/geo-postgresql_spec.rb (100%) rename spec/chef/{ => cookbooks}/gitlab-ee/recipes/geo-secondary_disable_spec.rb (100%) rename spec/chef/{ => cookbooks}/gitlab-ee/recipes/geo-secondary_spec.rb (100%) rename spec/chef/{ => cookbooks}/gitlab-ee/recipes/geo_database_migrations_spec.rb (100%) rename spec/chef/{ => cookbooks}/gitlab-ee/recipes/geo_spec.rb (100%) rename spec/chef/{ => cookbooks}/gitlab-ee/recipes/sentinel_spec.rb (100%) rename spec/chef/{ => cookbooks}/gitlab-ee/resources/pgbouncer_user_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab-kas}/recipes/gitlab-kas_spec.rb (100%) rename spec/chef/{ => cookbooks}/gitlab-pages/recipes/gitlab-pages_spec.rb (100%) rename spec/chef/{ => cookbooks}/gitlab/libraries/account_helper_spec.rb (100%) rename spec/{ => chef/cookbooks/gitlab}/libraries/helpers/base_pg_helper_spec.rb (100%) rename spec/{ => chef/cookbooks/gitlab}/libraries/helpers/gitlab_workhorse_helper_spec.rb (100%) rename spec/{libraries => chef/cookbooks/gitlab/libraries/helpers}/helper_spec.rb (100%) rename spec/{ => chef/cookbooks/gitlab}/libraries/helpers/pg_status_helper_spec.rb (100%) rename spec/{ => chef/cookbooks/gitlab}/libraries/pg_version_spec.rb (100%) rename spec/chef/{ => cookbooks}/gitlab/libraries/rails_migration_helper_spec.rb (100%) rename spec/{ => chef/cookbooks/gitlab}/libraries/redis_helper_spec.rb (100%) rename spec/{ => chef/cookbooks/gitlab}/libraries/redis_spec.rb (100%) rename spec/{ => chef/cookbooks/gitlab}/libraries/redis_uri_spec.rb (96%) rename spec/{ => chef/cookbooks/gitlab}/libraries/registry_spec.rb (93%) rename spec/{ => chef/cookbooks/gitlab}/libraries/workhorse_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/add_trusted_certs_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/config_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/database_migrations_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/database_reindexing_disable_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/database_reindexing_enable_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/default_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-healthcheck_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/database_yml_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/backup_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/consul_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/cron_jobs_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/extra_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/forti_authenticator_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/forti_token_cloud_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/geo_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/gitaly_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/gitlab_shell_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/gitlab_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/incoming_email_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/ldap_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/mattermost_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/monitoring_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/object_storage_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/omniauth_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/pages_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/prometheus_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/pseudonymizer_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/registry_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/repositories_storages_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/sentry_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/service_desk_email_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/shutdown_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/sidekiq_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/smartcard_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails/gitlab_yml/unleash_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-rails_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-shell_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/gitlab-workhorse_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/mailroom_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/nginx_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/puma_spec.rb (96%) rename spec/chef/{ => cookbooks/gitlab}/recipes/rails_cache_clear_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/remote-syslog_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/selinux_spec.rb (100%) rename spec/chef/{ => cookbooks}/gitlab/recipes/show_config_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/sidekiq_spec.rb (96%) rename spec/chef/{ => cookbooks/gitlab}/recipes/storage-check_spec.rb (100%) rename spec/chef/{ => cookbooks/gitlab}/recipes/users_spec.rb (100%) rename spec/chef/{ => cookbooks}/gitlab/resources/puma_config_spec.rb (100%) rename spec/chef/{ => cookbooks}/gitlab/resources/rails_migration_spec.rb (100%) rename spec/{ => chef/cookbooks/letsencrypt}/libraries/lets_encrypt_spec.rb (100%) rename spec/chef/{ => cookbooks/letsencrypt}/recipes/letsencrypt_spec.rb (100%) rename spec/chef/{ => cookbooks}/letsencrypt/resources/letsencrypt_certificate_spec.rb (100%) rename spec/chef/{ => cookbooks}/logrotate/recipes/folders_and_configs_spec.rb (100%) rename spec/chef/{ => cookbooks}/logrotate/recipes/logrotate_spec.rb (100%) rename spec/chef/{ => cookbooks/mattermost}/recipes/mattermost_spec.rb (100%) rename spec/chef/{ => cookbooks}/monitoring/libraries/prometheus_helper_spec.rb (100%) rename spec/chef/{ => cookbooks}/monitoring/libraries/prometheus_spec.rb (100%) rename spec/chef/{ => cookbooks}/monitoring/recipes/alertmanager_spec.rb (100%) rename spec/chef/{ => cookbooks}/monitoring/recipes/gitlab-exporter_spec.rb (100%) rename spec/chef/{ => cookbooks}/monitoring/recipes/grafana_spec.rb (100%) rename spec/chef/{ => cookbooks}/monitoring/recipes/node-exporter_spec.rb (100%) rename spec/chef/{ => cookbooks}/monitoring/recipes/pgbouncer-exporter_spec.rb (100%) rename spec/chef/{ => cookbooks}/monitoring/recipes/postgres_exporter_spec.rb (100%) rename spec/chef/{ => cookbooks}/monitoring/recipes/prometheus_spec.rb (100%) rename spec/chef/{ => cookbooks}/monitoring/recipes/redis_exporter_spec.rb (100%) rename spec/{libraries => chef/cookbooks/package/libraries/config}/gitlab_spec.rb (97%) rename spec/{libraries => chef/cookbooks/package/libraries/config}/roles_spec.rb (100%) rename spec/{libraries => chef/cookbooks/package/libraries/config}/services_spec.rb (100%) rename spec/{ => chef/cookbooks/package}/libraries/config_mash_spec.rb (96%) rename spec/{ => chef/cookbooks/package}/libraries/deprecations_spec.rb (99%) rename spec/{libraries/helpers => chef/cookbooks/package/libraries}/gitlab_cluster_spec.rb (98%) rename spec/{libraries => chef/cookbooks/package/libraries/helpers}/logging_helper_spec.rb (100%) rename spec/chef/{ => cookbooks}/package/libraries/helpers/node_helper_spec.rb (100%) rename spec/{libraries => chef/cookbooks/package/libraries/helpers}/output_helper_spec.rb (94%) rename spec/chef/{ => cookbooks}/package/libraries/helpers/shell_out_helper_spec.rb (100%) rename spec/chef/{ => cookbooks}/package/libraries/omnibus_helper_spec.rb (100%) rename spec/chef/{secrets_spec.rb => cookbooks/package/libraries/secrets_helper_spec.rb} (100%) rename spec/chef/{ => cookbooks}/package/libraries/services_helper_spec.rb (100%) rename spec/{ => chef/cookbooks/package}/libraries/storage_directory_helper_spec.rb (100%) rename spec/{ => chef/cookbooks/package}/libraries/systemd_helper_spec.rb (91%) rename spec/chef/{ => cookbooks}/package/recipes/runit_spec.rb (100%) rename spec/chef/{ => cookbooks}/package/recipes/runit_systemd_spec.rb (100%) rename spec/chef/{ => cookbooks}/package/resources/account_spec.rb (100%) rename spec/chef/{ => cookbooks}/package/resources/env_dir_spec.rb (100%) rename spec/chef/{ => cookbooks}/package/resources/gitlab_sysctl_spec.rb (100%) rename spec/chef/{ => cookbooks}/package/resources/storage_directory_spec.rb (100%) rename spec/chef/{ => cookbooks}/package/resources/templatesymlink_spec.rb (100%) rename spec/chef/{ => cookbooks}/package/resources/version_file_spec.rb (100%) rename spec/chef/{ => cookbooks}/patroni/libraries/patroni_helper_spec.rb (100%) rename spec/chef/{ => cookbooks}/patroni/recipes/patroni_spec.rb (100%) rename spec/chef/{ => cookbooks}/pgbouncer/libraries/pgbouncer_helper_spec.rb (100%) rename spec/chef/{ => cookbooks}/pgbouncer/recipes/pgbouncer_spec.rb (100%) rename spec/chef/{ => cookbooks}/pgbouncer/recipes/pgbouncer_user_spec.rb (100%) rename spec/chef/{ => cookbooks/postgresql}/recipes/postgresql_spec.rb (100%) rename spec/chef/{ => cookbooks}/postgresql/recipes/sysctl_spec.rb (100%) rename spec/chef/{ => cookbooks}/postgresql/recipes/user_spec.rb (100%) rename spec/chef/{ => cookbooks}/postgresql/resources/config_spec.rb (100%) rename spec/chef/{ => cookbooks}/postgresql/resources/database_spec.rb (100%) rename spec/chef/{ => cookbooks}/postgresql/resources/extension_spec.rb (100%) rename spec/chef/{ => cookbooks}/postgresql/resources/query_spec.rb (100%) rename spec/chef/{ => cookbooks}/postgresql/resources/schema_spec.rb (100%) rename spec/chef/{ => cookbooks}/postgresql/resources/user_spec.rb (100%) rename spec/chef/{ => cookbooks/praefect}/recipes/praefect_spec.rb (100%) rename spec/chef/{redis => cookbooks/redis/recipes}/redis_spec.rb (100%) rename spec/chef/{ => cookbooks/registry}/recipes/registry_spec.rb (100%) rename spec/chef/{ => cookbooks}/spamcheck/recipes/spamcheck_spec.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/acme/attributes/default.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/acme/metadata.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/acme/resources/certificate.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/acme/resources/selfsigned.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_consul/metadata.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_consul/recipes/consul_service_address_port.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_consul/recipes/consul_service_delete.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_consul/recipes/consul_service_delete_no_reload.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_consul/recipes/consul_service_meta.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_consul/recipes/consul_service_socket.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_consul/recipes/reload_consul.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_crond/metadata.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_crond/recipes/crond_job_delete.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_crond/recipes/crond_job_minimal.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_gitlab/metadata.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_gitlab/recipes/puma_config_create.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_gitlab/recipes/puma_config_custom.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_gitlab/recipes/rails_migration_run.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_gitlab_ee/metadata.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_gitlab_ee/recipes/pgbouncer_user_create_geo.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_gitlab_ee/recipes/pgbouncer_user_create_rails.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_package/metadata.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_package/recipes/account_create.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_package/recipes/account_remove.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_package/recipes/env_dir_create.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_package/recipes/gitlab_sysctl_create.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_package/recipes/storage_directory_create.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_package/recipes/templatesymlink_create.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_package/recipes/templatesymlink_delete.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_package/recipes/version_file_create.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_package/templates/default/test-template.erb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_postgresql/metadata.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_postgresql/recipes/postgresql_config.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_postgresql/recipes/postgresql_database_create.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_postgresql/recipes/postgresql_database_create_with_options.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_postgresql/recipes/postgresql_extension_enable.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_postgresql/recipes/postgresql_query_run.rb (73%) rename spec/{ => chef}/fixtures/cookbooks/test_postgresql/recipes/postgresql_schema_create.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_create.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_options_superuser.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_options_unspecified.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_password_empty.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_password_md5.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_password_nil.rb (100%) rename spec/{ => chef}/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_password_unspecified.rb (100%) rename spec/{ => chef}/fixtures/fauxhai/ubuntu/16.04-docker.json (100%) rename spec/{ => chef}/fixtures/fauxhai/ubuntu/16.04-more-cpus.json (100%) rename spec/{ => chef}/fixtures/fauxhai/ubuntu/16.04-no-run-tmpfs.json (100%) rename spec/{ => chef}/fixtures/fauxhai/ubuntu/16.04.json (100%) rename spec/{ => chef}/fixtures/migration/failed-migration-status-file (100%) rename spec/{ => chef}/fixtures/migration/successful-migration-status-file (100%) rename spec/{ => chef}/gitlab-ctl-commands-ee/geo_replication_spec.rb (88%) rename spec/{ => chef}/gitlab-ctl-commands-ee/geo_spec.rb (93%) rename spec/{ => chef}/gitlab-ctl-commands-ee/lib/consul_spec.rb (100%) rename spec/{ => chef}/gitlab-ctl-commands-ee/lib/geo/pitr_file_spec.rb (100%) rename spec/{ => chef}/gitlab-ctl-commands-ee/lib/geo/promote_db_spec.rb (100%) rename spec/{ => chef}/gitlab-ctl-commands-ee/lib/geo/promote_spec.rb (99%) rename spec/{ => chef}/gitlab-ctl-commands-ee/lib/geo/promote_to_primary_node_spec.rb (100%) rename spec/{ => chef}/gitlab-ctl-commands-ee/lib/geo/promotion_preflight_checks_spec.rb (100%) rename spec/{ => chef}/gitlab-ctl-commands-ee/lib/geo/replication_process_spec.rb (100%) rename spec/{ => chef}/gitlab-ctl-commands-ee/lib/geo/replication_spec.rb (100%) rename spec/{ => chef}/gitlab-ctl-commands-ee/lib/geo/replication_toggle_command_spec.rb (100%) rename spec/{ => chef}/gitlab-ctl-commands-ee/lib/patroni_spec.rb (98%) rename spec/{ => chef}/gitlab-ctl-commands-ee/lib/pgbouncer_spec.rb (100%) rename spec/{ => chef}/gitlab-ctl-commands-ee/lib/postgresql/ee_spec.rb (100%) rename spec/{ => chef}/gitlab-ctl-commands-ee/promote_db_spec.rb (97%) rename spec/{ => chef}/gitlab-ctl-commands-ee/promote_to_primary_node_spec.rb (100%) rename spec/{ => chef}/gitlab-ctl-commands-ee/promotion_preflight_checks_spec.rb (96%) rename spec/{ => chef}/gitlab-ctl-commands-ee/replicate_geo_database_spec.rb (98%) rename spec/{ => chef}/gitlab-ctl-commands/gitlab_ctl_spec.rb (81%) rename spec/{ => chef}/gitlab-ctl-commands/lib/gitlab_ctl_backup_spec.rb (100%) rename spec/{ => chef}/gitlab-ctl-commands/lib/gitlab_ctl_pg_upgrade_spec.rb (100%) rename spec/{ => chef}/gitlab-ctl-commands/lib/postgresql/replication_spec.rb (100%) rename spec/{ => chef}/gitlab-ctl-commands/lib/postgresql_spec.rb (100%) rename spec/{ => chef}/gitlab-ctl-commands/lib/praefect_spec.rb (99%) rename spec/{ => chef}/gitlab-ctl-commands/lib/upgrade_check_spec.rb (100%) rename spec/{ => chef}/gitlab-ctl-commands/lib/util_spec.rb (100%) rename spec/{ => chef}/support/shared_context/ctl_shared_context.rb (77%) rename spec/{ => chef}/support/shared_context/gitlab_rails_shared_context.rb (100%) rename spec/{ => chef}/support/shared_context/object_store_shared_context.rb (100%) rename spec/{ => chef}/support/shared_examples/consul_service_name.rb (93%) rename spec/{ => chef}/support/shared_examples/geo_promotion_command_accepts_option_shared_examples.rb (100%) rename spec/{ => chef}/support/shared_examples/gitlab_geo_promotion_commands_shared_examples.rb (100%) rename spec/{ => chef}/support/shared_examples/gitlab_yml_object_storage_shared_examples.rb (93%) rename spec/{ => chef}/support/shared_examples/logrotate_config.rb (76%) rename spec/{ => chef}/support/shared_examples/registry_service.rb (98%) rename spec/{ => chef}/support/shared_examples/runit_service.rb (96%) rename spec/{ => chef}/support/shared_examples/yaml_check.rb (75%) diff --git a/.projections.json.example b/.projections.json.example index aa07b50f3..30ff9472c 100644 --- a/.projections.json.example +++ b/.projections.json.example @@ -7,5 +7,29 @@ "alternate": "lib/{}.rb", "type": "test", "dispatch": "bundle exec rspec {file}" + }, + "files/gitlab-cookbooks/*.rb" : { + "alternate": "spec/chef/cookbooks/{}_spec.rb", + "type": "source" + }, + "spec/chef/cookbooks/*_spec.rb": { + "alternate": "files/gitlab-cookbooks/{}.rb", + "type": "test" + }, + "files/gitlab-ctl-commands/*.rb" : { + "alternate": "spec/chef/gitlab-ctl-commands/{}_spec.rb", + "type": "source" + }, + "spec/chef/gitlab-ctl-commands/*_spec.rb": { + "alternate": "files/gitlab-ctl-commands/{}.rb", + "type": "test" + }, + "files/gitlab-ctl-commands-ee/*.rb" : { + "alternate": "spec/chef/gitlab-ctl-commands-ee/{}_spec.rb", + "type": "source" + }, + "spec/chef/gitlab-ctl-commands-ee/*_spec.rb": { + "alternate": "files/gitlab-ctl-commands-ee/{}.rb", + "type": "test" } } diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 8721fc547..58667cfa7 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -51,9 +51,9 @@ Layout/RescueEnsureAlignment: # Cop supports --auto-correct. Layout/SpaceAroundMethodCallOperator: Exclude: - - 'spec/chef/recipes/postgresql_spec.rb' - - 'spec/gitlab-ctl-commands-ee/lib/postgresql/ee_spec.rb' - - 'spec/libraries/logging_helper_spec.rb' + - 'spec/chef/cookbooks/postgresql/recipes/postgresql_spec.rb' + - 'spec/chef/gitlab-ctl-commands-ee/lib/postgresql/ee_spec.rb' + - 'spec/chef/cookbooks/package/libraries/helpers/logging_helper_spec.rb' # Offense count: 1 # Cop supports --auto-correct. @@ -66,12 +66,12 @@ Layout/SpaceBeforeFirstArg: Lint/ConstantDefinitionInBlock: Exclude: - 'files/gitlab-ctl-commands/upgrade.rb' - - 'spec/chef/secrets_spec.rb' - - 'spec/gitlab-ctl-commands/gitlab_ctl_spec.rb' + - 'spec/chef/cookbooks/package/libraries/secrets_helper_spec.rb' + - 'spec/chef/gitlab-ctl-commands/gitlab_ctl_spec.rb' - 'spec/lib/gitlab/build/image_spec.rb' - 'spec/lib/gitlab/tasks/qa_spec.rb' - - 'spec/support/shared_examples/geo_promotion_command_accepts_option_shared_examples.rb' - - 'spec/support/shared_examples/gitlab_geo_promotion_commands_shared_examples.rb' + - 'spec/chef/support/shared_examples/geo_promotion_command_accepts_option_shared_examples.rb' + - 'spec/chef/support/shared_examples/gitlab_geo_promotion_commands_shared_examples.rb' # Offense count: 1 # Cop supports --auto-correct. @@ -226,11 +226,11 @@ Style/GlobalStdStream: - 'files/gitlab-ctl-commands-ee/lib/geo/replication.rb' - 'files/gitlab-ctl-commands/lib/gitlab_ctl/util.rb' - 'lib/gitlab/build/trigger.rb' - - 'spec/gitlab-ctl-commands-ee/lib/geo/promote_to_primary_node_spec.rb' - - 'spec/gitlab-ctl-commands-ee/lib/geo/promotion_preflight_checks_spec.rb' - - 'spec/gitlab-ctl-commands-ee/lib/geo/replication_spec.rb' - - 'spec/gitlab-ctl-commands/lib/gitlab_ctl_backup_spec.rb' - - 'spec/gitlab-ctl-commands/lib/util_spec.rb' + - 'spec/chef/gitlab-ctl-commands-ee/lib/geo/promote_to_primary_node_spec.rb' + - 'spec/chef/gitlab-ctl-commands-ee/lib/geo/promotion_preflight_checks_spec.rb' + - 'spec/chef/gitlab-ctl-commands-ee/lib/geo/replication_spec.rb' + - 'spec/chef/gitlab-ctl-commands/lib/gitlab_ctl_backup_spec.rb' + - 'spec/chef/gitlab-ctl-commands/lib/util_spec.rb' # Offense count: 1 # Cop supports --auto-correct. @@ -311,15 +311,15 @@ Style/RedundantRegexpEscape: Exclude: - 'files/gitlab-cookbooks/gitlab/libraries/registry.rb' - 'files/gitlab-cookbooks/package/libraries/helpers/redhat_helper.rb' - - 'spec/chef/recipes/add_trusted_certs_spec.rb' - - 'spec/chef/recipes/gitlab-workhorse_spec.rb' - - 'spec/chef/recipes/mailroom_spec.rb' - - 'spec/chef/recipes/puma_spec.rb' - - 'spec/chef/recipes/registry_spec.rb' - - 'spec/chef/recipes/sidekiq_spec.rb' - - 'spec/chef/recipes/unicorn_spec.rb' + - 'spec/chef/cookbooks/gitlab/recipes/add_trusted_certs_spec.rb' + - 'spec/chef/cookbooks/gitlab/recipes/gitlab-workhorse_spec.rb' + - 'spec/chef/cookbooks/gitlab/recipes/mailroom_spec.rb' + - 'spec/chef/cookbooks/gitlab/recipes/puma_spec.rb' + - 'spec/chef/cookbooks/registry/recipes/registry_spec.rb' + - 'spec/chef/cookbooks/gitlab/recipes/sidekiq_spec.rb' + - 'spec/chef/cookbooks/gitlab/recipes/unicorn_spec.rb' - 'spec/chef_helper.rb' - - 'spec/gitlab-ctl-commands-ee/lib/geo/promote_to_primary_node_spec.rb' + - 'spec/chef/gitlab-ctl-commands-ee/lib/geo/promote_to_primary_node_spec.rb' # Offense count: 249 # Cop supports --auto-correct. diff --git a/spec/chef/consul/libraries/consul_helper_spec.rb b/spec/chef/cookbooks/consul/libraries/consul_helper_spec.rb similarity index 100% rename from spec/chef/consul/libraries/consul_helper_spec.rb rename to spec/chef/cookbooks/consul/libraries/consul_helper_spec.rb diff --git a/spec/chef/consul/libraries/failover_helper_spec.rb b/spec/chef/cookbooks/consul/libraries/failover_helper_spec.rb similarity index 100% rename from spec/chef/consul/libraries/failover_helper_spec.rb rename to spec/chef/cookbooks/consul/libraries/failover_helper_spec.rb diff --git a/spec/chef/consul/recipes/configure_services_spec.rb b/spec/chef/cookbooks/consul/recipes/configure_services_spec.rb similarity index 100% rename from spec/chef/consul/recipes/configure_services_spec.rb rename to spec/chef/cookbooks/consul/recipes/configure_services_spec.rb diff --git a/spec/chef/consul/recipes/consul_spec.rb b/spec/chef/cookbooks/consul/recipes/consul_spec.rb similarity index 100% rename from spec/chef/consul/recipes/consul_spec.rb rename to spec/chef/cookbooks/consul/recipes/consul_spec.rb diff --git a/spec/chef/consul/recipes/consul_watcher_spec.rb b/spec/chef/cookbooks/consul/recipes/consul_watcher_spec.rb similarity index 100% rename from spec/chef/consul/recipes/consul_watcher_spec.rb rename to spec/chef/cookbooks/consul/recipes/consul_watcher_spec.rb diff --git a/spec/chef/consul/recipes/disable_service_postgresql_spec.rb b/spec/chef/cookbooks/consul/recipes/disable_service_postgresql_spec.rb similarity index 100% rename from spec/chef/consul/recipes/disable_service_postgresql_spec.rb rename to spec/chef/cookbooks/consul/recipes/disable_service_postgresql_spec.rb diff --git a/spec/chef/consul/recipes/enable_service_postgresq_spec.rb b/spec/chef/cookbooks/consul/recipes/enable_service_postgresq_spec.rb similarity index 100% rename from spec/chef/consul/recipes/enable_service_postgresq_spec.rb rename to spec/chef/cookbooks/consul/recipes/enable_service_postgresq_spec.rb diff --git a/spec/chef/consul/resources/consul_service_spec.rb b/spec/chef/cookbooks/consul/resources/consul_service_spec.rb similarity index 100% rename from spec/chef/consul/resources/consul_service_spec.rb rename to spec/chef/cookbooks/consul/resources/consul_service_spec.rb diff --git a/spec/chef/recipes/crond_enable_spec.rb b/spec/chef/cookbooks/crond/recipes/crond_enable_spec.rb similarity index 100% rename from spec/chef/recipes/crond_enable_spec.rb rename to spec/chef/cookbooks/crond/recipes/crond_enable_spec.rb diff --git a/spec/chef/crond/resources/crond_job_spec.rb b/spec/chef/cookbooks/crond/resources/crond_job_spec.rb similarity index 100% rename from spec/chef/crond/resources/crond_job_spec.rb rename to spec/chef/cookbooks/crond/resources/crond_job_spec.rb diff --git a/spec/libraries/gitaly_spec.rb b/spec/chef/cookbooks/gitaly/libraries/gitaly_spec.rb similarity index 100% rename from spec/libraries/gitaly_spec.rb rename to spec/chef/cookbooks/gitaly/libraries/gitaly_spec.rb diff --git a/spec/chef/recipes/gitaly_spec.rb b/spec/chef/cookbooks/gitaly/recipes/gitaly_spec.rb similarity index 100% rename from spec/chef/recipes/gitaly_spec.rb rename to spec/chef/cookbooks/gitaly/recipes/gitaly_spec.rb diff --git a/spec/chef/gitlab-ee/libraries/gitlab_geo_helper_spec.rb b/spec/chef/cookbooks/gitlab-ee/libraries/gitlab_geo_helper_spec.rb similarity index 94% rename from spec/chef/gitlab-ee/libraries/gitlab_geo_helper_spec.rb rename to spec/chef/cookbooks/gitlab-ee/libraries/gitlab_geo_helper_spec.rb index b99854614..c9d28abb9 100644 --- a/spec/chef/gitlab-ee/libraries/gitlab_geo_helper_spec.rb +++ b/spec/chef/cookbooks/gitlab-ee/libraries/gitlab_geo_helper_spec.rb @@ -1,4 +1,3 @@ -require_relative '../../../../files/gitlab-cookbooks/gitlab-ee/libraries/gitlab_geo_helper.rb' require 'chef_helper' RSpec.describe GitlabGeoHelper do diff --git a/spec/libraries/sentinel_helper_spec.rb b/spec/chef/cookbooks/gitlab-ee/libraries/sentinel_helper_spec.rb similarity index 100% rename from spec/libraries/sentinel_helper_spec.rb rename to spec/chef/cookbooks/gitlab-ee/libraries/sentinel_helper_spec.rb diff --git a/spec/libraries/sentinel_spec.rb b/spec/chef/cookbooks/gitlab-ee/libraries/sentinel_spec.rb similarity index 100% rename from spec/libraries/sentinel_spec.rb rename to spec/chef/cookbooks/gitlab-ee/libraries/sentinel_spec.rb diff --git a/spec/chef/gitlab-ee/recipes/default_spec.rb b/spec/chef/cookbooks/gitlab-ee/recipes/default_spec.rb similarity index 100% rename from spec/chef/gitlab-ee/recipes/default_spec.rb rename to spec/chef/cookbooks/gitlab-ee/recipes/default_spec.rb diff --git a/spec/chef/gitlab-ee/recipes/geo-logcursor_spec.rb b/spec/chef/cookbooks/gitlab-ee/recipes/geo-logcursor_spec.rb similarity index 100% rename from spec/chef/gitlab-ee/recipes/geo-logcursor_spec.rb rename to spec/chef/cookbooks/gitlab-ee/recipes/geo-logcursor_spec.rb diff --git a/spec/chef/gitlab-ee/recipes/geo-postgresql_spec.rb b/spec/chef/cookbooks/gitlab-ee/recipes/geo-postgresql_spec.rb similarity index 100% rename from spec/chef/gitlab-ee/recipes/geo-postgresql_spec.rb rename to spec/chef/cookbooks/gitlab-ee/recipes/geo-postgresql_spec.rb diff --git a/spec/chef/gitlab-ee/recipes/geo-secondary_disable_spec.rb b/spec/chef/cookbooks/gitlab-ee/recipes/geo-secondary_disable_spec.rb similarity index 100% rename from spec/chef/gitlab-ee/recipes/geo-secondary_disable_spec.rb rename to spec/chef/cookbooks/gitlab-ee/recipes/geo-secondary_disable_spec.rb diff --git a/spec/chef/gitlab-ee/recipes/geo-secondary_spec.rb b/spec/chef/cookbooks/gitlab-ee/recipes/geo-secondary_spec.rb similarity index 100% rename from spec/chef/gitlab-ee/recipes/geo-secondary_spec.rb rename to spec/chef/cookbooks/gitlab-ee/recipes/geo-secondary_spec.rb diff --git a/spec/chef/gitlab-ee/recipes/geo_database_migrations_spec.rb b/spec/chef/cookbooks/gitlab-ee/recipes/geo_database_migrations_spec.rb similarity index 100% rename from spec/chef/gitlab-ee/recipes/geo_database_migrations_spec.rb rename to spec/chef/cookbooks/gitlab-ee/recipes/geo_database_migrations_spec.rb diff --git a/spec/chef/gitlab-ee/recipes/geo_spec.rb b/spec/chef/cookbooks/gitlab-ee/recipes/geo_spec.rb similarity index 100% rename from spec/chef/gitlab-ee/recipes/geo_spec.rb rename to spec/chef/cookbooks/gitlab-ee/recipes/geo_spec.rb diff --git a/spec/chef/gitlab-ee/recipes/sentinel_spec.rb b/spec/chef/cookbooks/gitlab-ee/recipes/sentinel_spec.rb similarity index 100% rename from spec/chef/gitlab-ee/recipes/sentinel_spec.rb rename to spec/chef/cookbooks/gitlab-ee/recipes/sentinel_spec.rb diff --git a/spec/chef/gitlab-ee/resources/pgbouncer_user_spec.rb b/spec/chef/cookbooks/gitlab-ee/resources/pgbouncer_user_spec.rb similarity index 100% rename from spec/chef/gitlab-ee/resources/pgbouncer_user_spec.rb rename to spec/chef/cookbooks/gitlab-ee/resources/pgbouncer_user_spec.rb diff --git a/spec/chef/recipes/gitlab-kas_spec.rb b/spec/chef/cookbooks/gitlab-kas/recipes/gitlab-kas_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-kas_spec.rb rename to spec/chef/cookbooks/gitlab-kas/recipes/gitlab-kas_spec.rb diff --git a/spec/chef/gitlab-pages/recipes/gitlab-pages_spec.rb b/spec/chef/cookbooks/gitlab-pages/recipes/gitlab-pages_spec.rb similarity index 100% rename from spec/chef/gitlab-pages/recipes/gitlab-pages_spec.rb rename to spec/chef/cookbooks/gitlab-pages/recipes/gitlab-pages_spec.rb diff --git a/spec/chef/gitlab/libraries/account_helper_spec.rb b/spec/chef/cookbooks/gitlab/libraries/account_helper_spec.rb similarity index 100% rename from spec/chef/gitlab/libraries/account_helper_spec.rb rename to spec/chef/cookbooks/gitlab/libraries/account_helper_spec.rb diff --git a/spec/libraries/helpers/base_pg_helper_spec.rb b/spec/chef/cookbooks/gitlab/libraries/helpers/base_pg_helper_spec.rb similarity index 100% rename from spec/libraries/helpers/base_pg_helper_spec.rb rename to spec/chef/cookbooks/gitlab/libraries/helpers/base_pg_helper_spec.rb diff --git a/spec/libraries/helpers/gitlab_workhorse_helper_spec.rb b/spec/chef/cookbooks/gitlab/libraries/helpers/gitlab_workhorse_helper_spec.rb similarity index 100% rename from spec/libraries/helpers/gitlab_workhorse_helper_spec.rb rename to spec/chef/cookbooks/gitlab/libraries/helpers/gitlab_workhorse_helper_spec.rb diff --git a/spec/libraries/helper_spec.rb b/spec/chef/cookbooks/gitlab/libraries/helpers/helper_spec.rb similarity index 100% rename from spec/libraries/helper_spec.rb rename to spec/chef/cookbooks/gitlab/libraries/helpers/helper_spec.rb diff --git a/spec/libraries/helpers/pg_status_helper_spec.rb b/spec/chef/cookbooks/gitlab/libraries/helpers/pg_status_helper_spec.rb similarity index 100% rename from spec/libraries/helpers/pg_status_helper_spec.rb rename to spec/chef/cookbooks/gitlab/libraries/helpers/pg_status_helper_spec.rb diff --git a/spec/libraries/pg_version_spec.rb b/spec/chef/cookbooks/gitlab/libraries/pg_version_spec.rb similarity index 100% rename from spec/libraries/pg_version_spec.rb rename to spec/chef/cookbooks/gitlab/libraries/pg_version_spec.rb diff --git a/spec/chef/gitlab/libraries/rails_migration_helper_spec.rb b/spec/chef/cookbooks/gitlab/libraries/rails_migration_helper_spec.rb similarity index 100% rename from spec/chef/gitlab/libraries/rails_migration_helper_spec.rb rename to spec/chef/cookbooks/gitlab/libraries/rails_migration_helper_spec.rb diff --git a/spec/libraries/redis_helper_spec.rb b/spec/chef/cookbooks/gitlab/libraries/redis_helper_spec.rb similarity index 100% rename from spec/libraries/redis_helper_spec.rb rename to spec/chef/cookbooks/gitlab/libraries/redis_helper_spec.rb diff --git a/spec/libraries/redis_spec.rb b/spec/chef/cookbooks/gitlab/libraries/redis_spec.rb similarity index 100% rename from spec/libraries/redis_spec.rb rename to spec/chef/cookbooks/gitlab/libraries/redis_spec.rb diff --git a/spec/libraries/redis_uri_spec.rb b/spec/chef/cookbooks/gitlab/libraries/redis_uri_spec.rb similarity index 96% rename from spec/libraries/redis_uri_spec.rb rename to spec/chef/cookbooks/gitlab/libraries/redis_uri_spec.rb index 50a7e5c74..59e1c7c62 100644 --- a/spec/libraries/redis_uri_spec.rb +++ b/spec/chef/cookbooks/gitlab/libraries/redis_uri_spec.rb @@ -2,7 +2,6 @@ # are the ones we expect require 'spec_helper' -require_relative '../../files/gitlab-cookbooks/gitlab/libraries/redis_uri.rb' RSpec.describe URI::Redis do subject { URI('redis://localhost') } diff --git a/spec/libraries/registry_spec.rb b/spec/chef/cookbooks/gitlab/libraries/registry_spec.rb similarity index 93% rename from spec/libraries/registry_spec.rb rename to spec/chef/cookbooks/gitlab/libraries/registry_spec.rb index 869b77ee4..03b46c5bf 100644 --- a/spec/libraries/registry_spec.rb +++ b/spec/chef/cookbooks/gitlab/libraries/registry_spec.rb @@ -1,5 +1,4 @@ require 'chef_helper' -require_relative '../../files/gitlab-cookbooks/gitlab/libraries/registry' RSpec.describe Registry do before do diff --git a/spec/libraries/workhorse_spec.rb b/spec/chef/cookbooks/gitlab/libraries/workhorse_spec.rb similarity index 100% rename from spec/libraries/workhorse_spec.rb rename to spec/chef/cookbooks/gitlab/libraries/workhorse_spec.rb diff --git a/spec/chef/recipes/add_trusted_certs_spec.rb b/spec/chef/cookbooks/gitlab/recipes/add_trusted_certs_spec.rb similarity index 100% rename from spec/chef/recipes/add_trusted_certs_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/add_trusted_certs_spec.rb diff --git a/spec/chef/recipes/config_spec.rb b/spec/chef/cookbooks/gitlab/recipes/config_spec.rb similarity index 100% rename from spec/chef/recipes/config_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/config_spec.rb diff --git a/spec/chef/recipes/database_migrations_spec.rb b/spec/chef/cookbooks/gitlab/recipes/database_migrations_spec.rb similarity index 100% rename from spec/chef/recipes/database_migrations_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/database_migrations_spec.rb diff --git a/spec/chef/recipes/database_reindexing_disable_spec.rb b/spec/chef/cookbooks/gitlab/recipes/database_reindexing_disable_spec.rb similarity index 100% rename from spec/chef/recipes/database_reindexing_disable_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/database_reindexing_disable_spec.rb diff --git a/spec/chef/recipes/database_reindexing_enable_spec.rb b/spec/chef/cookbooks/gitlab/recipes/database_reindexing_enable_spec.rb similarity index 100% rename from spec/chef/recipes/database_reindexing_enable_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/database_reindexing_enable_spec.rb diff --git a/spec/chef/recipes/default_spec.rb b/spec/chef/cookbooks/gitlab/recipes/default_spec.rb similarity index 100% rename from spec/chef/recipes/default_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/default_spec.rb diff --git a/spec/chef/recipes/gitlab-healthcheck_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-healthcheck_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-healthcheck_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-healthcheck_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/database_yml_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/database_yml_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/database_yml_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/database_yml_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/backup_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/backup_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/backup_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/backup_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/consul_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/consul_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/consul_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/consul_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/cron_jobs_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/cron_jobs_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/cron_jobs_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/cron_jobs_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/extra_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/extra_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/extra_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/extra_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/forti_authenticator_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/forti_authenticator_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/forti_authenticator_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/forti_authenticator_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/forti_token_cloud_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/forti_token_cloud_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/forti_token_cloud_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/forti_token_cloud_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/geo_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/geo_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/geo_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/geo_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/gitaly_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/gitaly_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/gitaly_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/gitaly_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/gitlab_shell_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/gitlab_shell_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/gitlab_shell_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/gitlab_shell_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/gitlab_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/gitlab_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/gitlab_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/gitlab_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/incoming_email_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/incoming_email_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/incoming_email_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/incoming_email_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/ldap_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/ldap_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/ldap_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/ldap_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/mattermost_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/mattermost_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/mattermost_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/mattermost_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/monitoring_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/monitoring_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/monitoring_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/monitoring_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/object_storage_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/object_storage_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/object_storage_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/object_storage_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/omniauth_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/omniauth_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/omniauth_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/omniauth_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/pages_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/pages_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/pages_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/pages_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/prometheus_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/prometheus_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/prometheus_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/prometheus_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/pseudonymizer_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/pseudonymizer_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/pseudonymizer_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/pseudonymizer_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/registry_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/registry_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/registry_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/registry_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/repositories_storages_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/repositories_storages_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/repositories_storages_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/repositories_storages_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/sentry_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/sentry_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/sentry_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/sentry_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/service_desk_email_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/service_desk_email_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/service_desk_email_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/service_desk_email_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/shutdown_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/shutdown_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/shutdown_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/shutdown_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/sidekiq_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/sidekiq_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/sidekiq_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/sidekiq_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/smartcard_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/smartcard_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/smartcard_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/smartcard_spec.rb diff --git a/spec/chef/recipes/gitlab-rails/gitlab_yml/unleash_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/unleash_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails/gitlab_yml/unleash_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/unleash_spec.rb diff --git a/spec/chef/recipes/gitlab-rails_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-rails_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-rails_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-rails_spec.rb diff --git a/spec/chef/recipes/gitlab-shell_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-shell_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-shell_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-shell_spec.rb diff --git a/spec/chef/recipes/gitlab-workhorse_spec.rb b/spec/chef/cookbooks/gitlab/recipes/gitlab-workhorse_spec.rb similarity index 100% rename from spec/chef/recipes/gitlab-workhorse_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/gitlab-workhorse_spec.rb diff --git a/spec/chef/recipes/mailroom_spec.rb b/spec/chef/cookbooks/gitlab/recipes/mailroom_spec.rb similarity index 100% rename from spec/chef/recipes/mailroom_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/mailroom_spec.rb diff --git a/spec/chef/recipes/nginx_spec.rb b/spec/chef/cookbooks/gitlab/recipes/nginx_spec.rb similarity index 100% rename from spec/chef/recipes/nginx_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/nginx_spec.rb diff --git a/spec/chef/recipes/puma_spec.rb b/spec/chef/cookbooks/gitlab/recipes/puma_spec.rb similarity index 96% rename from spec/chef/recipes/puma_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/puma_spec.rb index 4e42f157a..42685461f 100644 --- a/spec/chef/recipes/puma_spec.rb +++ b/spec/chef/cookbooks/gitlab/recipes/puma_spec.rb @@ -4,7 +4,7 @@ RSpec.describe 'gitlab::puma with Ubuntu 16.04' do let(:chef_run) do runner = ChefSpec::SoloRunner.new( step_into: %w(runit_service puma_config), - path: 'spec/fixtures/fauxhai/ubuntu/16.04.json' + path: 'spec/chef/fixtures/fauxhai/ubuntu/16.04.json' ) runner.converge('gitlab::default') end @@ -182,7 +182,7 @@ end RSpec.describe 'gitlab::puma Ubuntu 16.04 with no tmpfs' do let(:chef_run) do runner = ChefSpec::SoloRunner.new( - path: 'spec/fixtures/fauxhai/ubuntu/16.04-no-run-tmpfs.json', + path: 'spec/chef/fixtures/fauxhai/ubuntu/16.04-no-run-tmpfs.json', step_into: %w(runit_service) ) runner.converge('gitlab::default') @@ -208,7 +208,7 @@ end RSpec.describe 'gitlab::puma Ubuntu 16.04 Docker' do let(:chef_run) do runner = ChefSpec::SoloRunner.new( - path: 'spec/fixtures/fauxhai/ubuntu/16.04-docker.json', + path: 'spec/chef/fixtures/fauxhai/ubuntu/16.04-docker.json', step_into: %w(runit_service) ) runner.converge('gitlab::default') @@ -235,7 +235,7 @@ RSpec.describe 'gitlab::puma with more CPUs' do let(:chef_run) do runner = ChefSpec::SoloRunner.new( step_into: %w(runit_service), - path: 'spec/fixtures/fauxhai/ubuntu/16.04-more-cpus.json' + path: 'spec/chef/fixtures/fauxhai/ubuntu/16.04-more-cpus.json' ) runner.converge('gitlab::default') end diff --git a/spec/chef/recipes/rails_cache_clear_spec.rb b/spec/chef/cookbooks/gitlab/recipes/rails_cache_clear_spec.rb similarity index 100% rename from spec/chef/recipes/rails_cache_clear_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/rails_cache_clear_spec.rb diff --git a/spec/chef/recipes/remote-syslog_spec.rb b/spec/chef/cookbooks/gitlab/recipes/remote-syslog_spec.rb similarity index 100% rename from spec/chef/recipes/remote-syslog_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/remote-syslog_spec.rb diff --git a/spec/chef/recipes/selinux_spec.rb b/spec/chef/cookbooks/gitlab/recipes/selinux_spec.rb similarity index 100% rename from spec/chef/recipes/selinux_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/selinux_spec.rb diff --git a/spec/chef/gitlab/recipes/show_config_spec.rb b/spec/chef/cookbooks/gitlab/recipes/show_config_spec.rb similarity index 100% rename from spec/chef/gitlab/recipes/show_config_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/show_config_spec.rb diff --git a/spec/chef/recipes/sidekiq_spec.rb b/spec/chef/cookbooks/gitlab/recipes/sidekiq_spec.rb similarity index 96% rename from spec/chef/recipes/sidekiq_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/sidekiq_spec.rb index 639255ff2..93b722518 100644 --- a/spec/chef/recipes/sidekiq_spec.rb +++ b/spec/chef/cookbooks/gitlab/recipes/sidekiq_spec.rb @@ -4,7 +4,7 @@ RSpec.describe 'gitlab::sidekiq' do let(:chef_run) do runner = ChefSpec::SoloRunner.new( step_into: %w(sidekiq_service runit_service), - path: 'spec/fixtures/fauxhai/ubuntu/16.04.json' + path: 'spec/chef/fixtures/fauxhai/ubuntu/16.04.json' ) runner.converge('gitlab::default') end diff --git a/spec/chef/recipes/storage-check_spec.rb b/spec/chef/cookbooks/gitlab/recipes/storage-check_spec.rb similarity index 100% rename from spec/chef/recipes/storage-check_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/storage-check_spec.rb diff --git a/spec/chef/recipes/users_spec.rb b/spec/chef/cookbooks/gitlab/recipes/users_spec.rb similarity index 100% rename from spec/chef/recipes/users_spec.rb rename to spec/chef/cookbooks/gitlab/recipes/users_spec.rb diff --git a/spec/chef/gitlab/resources/puma_config_spec.rb b/spec/chef/cookbooks/gitlab/resources/puma_config_spec.rb similarity index 100% rename from spec/chef/gitlab/resources/puma_config_spec.rb rename to spec/chef/cookbooks/gitlab/resources/puma_config_spec.rb diff --git a/spec/chef/gitlab/resources/rails_migration_spec.rb b/spec/chef/cookbooks/gitlab/resources/rails_migration_spec.rb similarity index 100% rename from spec/chef/gitlab/resources/rails_migration_spec.rb rename to spec/chef/cookbooks/gitlab/resources/rails_migration_spec.rb diff --git a/spec/libraries/lets_encrypt_spec.rb b/spec/chef/cookbooks/letsencrypt/libraries/lets_encrypt_spec.rb similarity index 100% rename from spec/libraries/lets_encrypt_spec.rb rename to spec/chef/cookbooks/letsencrypt/libraries/lets_encrypt_spec.rb diff --git a/spec/chef/recipes/letsencrypt_spec.rb b/spec/chef/cookbooks/letsencrypt/recipes/letsencrypt_spec.rb similarity index 100% rename from spec/chef/recipes/letsencrypt_spec.rb rename to spec/chef/cookbooks/letsencrypt/recipes/letsencrypt_spec.rb diff --git a/spec/chef/letsencrypt/resources/letsencrypt_certificate_spec.rb b/spec/chef/cookbooks/letsencrypt/resources/letsencrypt_certificate_spec.rb similarity index 100% rename from spec/chef/letsencrypt/resources/letsencrypt_certificate_spec.rb rename to spec/chef/cookbooks/letsencrypt/resources/letsencrypt_certificate_spec.rb diff --git a/spec/chef/logrotate/recipes/folders_and_configs_spec.rb b/spec/chef/cookbooks/logrotate/recipes/folders_and_configs_spec.rb similarity index 100% rename from spec/chef/logrotate/recipes/folders_and_configs_spec.rb rename to spec/chef/cookbooks/logrotate/recipes/folders_and_configs_spec.rb diff --git a/spec/chef/logrotate/recipes/logrotate_spec.rb b/spec/chef/cookbooks/logrotate/recipes/logrotate_spec.rb similarity index 100% rename from spec/chef/logrotate/recipes/logrotate_spec.rb rename to spec/chef/cookbooks/logrotate/recipes/logrotate_spec.rb diff --git a/spec/chef/recipes/mattermost_spec.rb b/spec/chef/cookbooks/mattermost/recipes/mattermost_spec.rb similarity index 100% rename from spec/chef/recipes/mattermost_spec.rb rename to spec/chef/cookbooks/mattermost/recipes/mattermost_spec.rb diff --git a/spec/chef/monitoring/libraries/prometheus_helper_spec.rb b/spec/chef/cookbooks/monitoring/libraries/prometheus_helper_spec.rb similarity index 100% rename from spec/chef/monitoring/libraries/prometheus_helper_spec.rb rename to spec/chef/cookbooks/monitoring/libraries/prometheus_helper_spec.rb diff --git a/spec/chef/monitoring/libraries/prometheus_spec.rb b/spec/chef/cookbooks/monitoring/libraries/prometheus_spec.rb similarity index 100% rename from spec/chef/monitoring/libraries/prometheus_spec.rb rename to spec/chef/cookbooks/monitoring/libraries/prometheus_spec.rb diff --git a/spec/chef/monitoring/recipes/alertmanager_spec.rb b/spec/chef/cookbooks/monitoring/recipes/alertmanager_spec.rb similarity index 100% rename from spec/chef/monitoring/recipes/alertmanager_spec.rb rename to spec/chef/cookbooks/monitoring/recipes/alertmanager_spec.rb diff --git a/spec/chef/monitoring/recipes/gitlab-exporter_spec.rb b/spec/chef/cookbooks/monitoring/recipes/gitlab-exporter_spec.rb similarity index 100% rename from spec/chef/monitoring/recipes/gitlab-exporter_spec.rb rename to spec/chef/cookbooks/monitoring/recipes/gitlab-exporter_spec.rb diff --git a/spec/chef/monitoring/recipes/grafana_spec.rb b/spec/chef/cookbooks/monitoring/recipes/grafana_spec.rb similarity index 100% rename from spec/chef/monitoring/recipes/grafana_spec.rb rename to spec/chef/cookbooks/monitoring/recipes/grafana_spec.rb diff --git a/spec/chef/monitoring/recipes/node-exporter_spec.rb b/spec/chef/cookbooks/monitoring/recipes/node-exporter_spec.rb similarity index 100% rename from spec/chef/monitoring/recipes/node-exporter_spec.rb rename to spec/chef/cookbooks/monitoring/recipes/node-exporter_spec.rb diff --git a/spec/chef/monitoring/recipes/pgbouncer-exporter_spec.rb b/spec/chef/cookbooks/monitoring/recipes/pgbouncer-exporter_spec.rb similarity index 100% rename from spec/chef/monitoring/recipes/pgbouncer-exporter_spec.rb rename to spec/chef/cookbooks/monitoring/recipes/pgbouncer-exporter_spec.rb diff --git a/spec/chef/monitoring/recipes/postgres_exporter_spec.rb b/spec/chef/cookbooks/monitoring/recipes/postgres_exporter_spec.rb similarity index 100% rename from spec/chef/monitoring/recipes/postgres_exporter_spec.rb rename to spec/chef/cookbooks/monitoring/recipes/postgres_exporter_spec.rb diff --git a/spec/chef/monitoring/recipes/prometheus_spec.rb b/spec/chef/cookbooks/monitoring/recipes/prometheus_spec.rb similarity index 100% rename from spec/chef/monitoring/recipes/prometheus_spec.rb rename to spec/chef/cookbooks/monitoring/recipes/prometheus_spec.rb diff --git a/spec/chef/monitoring/recipes/redis_exporter_spec.rb b/spec/chef/cookbooks/monitoring/recipes/redis_exporter_spec.rb similarity index 100% rename from spec/chef/monitoring/recipes/redis_exporter_spec.rb rename to spec/chef/cookbooks/monitoring/recipes/redis_exporter_spec.rb diff --git a/spec/libraries/gitlab_spec.rb b/spec/chef/cookbooks/package/libraries/config/gitlab_spec.rb similarity index 97% rename from spec/libraries/gitlab_spec.rb rename to spec/chef/cookbooks/package/libraries/config/gitlab_spec.rb index 3fa5a7672..852f26df2 100644 --- a/spec/libraries/gitlab_spec.rb +++ b/spec/chef/cookbooks/package/libraries/config/gitlab_spec.rb @@ -1,5 +1,4 @@ require 'spec_helper' -require_relative '../../files/gitlab-cookbooks/package/libraries/config/gitlab' RSpec.describe Gitlab do context 'when using an attribute_block' do diff --git a/spec/libraries/roles_spec.rb b/spec/chef/cookbooks/package/libraries/config/roles_spec.rb similarity index 100% rename from spec/libraries/roles_spec.rb rename to spec/chef/cookbooks/package/libraries/config/roles_spec.rb diff --git a/spec/libraries/services_spec.rb b/spec/chef/cookbooks/package/libraries/config/services_spec.rb similarity index 100% rename from spec/libraries/services_spec.rb rename to spec/chef/cookbooks/package/libraries/config/services_spec.rb diff --git a/spec/libraries/config_mash_spec.rb b/spec/chef/cookbooks/package/libraries/config_mash_spec.rb similarity index 96% rename from spec/libraries/config_mash_spec.rb rename to spec/chef/cookbooks/package/libraries/config_mash_spec.rb index a884f9a2f..da810f467 100644 --- a/spec/libraries/config_mash_spec.rb +++ b/spec/chef/cookbooks/package/libraries/config_mash_spec.rb @@ -1,5 +1,4 @@ require 'spec_helper' -require_relative '../../files/gitlab-cookbooks/package/libraries/config_mash' RSpec.describe Gitlab::ConfigMash do subject(:mash) { described_class.new } diff --git a/spec/libraries/deprecations_spec.rb b/spec/chef/cookbooks/package/libraries/deprecations_spec.rb similarity index 99% rename from spec/libraries/deprecations_spec.rb rename to spec/chef/cookbooks/package/libraries/deprecations_spec.rb index 2e9656c68..870d530b0 100644 --- a/spec/libraries/deprecations_spec.rb +++ b/spec/chef/cookbooks/package/libraries/deprecations_spec.rb @@ -1,5 +1,4 @@ require 'spec_helper' -require_relative '../../files/gitlab-cookbooks/package/libraries/deprecations' RSpec.describe Gitlab::Deprecations do let(:valid_config) { { gitlab: { nginx: { listen_addresses: "SomeRandomString" } } } } diff --git a/spec/libraries/helpers/gitlab_cluster_spec.rb b/spec/chef/cookbooks/package/libraries/gitlab_cluster_spec.rb similarity index 98% rename from spec/libraries/helpers/gitlab_cluster_spec.rb rename to spec/chef/cookbooks/package/libraries/gitlab_cluster_spec.rb index 937ec3ea4..377eb64e7 100644 --- a/spec/libraries/helpers/gitlab_cluster_spec.rb +++ b/spec/chef/cookbooks/package/libraries/gitlab_cluster_spec.rb @@ -1,5 +1,4 @@ require 'spec_helper' -require_relative '../../../files/gitlab-cookbooks/package/libraries/gitlab_cluster' RSpec.describe GitlabCluster, :cluster_config do let(:gitlab_cluster_config_path) { described_class::JSON_FILE } diff --git a/spec/libraries/logging_helper_spec.rb b/spec/chef/cookbooks/package/libraries/helpers/logging_helper_spec.rb similarity index 100% rename from spec/libraries/logging_helper_spec.rb rename to spec/chef/cookbooks/package/libraries/helpers/logging_helper_spec.rb diff --git a/spec/chef/package/libraries/helpers/node_helper_spec.rb b/spec/chef/cookbooks/package/libraries/helpers/node_helper_spec.rb similarity index 100% rename from spec/chef/package/libraries/helpers/node_helper_spec.rb rename to spec/chef/cookbooks/package/libraries/helpers/node_helper_spec.rb diff --git a/spec/libraries/output_helper_spec.rb b/spec/chef/cookbooks/package/libraries/helpers/output_helper_spec.rb similarity index 94% rename from spec/libraries/output_helper_spec.rb rename to spec/chef/cookbooks/package/libraries/helpers/output_helper_spec.rb index 4282c9bb5..369743954 100644 --- a/spec/libraries/output_helper_spec.rb +++ b/spec/chef/cookbooks/package/libraries/helpers/output_helper_spec.rb @@ -1,5 +1,4 @@ require 'spec_helper' -require_relative '../../files/gitlab-cookbooks/package/libraries/helpers/output_helper' RSpec.describe OutputHelper do include OutputHelper diff --git a/spec/chef/package/libraries/helpers/shell_out_helper_spec.rb b/spec/chef/cookbooks/package/libraries/helpers/shell_out_helper_spec.rb similarity index 100% rename from spec/chef/package/libraries/helpers/shell_out_helper_spec.rb rename to spec/chef/cookbooks/package/libraries/helpers/shell_out_helper_spec.rb diff --git a/spec/chef/package/libraries/omnibus_helper_spec.rb b/spec/chef/cookbooks/package/libraries/omnibus_helper_spec.rb similarity index 100% rename from spec/chef/package/libraries/omnibus_helper_spec.rb rename to spec/chef/cookbooks/package/libraries/omnibus_helper_spec.rb diff --git a/spec/chef/secrets_spec.rb b/spec/chef/cookbooks/package/libraries/secrets_helper_spec.rb similarity index 100% rename from spec/chef/secrets_spec.rb rename to spec/chef/cookbooks/package/libraries/secrets_helper_spec.rb diff --git a/spec/chef/package/libraries/services_helper_spec.rb b/spec/chef/cookbooks/package/libraries/services_helper_spec.rb similarity index 100% rename from spec/chef/package/libraries/services_helper_spec.rb rename to spec/chef/cookbooks/package/libraries/services_helper_spec.rb diff --git a/spec/libraries/storage_directory_helper_spec.rb b/spec/chef/cookbooks/package/libraries/storage_directory_helper_spec.rb similarity index 100% rename from spec/libraries/storage_directory_helper_spec.rb rename to spec/chef/cookbooks/package/libraries/storage_directory_helper_spec.rb diff --git a/spec/libraries/systemd_helper_spec.rb b/spec/chef/cookbooks/package/libraries/systemd_helper_spec.rb similarity index 91% rename from spec/libraries/systemd_helper_spec.rb rename to spec/chef/cookbooks/package/libraries/systemd_helper_spec.rb index b784c2cc1..51d8fe897 100644 --- a/spec/libraries/systemd_helper_spec.rb +++ b/spec/chef/cookbooks/package/libraries/systemd_helper_spec.rb @@ -1,5 +1,4 @@ require 'spec_helper' -require_relative '../../files/gitlab-cookbooks/package/libraries/helpers/systemd_helper' RSpec.describe SystemdHelper do describe '#systemd_version' do diff --git a/spec/chef/package/recipes/runit_spec.rb b/spec/chef/cookbooks/package/recipes/runit_spec.rb similarity index 100% rename from spec/chef/package/recipes/runit_spec.rb rename to spec/chef/cookbooks/package/recipes/runit_spec.rb diff --git a/spec/chef/package/recipes/runit_systemd_spec.rb b/spec/chef/cookbooks/package/recipes/runit_systemd_spec.rb similarity index 100% rename from spec/chef/package/recipes/runit_systemd_spec.rb rename to spec/chef/cookbooks/package/recipes/runit_systemd_spec.rb diff --git a/spec/chef/package/resources/account_spec.rb b/spec/chef/cookbooks/package/resources/account_spec.rb similarity index 100% rename from spec/chef/package/resources/account_spec.rb rename to spec/chef/cookbooks/package/resources/account_spec.rb diff --git a/spec/chef/package/resources/env_dir_spec.rb b/spec/chef/cookbooks/package/resources/env_dir_spec.rb similarity index 100% rename from spec/chef/package/resources/env_dir_spec.rb rename to spec/chef/cookbooks/package/resources/env_dir_spec.rb diff --git a/spec/chef/package/resources/gitlab_sysctl_spec.rb b/spec/chef/cookbooks/package/resources/gitlab_sysctl_spec.rb similarity index 100% rename from spec/chef/package/resources/gitlab_sysctl_spec.rb rename to spec/chef/cookbooks/package/resources/gitlab_sysctl_spec.rb diff --git a/spec/chef/package/resources/storage_directory_spec.rb b/spec/chef/cookbooks/package/resources/storage_directory_spec.rb similarity index 100% rename from spec/chef/package/resources/storage_directory_spec.rb rename to spec/chef/cookbooks/package/resources/storage_directory_spec.rb diff --git a/spec/chef/package/resources/templatesymlink_spec.rb b/spec/chef/cookbooks/package/resources/templatesymlink_spec.rb similarity index 100% rename from spec/chef/package/resources/templatesymlink_spec.rb rename to spec/chef/cookbooks/package/resources/templatesymlink_spec.rb diff --git a/spec/chef/package/resources/version_file_spec.rb b/spec/chef/cookbooks/package/resources/version_file_spec.rb similarity index 100% rename from spec/chef/package/resources/version_file_spec.rb rename to spec/chef/cookbooks/package/resources/version_file_spec.rb diff --git a/spec/chef/patroni/libraries/patroni_helper_spec.rb b/spec/chef/cookbooks/patroni/libraries/patroni_helper_spec.rb similarity index 100% rename from spec/chef/patroni/libraries/patroni_helper_spec.rb rename to spec/chef/cookbooks/patroni/libraries/patroni_helper_spec.rb diff --git a/spec/chef/patroni/recipes/patroni_spec.rb b/spec/chef/cookbooks/patroni/recipes/patroni_spec.rb similarity index 100% rename from spec/chef/patroni/recipes/patroni_spec.rb rename to spec/chef/cookbooks/patroni/recipes/patroni_spec.rb diff --git a/spec/chef/pgbouncer/libraries/pgbouncer_helper_spec.rb b/spec/chef/cookbooks/pgbouncer/libraries/pgbouncer_helper_spec.rb similarity index 100% rename from spec/chef/pgbouncer/libraries/pgbouncer_helper_spec.rb rename to spec/chef/cookbooks/pgbouncer/libraries/pgbouncer_helper_spec.rb diff --git a/spec/chef/pgbouncer/recipes/pgbouncer_spec.rb b/spec/chef/cookbooks/pgbouncer/recipes/pgbouncer_spec.rb similarity index 100% rename from spec/chef/pgbouncer/recipes/pgbouncer_spec.rb rename to spec/chef/cookbooks/pgbouncer/recipes/pgbouncer_spec.rb diff --git a/spec/chef/pgbouncer/recipes/pgbouncer_user_spec.rb b/spec/chef/cookbooks/pgbouncer/recipes/pgbouncer_user_spec.rb similarity index 100% rename from spec/chef/pgbouncer/recipes/pgbouncer_user_spec.rb rename to spec/chef/cookbooks/pgbouncer/recipes/pgbouncer_user_spec.rb diff --git a/spec/chef/recipes/postgresql_spec.rb b/spec/chef/cookbooks/postgresql/recipes/postgresql_spec.rb similarity index 100% rename from spec/chef/recipes/postgresql_spec.rb rename to spec/chef/cookbooks/postgresql/recipes/postgresql_spec.rb diff --git a/spec/chef/postgresql/recipes/sysctl_spec.rb b/spec/chef/cookbooks/postgresql/recipes/sysctl_spec.rb similarity index 100% rename from spec/chef/postgresql/recipes/sysctl_spec.rb rename to spec/chef/cookbooks/postgresql/recipes/sysctl_spec.rb diff --git a/spec/chef/postgresql/recipes/user_spec.rb b/spec/chef/cookbooks/postgresql/recipes/user_spec.rb similarity index 100% rename from spec/chef/postgresql/recipes/user_spec.rb rename to spec/chef/cookbooks/postgresql/recipes/user_spec.rb diff --git a/spec/chef/postgresql/resources/config_spec.rb b/spec/chef/cookbooks/postgresql/resources/config_spec.rb similarity index 100% rename from spec/chef/postgresql/resources/config_spec.rb rename to spec/chef/cookbooks/postgresql/resources/config_spec.rb diff --git a/spec/chef/postgresql/resources/database_spec.rb b/spec/chef/cookbooks/postgresql/resources/database_spec.rb similarity index 100% rename from spec/chef/postgresql/resources/database_spec.rb rename to spec/chef/cookbooks/postgresql/resources/database_spec.rb diff --git a/spec/chef/postgresql/resources/extension_spec.rb b/spec/chef/cookbooks/postgresql/resources/extension_spec.rb similarity index 100% rename from spec/chef/postgresql/resources/extension_spec.rb rename to spec/chef/cookbooks/postgresql/resources/extension_spec.rb diff --git a/spec/chef/postgresql/resources/query_spec.rb b/spec/chef/cookbooks/postgresql/resources/query_spec.rb similarity index 100% rename from spec/chef/postgresql/resources/query_spec.rb rename to spec/chef/cookbooks/postgresql/resources/query_spec.rb diff --git a/spec/chef/postgresql/resources/schema_spec.rb b/spec/chef/cookbooks/postgresql/resources/schema_spec.rb similarity index 100% rename from spec/chef/postgresql/resources/schema_spec.rb rename to spec/chef/cookbooks/postgresql/resources/schema_spec.rb diff --git a/spec/chef/postgresql/resources/user_spec.rb b/spec/chef/cookbooks/postgresql/resources/user_spec.rb similarity index 100% rename from spec/chef/postgresql/resources/user_spec.rb rename to spec/chef/cookbooks/postgresql/resources/user_spec.rb diff --git a/spec/chef/recipes/praefect_spec.rb b/spec/chef/cookbooks/praefect/recipes/praefect_spec.rb similarity index 100% rename from spec/chef/recipes/praefect_spec.rb rename to spec/chef/cookbooks/praefect/recipes/praefect_spec.rb diff --git a/spec/chef/redis/redis_spec.rb b/spec/chef/cookbooks/redis/recipes/redis_spec.rb similarity index 100% rename from spec/chef/redis/redis_spec.rb rename to spec/chef/cookbooks/redis/recipes/redis_spec.rb diff --git a/spec/chef/recipes/registry_spec.rb b/spec/chef/cookbooks/registry/recipes/registry_spec.rb similarity index 100% rename from spec/chef/recipes/registry_spec.rb rename to spec/chef/cookbooks/registry/recipes/registry_spec.rb diff --git a/spec/chef/spamcheck/recipes/spamcheck_spec.rb b/spec/chef/cookbooks/spamcheck/recipes/spamcheck_spec.rb similarity index 100% rename from spec/chef/spamcheck/recipes/spamcheck_spec.rb rename to spec/chef/cookbooks/spamcheck/recipes/spamcheck_spec.rb diff --git a/spec/fixtures/cookbooks/acme/attributes/default.rb b/spec/chef/fixtures/cookbooks/acme/attributes/default.rb similarity index 100% rename from spec/fixtures/cookbooks/acme/attributes/default.rb rename to spec/chef/fixtures/cookbooks/acme/attributes/default.rb diff --git a/spec/fixtures/cookbooks/acme/metadata.rb b/spec/chef/fixtures/cookbooks/acme/metadata.rb similarity index 100% rename from spec/fixtures/cookbooks/acme/metadata.rb rename to spec/chef/fixtures/cookbooks/acme/metadata.rb diff --git a/spec/fixtures/cookbooks/acme/resources/certificate.rb b/spec/chef/fixtures/cookbooks/acme/resources/certificate.rb similarity index 100% rename from spec/fixtures/cookbooks/acme/resources/certificate.rb rename to spec/chef/fixtures/cookbooks/acme/resources/certificate.rb diff --git a/spec/fixtures/cookbooks/acme/resources/selfsigned.rb b/spec/chef/fixtures/cookbooks/acme/resources/selfsigned.rb similarity index 100% rename from spec/fixtures/cookbooks/acme/resources/selfsigned.rb rename to spec/chef/fixtures/cookbooks/acme/resources/selfsigned.rb diff --git a/spec/fixtures/cookbooks/test_consul/metadata.rb b/spec/chef/fixtures/cookbooks/test_consul/metadata.rb similarity index 100% rename from spec/fixtures/cookbooks/test_consul/metadata.rb rename to spec/chef/fixtures/cookbooks/test_consul/metadata.rb diff --git a/spec/fixtures/cookbooks/test_consul/recipes/consul_service_address_port.rb b/spec/chef/fixtures/cookbooks/test_consul/recipes/consul_service_address_port.rb similarity index 100% rename from spec/fixtures/cookbooks/test_consul/recipes/consul_service_address_port.rb rename to spec/chef/fixtures/cookbooks/test_consul/recipes/consul_service_address_port.rb diff --git a/spec/fixtures/cookbooks/test_consul/recipes/consul_service_delete.rb b/spec/chef/fixtures/cookbooks/test_consul/recipes/consul_service_delete.rb similarity index 100% rename from spec/fixtures/cookbooks/test_consul/recipes/consul_service_delete.rb rename to spec/chef/fixtures/cookbooks/test_consul/recipes/consul_service_delete.rb diff --git a/spec/fixtures/cookbooks/test_consul/recipes/consul_service_delete_no_reload.rb b/spec/chef/fixtures/cookbooks/test_consul/recipes/consul_service_delete_no_reload.rb similarity index 100% rename from spec/fixtures/cookbooks/test_consul/recipes/consul_service_delete_no_reload.rb rename to spec/chef/fixtures/cookbooks/test_consul/recipes/consul_service_delete_no_reload.rb diff --git a/spec/fixtures/cookbooks/test_consul/recipes/consul_service_meta.rb b/spec/chef/fixtures/cookbooks/test_consul/recipes/consul_service_meta.rb similarity index 100% rename from spec/fixtures/cookbooks/test_consul/recipes/consul_service_meta.rb rename to spec/chef/fixtures/cookbooks/test_consul/recipes/consul_service_meta.rb diff --git a/spec/fixtures/cookbooks/test_consul/recipes/consul_service_socket.rb b/spec/chef/fixtures/cookbooks/test_consul/recipes/consul_service_socket.rb similarity index 100% rename from spec/fixtures/cookbooks/test_consul/recipes/consul_service_socket.rb rename to spec/chef/fixtures/cookbooks/test_consul/recipes/consul_service_socket.rb diff --git a/spec/fixtures/cookbooks/test_consul/recipes/reload_consul.rb b/spec/chef/fixtures/cookbooks/test_consul/recipes/reload_consul.rb similarity index 100% rename from spec/fixtures/cookbooks/test_consul/recipes/reload_consul.rb rename to spec/chef/fixtures/cookbooks/test_consul/recipes/reload_consul.rb diff --git a/spec/fixtures/cookbooks/test_crond/metadata.rb b/spec/chef/fixtures/cookbooks/test_crond/metadata.rb similarity index 100% rename from spec/fixtures/cookbooks/test_crond/metadata.rb rename to spec/chef/fixtures/cookbooks/test_crond/metadata.rb diff --git a/spec/fixtures/cookbooks/test_crond/recipes/crond_job_delete.rb b/spec/chef/fixtures/cookbooks/test_crond/recipes/crond_job_delete.rb similarity index 100% rename from spec/fixtures/cookbooks/test_crond/recipes/crond_job_delete.rb rename to spec/chef/fixtures/cookbooks/test_crond/recipes/crond_job_delete.rb diff --git a/spec/fixtures/cookbooks/test_crond/recipes/crond_job_minimal.rb b/spec/chef/fixtures/cookbooks/test_crond/recipes/crond_job_minimal.rb similarity index 100% rename from spec/fixtures/cookbooks/test_crond/recipes/crond_job_minimal.rb rename to spec/chef/fixtures/cookbooks/test_crond/recipes/crond_job_minimal.rb diff --git a/spec/fixtures/cookbooks/test_gitlab/metadata.rb b/spec/chef/fixtures/cookbooks/test_gitlab/metadata.rb similarity index 100% rename from spec/fixtures/cookbooks/test_gitlab/metadata.rb rename to spec/chef/fixtures/cookbooks/test_gitlab/metadata.rb diff --git a/spec/fixtures/cookbooks/test_gitlab/recipes/puma_config_create.rb b/spec/chef/fixtures/cookbooks/test_gitlab/recipes/puma_config_create.rb similarity index 100% rename from spec/fixtures/cookbooks/test_gitlab/recipes/puma_config_create.rb rename to spec/chef/fixtures/cookbooks/test_gitlab/recipes/puma_config_create.rb diff --git a/spec/fixtures/cookbooks/test_gitlab/recipes/puma_config_custom.rb b/spec/chef/fixtures/cookbooks/test_gitlab/recipes/puma_config_custom.rb similarity index 100% rename from spec/fixtures/cookbooks/test_gitlab/recipes/puma_config_custom.rb rename to spec/chef/fixtures/cookbooks/test_gitlab/recipes/puma_config_custom.rb diff --git a/spec/fixtures/cookbooks/test_gitlab/recipes/rails_migration_run.rb b/spec/chef/fixtures/cookbooks/test_gitlab/recipes/rails_migration_run.rb similarity index 100% rename from spec/fixtures/cookbooks/test_gitlab/recipes/rails_migration_run.rb rename to spec/chef/fixtures/cookbooks/test_gitlab/recipes/rails_migration_run.rb diff --git a/spec/fixtures/cookbooks/test_gitlab_ee/metadata.rb b/spec/chef/fixtures/cookbooks/test_gitlab_ee/metadata.rb similarity index 100% rename from spec/fixtures/cookbooks/test_gitlab_ee/metadata.rb rename to spec/chef/fixtures/cookbooks/test_gitlab_ee/metadata.rb diff --git a/spec/fixtures/cookbooks/test_gitlab_ee/recipes/pgbouncer_user_create_geo.rb b/spec/chef/fixtures/cookbooks/test_gitlab_ee/recipes/pgbouncer_user_create_geo.rb similarity index 100% rename from spec/fixtures/cookbooks/test_gitlab_ee/recipes/pgbouncer_user_create_geo.rb rename to spec/chef/fixtures/cookbooks/test_gitlab_ee/recipes/pgbouncer_user_create_geo.rb diff --git a/spec/fixtures/cookbooks/test_gitlab_ee/recipes/pgbouncer_user_create_rails.rb b/spec/chef/fixtures/cookbooks/test_gitlab_ee/recipes/pgbouncer_user_create_rails.rb similarity index 100% rename from spec/fixtures/cookbooks/test_gitlab_ee/recipes/pgbouncer_user_create_rails.rb rename to spec/chef/fixtures/cookbooks/test_gitlab_ee/recipes/pgbouncer_user_create_rails.rb diff --git a/spec/fixtures/cookbooks/test_package/metadata.rb b/spec/chef/fixtures/cookbooks/test_package/metadata.rb similarity index 100% rename from spec/fixtures/cookbooks/test_package/metadata.rb rename to spec/chef/fixtures/cookbooks/test_package/metadata.rb diff --git a/spec/fixtures/cookbooks/test_package/recipes/account_create.rb b/spec/chef/fixtures/cookbooks/test_package/recipes/account_create.rb similarity index 100% rename from spec/fixtures/cookbooks/test_package/recipes/account_create.rb rename to spec/chef/fixtures/cookbooks/test_package/recipes/account_create.rb diff --git a/spec/fixtures/cookbooks/test_package/recipes/account_remove.rb b/spec/chef/fixtures/cookbooks/test_package/recipes/account_remove.rb similarity index 100% rename from spec/fixtures/cookbooks/test_package/recipes/account_remove.rb rename to spec/chef/fixtures/cookbooks/test_package/recipes/account_remove.rb diff --git a/spec/fixtures/cookbooks/test_package/recipes/env_dir_create.rb b/spec/chef/fixtures/cookbooks/test_package/recipes/env_dir_create.rb similarity index 100% rename from spec/fixtures/cookbooks/test_package/recipes/env_dir_create.rb rename to spec/chef/fixtures/cookbooks/test_package/recipes/env_dir_create.rb diff --git a/spec/fixtures/cookbooks/test_package/recipes/gitlab_sysctl_create.rb b/spec/chef/fixtures/cookbooks/test_package/recipes/gitlab_sysctl_create.rb similarity index 100% rename from spec/fixtures/cookbooks/test_package/recipes/gitlab_sysctl_create.rb rename to spec/chef/fixtures/cookbooks/test_package/recipes/gitlab_sysctl_create.rb diff --git a/spec/fixtures/cookbooks/test_package/recipes/storage_directory_create.rb b/spec/chef/fixtures/cookbooks/test_package/recipes/storage_directory_create.rb similarity index 100% rename from spec/fixtures/cookbooks/test_package/recipes/storage_directory_create.rb rename to spec/chef/fixtures/cookbooks/test_package/recipes/storage_directory_create.rb diff --git a/spec/fixtures/cookbooks/test_package/recipes/templatesymlink_create.rb b/spec/chef/fixtures/cookbooks/test_package/recipes/templatesymlink_create.rb similarity index 100% rename from spec/fixtures/cookbooks/test_package/recipes/templatesymlink_create.rb rename to spec/chef/fixtures/cookbooks/test_package/recipes/templatesymlink_create.rb diff --git a/spec/fixtures/cookbooks/test_package/recipes/templatesymlink_delete.rb b/spec/chef/fixtures/cookbooks/test_package/recipes/templatesymlink_delete.rb similarity index 100% rename from spec/fixtures/cookbooks/test_package/recipes/templatesymlink_delete.rb rename to spec/chef/fixtures/cookbooks/test_package/recipes/templatesymlink_delete.rb diff --git a/spec/fixtures/cookbooks/test_package/recipes/version_file_create.rb b/spec/chef/fixtures/cookbooks/test_package/recipes/version_file_create.rb similarity index 100% rename from spec/fixtures/cookbooks/test_package/recipes/version_file_create.rb rename to spec/chef/fixtures/cookbooks/test_package/recipes/version_file_create.rb diff --git a/spec/fixtures/cookbooks/test_package/templates/default/test-template.erb b/spec/chef/fixtures/cookbooks/test_package/templates/default/test-template.erb similarity index 100% rename from spec/fixtures/cookbooks/test_package/templates/default/test-template.erb rename to spec/chef/fixtures/cookbooks/test_package/templates/default/test-template.erb diff --git a/spec/fixtures/cookbooks/test_postgresql/metadata.rb b/spec/chef/fixtures/cookbooks/test_postgresql/metadata.rb similarity index 100% rename from spec/fixtures/cookbooks/test_postgresql/metadata.rb rename to spec/chef/fixtures/cookbooks/test_postgresql/metadata.rb diff --git a/spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_config.rb b/spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_config.rb similarity index 100% rename from spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_config.rb rename to spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_config.rb diff --git a/spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_database_create.rb b/spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_database_create.rb similarity index 100% rename from spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_database_create.rb rename to spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_database_create.rb diff --git a/spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_database_create_with_options.rb b/spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_database_create_with_options.rb similarity index 100% rename from spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_database_create_with_options.rb rename to spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_database_create_with_options.rb diff --git a/spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_extension_enable.rb b/spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_extension_enable.rb similarity index 100% rename from spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_extension_enable.rb rename to spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_extension_enable.rb diff --git a/spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_query_run.rb b/spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_query_run.rb similarity index 73% rename from spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_query_run.rb rename to spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_query_run.rb index e257e762b..acffda441 100644 --- a/spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_query_run.rb +++ b/spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_query_run.rb @@ -1,5 +1,3 @@ -require_relative '../../../../../files/gitlab-cookbooks/gitlab/libraries/helpers/geo_pg_helper' - postgresql_query 'create schema' do db_name 'omnibus_test' query "CREATE SCHEMA example AUTHORIZATION foobar;" diff --git a/spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_schema_create.rb b/spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_schema_create.rb similarity index 100% rename from spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_schema_create.rb rename to spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_schema_create.rb diff --git a/spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_create.rb b/spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_create.rb similarity index 100% rename from spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_create.rb rename to spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_create.rb diff --git a/spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_options_superuser.rb b/spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_options_superuser.rb similarity index 100% rename from spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_options_superuser.rb rename to spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_options_superuser.rb diff --git a/spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_options_unspecified.rb b/spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_options_unspecified.rb similarity index 100% rename from spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_options_unspecified.rb rename to spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_options_unspecified.rb diff --git a/spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_password_empty.rb b/spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_password_empty.rb similarity index 100% rename from spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_password_empty.rb rename to spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_password_empty.rb diff --git a/spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_password_md5.rb b/spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_password_md5.rb similarity index 100% rename from spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_password_md5.rb rename to spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_password_md5.rb diff --git a/spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_password_nil.rb b/spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_password_nil.rb similarity index 100% rename from spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_password_nil.rb rename to spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_password_nil.rb diff --git a/spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_password_unspecified.rb b/spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_password_unspecified.rb similarity index 100% rename from spec/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_password_unspecified.rb rename to spec/chef/fixtures/cookbooks/test_postgresql/recipes/postgresql_user_password_unspecified.rb diff --git a/spec/fixtures/fauxhai/ubuntu/16.04-docker.json b/spec/chef/fixtures/fauxhai/ubuntu/16.04-docker.json similarity index 100% rename from spec/fixtures/fauxhai/ubuntu/16.04-docker.json rename to spec/chef/fixtures/fauxhai/ubuntu/16.04-docker.json diff --git a/spec/fixtures/fauxhai/ubuntu/16.04-more-cpus.json b/spec/chef/fixtures/fauxhai/ubuntu/16.04-more-cpus.json similarity index 100% rename from spec/fixtures/fauxhai/ubuntu/16.04-more-cpus.json rename to spec/chef/fixtures/fauxhai/ubuntu/16.04-more-cpus.json diff --git a/spec/fixtures/fauxhai/ubuntu/16.04-no-run-tmpfs.json b/spec/chef/fixtures/fauxhai/ubuntu/16.04-no-run-tmpfs.json similarity index 100% rename from spec/fixtures/fauxhai/ubuntu/16.04-no-run-tmpfs.json rename to spec/chef/fixtures/fauxhai/ubuntu/16.04-no-run-tmpfs.json diff --git a/spec/fixtures/fauxhai/ubuntu/16.04.json b/spec/chef/fixtures/fauxhai/ubuntu/16.04.json similarity index 100% rename from spec/fixtures/fauxhai/ubuntu/16.04.json rename to spec/chef/fixtures/fauxhai/ubuntu/16.04.json diff --git a/spec/fixtures/migration/failed-migration-status-file b/spec/chef/fixtures/migration/failed-migration-status-file similarity index 100% rename from spec/fixtures/migration/failed-migration-status-file rename to spec/chef/fixtures/migration/failed-migration-status-file diff --git a/spec/fixtures/migration/successful-migration-status-file b/spec/chef/fixtures/migration/successful-migration-status-file similarity index 100% rename from spec/fixtures/migration/successful-migration-status-file rename to spec/chef/fixtures/migration/successful-migration-status-file diff --git a/spec/gitlab-ctl-commands-ee/geo_replication_spec.rb b/spec/chef/gitlab-ctl-commands-ee/geo_replication_spec.rb similarity index 88% rename from spec/gitlab-ctl-commands-ee/geo_replication_spec.rb rename to spec/chef/gitlab-ctl-commands-ee/geo_replication_spec.rb index dea0dd29b..8199f7ff3 100644 --- a/spec/gitlab-ctl-commands-ee/geo_replication_spec.rb +++ b/spec/chef/gitlab-ctl-commands-ee/geo_replication_spec.rb @@ -11,12 +11,12 @@ RSpec.describe 'gitlab-ctl geo-replication' do allow_any_instance_of(Omnibus::Ctl).to receive(:require).with( '/opt/testing-ctl/embedded/service/omnibus-ctl-ee/lib/geo/replication_process' ) do - require_relative('../../files/gitlab-ctl-commands-ee/lib/geo/replication_process') + require_relative('../../../files/gitlab-ctl-commands-ee/lib/geo/replication_process') end allow_any_instance_of(Omnibus::Ctl).to receive(:require).with( '/opt/testing-ctl/embedded/service/omnibus-ctl-ee/lib/geo/replication_toggle_command' ) do - require_relative('../../files/gitlab-ctl-commands-ee/lib/geo/replication_toggle_command') + require_relative('../../../files/gitlab-ctl-commands-ee/lib/geo/replication_toggle_command') end subject.load_file('files/gitlab-ctl-commands-ee/geo_replication.rb') diff --git a/spec/gitlab-ctl-commands-ee/geo_spec.rb b/spec/chef/gitlab-ctl-commands-ee/geo_spec.rb similarity index 93% rename from spec/gitlab-ctl-commands-ee/geo_spec.rb rename to spec/chef/gitlab-ctl-commands-ee/geo_spec.rb index aa0320b62..2d0f46f3d 100644 --- a/spec/gitlab-ctl-commands-ee/geo_spec.rb +++ b/spec/chef/gitlab-ctl-commands-ee/geo_spec.rb @@ -4,8 +4,8 @@ require 'spec_helper' require 'omnibus-ctl' require 'optparse' -require_relative('../../files/gitlab-ctl-commands/lib/gitlab_ctl') -require_relative('../../files/gitlab-ctl-commands-ee/lib/geo') +require_relative('../../../files/gitlab-ctl-commands/lib/gitlab_ctl') +require_relative('../../../files/gitlab-ctl-commands-ee/lib/geo') RSpec.describe 'gitlab-ctl geo' do commands = %w(promote) diff --git a/spec/gitlab-ctl-commands-ee/lib/consul_spec.rb b/spec/chef/gitlab-ctl-commands-ee/lib/consul_spec.rb similarity index 100% rename from spec/gitlab-ctl-commands-ee/lib/consul_spec.rb rename to spec/chef/gitlab-ctl-commands-ee/lib/consul_spec.rb diff --git a/spec/gitlab-ctl-commands-ee/lib/geo/pitr_file_spec.rb b/spec/chef/gitlab-ctl-commands-ee/lib/geo/pitr_file_spec.rb similarity index 100% rename from spec/gitlab-ctl-commands-ee/lib/geo/pitr_file_spec.rb rename to spec/chef/gitlab-ctl-commands-ee/lib/geo/pitr_file_spec.rb diff --git a/spec/gitlab-ctl-commands-ee/lib/geo/promote_db_spec.rb b/spec/chef/gitlab-ctl-commands-ee/lib/geo/promote_db_spec.rb similarity index 100% rename from spec/gitlab-ctl-commands-ee/lib/geo/promote_db_spec.rb rename to spec/chef/gitlab-ctl-commands-ee/lib/geo/promote_db_spec.rb diff --git a/spec/gitlab-ctl-commands-ee/lib/geo/promote_spec.rb b/spec/chef/gitlab-ctl-commands-ee/lib/geo/promote_spec.rb similarity index 99% rename from spec/gitlab-ctl-commands-ee/lib/geo/promote_spec.rb rename to spec/chef/gitlab-ctl-commands-ee/lib/geo/promote_spec.rb index 7995bd648..1438c5608 100644 --- a/spec/gitlab-ctl-commands-ee/lib/geo/promote_spec.rb +++ b/spec/chef/gitlab-ctl-commands-ee/lib/geo/promote_spec.rb @@ -3,7 +3,7 @@ require 'geo/promote' require 'geo/promote_db' require 'gitlab_ctl/util' -require_relative('../../../../files/gitlab-ctl-commands-ee/lib/patroni') +require_relative('../../../../../files/gitlab-ctl-commands-ee/lib/patroni') RSpec.describe Geo::Promote, '#execute' do let(:base_path) { '/opt/gitlab/embedded' } diff --git a/spec/gitlab-ctl-commands-ee/lib/geo/promote_to_primary_node_spec.rb b/spec/chef/gitlab-ctl-commands-ee/lib/geo/promote_to_primary_node_spec.rb similarity index 100% rename from spec/gitlab-ctl-commands-ee/lib/geo/promote_to_primary_node_spec.rb rename to spec/chef/gitlab-ctl-commands-ee/lib/geo/promote_to_primary_node_spec.rb diff --git a/spec/gitlab-ctl-commands-ee/lib/geo/promotion_preflight_checks_spec.rb b/spec/chef/gitlab-ctl-commands-ee/lib/geo/promotion_preflight_checks_spec.rb similarity index 100% rename from spec/gitlab-ctl-commands-ee/lib/geo/promotion_preflight_checks_spec.rb rename to spec/chef/gitlab-ctl-commands-ee/lib/geo/promotion_preflight_checks_spec.rb diff --git a/spec/gitlab-ctl-commands-ee/lib/geo/replication_process_spec.rb b/spec/chef/gitlab-ctl-commands-ee/lib/geo/replication_process_spec.rb similarity index 100% rename from spec/gitlab-ctl-commands-ee/lib/geo/replication_process_spec.rb rename to spec/chef/gitlab-ctl-commands-ee/lib/geo/replication_process_spec.rb diff --git a/spec/gitlab-ctl-commands-ee/lib/geo/replication_spec.rb b/spec/chef/gitlab-ctl-commands-ee/lib/geo/replication_spec.rb similarity index 100% rename from spec/gitlab-ctl-commands-ee/lib/geo/replication_spec.rb rename to spec/chef/gitlab-ctl-commands-ee/lib/geo/replication_spec.rb diff --git a/spec/gitlab-ctl-commands-ee/lib/geo/replication_toggle_command_spec.rb b/spec/chef/gitlab-ctl-commands-ee/lib/geo/replication_toggle_command_spec.rb similarity index 100% rename from spec/gitlab-ctl-commands-ee/lib/geo/replication_toggle_command_spec.rb rename to spec/chef/gitlab-ctl-commands-ee/lib/geo/replication_toggle_command_spec.rb diff --git a/spec/gitlab-ctl-commands-ee/lib/patroni_spec.rb b/spec/chef/gitlab-ctl-commands-ee/lib/patroni_spec.rb similarity index 98% rename from spec/gitlab-ctl-commands-ee/lib/patroni_spec.rb rename to spec/chef/gitlab-ctl-commands-ee/lib/patroni_spec.rb index 8fb902194..0190a2d17 100644 --- a/spec/gitlab-ctl-commands-ee/lib/patroni_spec.rb +++ b/spec/chef/gitlab-ctl-commands-ee/lib/patroni_spec.rb @@ -2,8 +2,8 @@ require 'spec_helper' require 'omnibus-ctl' require 'optparse' -require_relative('../../../files/gitlab-ctl-commands/lib/gitlab_ctl') -require_relative('../../../files/gitlab-ctl-commands-ee/lib/patroni') +require_relative('../../../../files/gitlab-ctl-commands/lib/gitlab_ctl') +require_relative('../../../../files/gitlab-ctl-commands-ee/lib/patroni') RSpec.describe 'Patroni' do core_commands = %w(bootstrap check-leader check-replica check-standby-leader reinitialize-replica) diff --git a/spec/gitlab-ctl-commands-ee/lib/pgbouncer_spec.rb b/spec/chef/gitlab-ctl-commands-ee/lib/pgbouncer_spec.rb similarity index 100% rename from spec/gitlab-ctl-commands-ee/lib/pgbouncer_spec.rb rename to spec/chef/gitlab-ctl-commands-ee/lib/pgbouncer_spec.rb diff --git a/spec/gitlab-ctl-commands-ee/lib/postgresql/ee_spec.rb b/spec/chef/gitlab-ctl-commands-ee/lib/postgresql/ee_spec.rb similarity index 100% rename from spec/gitlab-ctl-commands-ee/lib/postgresql/ee_spec.rb rename to spec/chef/gitlab-ctl-commands-ee/lib/postgresql/ee_spec.rb diff --git a/spec/gitlab-ctl-commands-ee/promote_db_spec.rb b/spec/chef/gitlab-ctl-commands-ee/promote_db_spec.rb similarity index 97% rename from spec/gitlab-ctl-commands-ee/promote_db_spec.rb rename to spec/chef/gitlab-ctl-commands-ee/promote_db_spec.rb index 2503693c8..bd04c86e6 100644 --- a/spec/gitlab-ctl-commands-ee/promote_db_spec.rb +++ b/spec/chef/gitlab-ctl-commands-ee/promote_db_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'spec_helper' +require 'chef_helper' require 'geo/promote_db' RSpec.describe 'gitlab-ctl promote-db' do diff --git a/spec/gitlab-ctl-commands-ee/promote_to_primary_node_spec.rb b/spec/chef/gitlab-ctl-commands-ee/promote_to_primary_node_spec.rb similarity index 100% rename from spec/gitlab-ctl-commands-ee/promote_to_primary_node_spec.rb rename to spec/chef/gitlab-ctl-commands-ee/promote_to_primary_node_spec.rb diff --git a/spec/gitlab-ctl-commands-ee/promotion_preflight_checks_spec.rb b/spec/chef/gitlab-ctl-commands-ee/promotion_preflight_checks_spec.rb similarity index 96% rename from spec/gitlab-ctl-commands-ee/promotion_preflight_checks_spec.rb rename to spec/chef/gitlab-ctl-commands-ee/promotion_preflight_checks_spec.rb index 06a472615..840d223fe 100644 --- a/spec/gitlab-ctl-commands-ee/promotion_preflight_checks_spec.rb +++ b/spec/chef/gitlab-ctl-commands-ee/promotion_preflight_checks_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' +require 'chef_helper' require 'geo/promotion_preflight_checks' RSpec.shared_context 'promotion-preflight-checks' do diff --git a/spec/gitlab-ctl-commands-ee/replicate_geo_database_spec.rb b/spec/chef/gitlab-ctl-commands-ee/replicate_geo_database_spec.rb similarity index 98% rename from spec/gitlab-ctl-commands-ee/replicate_geo_database_spec.rb rename to spec/chef/gitlab-ctl-commands-ee/replicate_geo_database_spec.rb index 70ad87914..1555d9fba 100644 --- a/spec/gitlab-ctl-commands-ee/replicate_geo_database_spec.rb +++ b/spec/chef/gitlab-ctl-commands-ee/replicate_geo_database_spec.rb @@ -14,7 +14,7 @@ RSpec.describe 'gitlab-ctl replicate-geo-database' do allow_any_instance_of(Omnibus::Ctl).to receive(:require).with( '/opt/testing-ctl/embedded/service/omnibus-ctl-ee/lib/geo/replication' ) do - require_relative('../../files/gitlab-ctl-commands-ee/lib/geo/replication') + require_relative('../../../files/gitlab-ctl-commands-ee/lib/geo/replication') end subject.load_file('files/gitlab-ctl-commands-ee/replicate_geo_database.rb') diff --git a/spec/gitlab-ctl-commands/gitlab_ctl_spec.rb b/spec/chef/gitlab-ctl-commands/gitlab_ctl_spec.rb similarity index 81% rename from spec/gitlab-ctl-commands/gitlab_ctl_spec.rb rename to spec/chef/gitlab-ctl-commands/gitlab_ctl_spec.rb index 942d5e3c1..27ba667d7 100644 --- a/spec/gitlab-ctl-commands/gitlab_ctl_spec.rb +++ b/spec/chef/gitlab-ctl-commands/gitlab_ctl_spec.rb @@ -7,11 +7,11 @@ RSpec.describe 'gitlab-ctl' do allow_any_instance_of(Omnibus::Ctl).to receive(:require).with( '/opt/testing-ctl/embedded/service/omnibus-ctl/lib/gitlab_ctl' ) do - require_relative('../../files/gitlab-ctl-commands/lib/gitlab_ctl') + require_relative('../../../files/gitlab-ctl-commands/lib/gitlab_ctl') end end - let(:ctl_dir) { "#{File.dirname(__FILE__)}/../../files/gitlab-ctl-commands" } + let(:ctl_dir) { "#{File.dirname(__FILE__)}/../../../files/gitlab-ctl-commands" } it 'should be able to load all files' do # ARGV contains the commands that were passed to rspec, which are diff --git a/spec/gitlab-ctl-commands/lib/gitlab_ctl_backup_spec.rb b/spec/chef/gitlab-ctl-commands/lib/gitlab_ctl_backup_spec.rb similarity index 100% rename from spec/gitlab-ctl-commands/lib/gitlab_ctl_backup_spec.rb rename to spec/chef/gitlab-ctl-commands/lib/gitlab_ctl_backup_spec.rb diff --git a/spec/gitlab-ctl-commands/lib/gitlab_ctl_pg_upgrade_spec.rb b/spec/chef/gitlab-ctl-commands/lib/gitlab_ctl_pg_upgrade_spec.rb similarity index 100% rename from spec/gitlab-ctl-commands/lib/gitlab_ctl_pg_upgrade_spec.rb rename to spec/chef/gitlab-ctl-commands/lib/gitlab_ctl_pg_upgrade_spec.rb diff --git a/spec/gitlab-ctl-commands/lib/postgresql/replication_spec.rb b/spec/chef/gitlab-ctl-commands/lib/postgresql/replication_spec.rb similarity index 100% rename from spec/gitlab-ctl-commands/lib/postgresql/replication_spec.rb rename to spec/chef/gitlab-ctl-commands/lib/postgresql/replication_spec.rb diff --git a/spec/gitlab-ctl-commands/lib/postgresql_spec.rb b/spec/chef/gitlab-ctl-commands/lib/postgresql_spec.rb similarity index 100% rename from spec/gitlab-ctl-commands/lib/postgresql_spec.rb rename to spec/chef/gitlab-ctl-commands/lib/postgresql_spec.rb diff --git a/spec/gitlab-ctl-commands/lib/praefect_spec.rb b/spec/chef/gitlab-ctl-commands/lib/praefect_spec.rb similarity index 99% rename from spec/gitlab-ctl-commands/lib/praefect_spec.rb rename to spec/chef/gitlab-ctl-commands/lib/praefect_spec.rb index 3e036452b..640411589 100644 --- a/spec/gitlab-ctl-commands/lib/praefect_spec.rb +++ b/spec/chef/gitlab-ctl-commands/lib/praefect_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require 'optparse' -require_relative('../../../files/gitlab-ctl-commands/lib/praefect') +require_relative('../../../../files/gitlab-ctl-commands/lib/praefect') RSpec.describe Praefect do describe '.parse_options!' do diff --git a/spec/gitlab-ctl-commands/lib/upgrade_check_spec.rb b/spec/chef/gitlab-ctl-commands/lib/upgrade_check_spec.rb similarity index 100% rename from spec/gitlab-ctl-commands/lib/upgrade_check_spec.rb rename to spec/chef/gitlab-ctl-commands/lib/upgrade_check_spec.rb diff --git a/spec/gitlab-ctl-commands/lib/util_spec.rb b/spec/chef/gitlab-ctl-commands/lib/util_spec.rb similarity index 100% rename from spec/gitlab-ctl-commands/lib/util_spec.rb rename to spec/chef/gitlab-ctl-commands/lib/util_spec.rb diff --git a/spec/support/shared_context/ctl_shared_context.rb b/spec/chef/support/shared_context/ctl_shared_context.rb similarity index 77% rename from spec/support/shared_context/ctl_shared_context.rb rename to spec/chef/support/shared_context/ctl_shared_context.rb index d9ed2e97c..eb14a6e40 100644 --- a/spec/support/shared_context/ctl_shared_context.rb +++ b/spec/chef/support/shared_context/ctl_shared_context.rb @@ -10,13 +10,13 @@ RSpec.shared_context 'ctl' do allow_any_instance_of(Omnibus::Ctl).to receive(:require).with( "/opt/testing-ctl/embedded/cookbooks/package/libraries/gitlab_cluster" ) do - require_relative("../../../files/gitlab-cookbooks/package/libraries/gitlab_cluster") + require_relative("../../../../files/gitlab-cookbooks/package/libraries/gitlab_cluster") end allow_any_instance_of(Omnibus::Ctl).to receive(:require).with( "/opt/testing-ctl/embedded/service/omnibus-ctl-ee/lib/geo/#{command_script}" ) do - require_relative("../../../files/gitlab-ctl-commands-ee/lib/geo/#{command_script}") + require_relative("../../../../files/gitlab-ctl-commands-ee/lib/geo/#{command_script}") end ctl.load_file("files/gitlab-ctl-commands-ee/#{command_script}.rb") diff --git a/spec/support/shared_context/gitlab_rails_shared_context.rb b/spec/chef/support/shared_context/gitlab_rails_shared_context.rb similarity index 100% rename from spec/support/shared_context/gitlab_rails_shared_context.rb rename to spec/chef/support/shared_context/gitlab_rails_shared_context.rb diff --git a/spec/support/shared_context/object_store_shared_context.rb b/spec/chef/support/shared_context/object_store_shared_context.rb similarity index 100% rename from spec/support/shared_context/object_store_shared_context.rb rename to spec/chef/support/shared_context/object_store_shared_context.rb diff --git a/spec/support/shared_examples/consul_service_name.rb b/spec/chef/support/shared_examples/consul_service_name.rb similarity index 93% rename from spec/support/shared_examples/consul_service_name.rb rename to spec/chef/support/shared_examples/consul_service_name.rb index 3e3b943a3..191a762bd 100644 --- a/spec/support/shared_examples/consul_service_name.rb +++ b/spec/chef/support/shared_examples/consul_service_name.rb @@ -1,4 +1,4 @@ -shared_examples 'consul service discovery' do |gitlab_rb_key, service_name| +RSpec.shared_examples 'consul service discovery' do |gitlab_rb_key, service_name| let(:gitlab_rb_setting) do { consul: { diff --git a/spec/support/shared_examples/geo_promotion_command_accepts_option_shared_examples.rb b/spec/chef/support/shared_examples/geo_promotion_command_accepts_option_shared_examples.rb similarity index 100% rename from spec/support/shared_examples/geo_promotion_command_accepts_option_shared_examples.rb rename to spec/chef/support/shared_examples/geo_promotion_command_accepts_option_shared_examples.rb diff --git a/spec/support/shared_examples/gitlab_geo_promotion_commands_shared_examples.rb b/spec/chef/support/shared_examples/gitlab_geo_promotion_commands_shared_examples.rb similarity index 100% rename from spec/support/shared_examples/gitlab_geo_promotion_commands_shared_examples.rb rename to spec/chef/support/shared_examples/gitlab_geo_promotion_commands_shared_examples.rb diff --git a/spec/support/shared_examples/gitlab_yml_object_storage_shared_examples.rb b/spec/chef/support/shared_examples/gitlab_yml_object_storage_shared_examples.rb similarity index 93% rename from spec/support/shared_examples/gitlab_yml_object_storage_shared_examples.rb rename to spec/chef/support/shared_examples/gitlab_yml_object_storage_shared_examples.rb index 242e7b848..e07136cf9 100644 --- a/spec/support/shared_examples/gitlab_yml_object_storage_shared_examples.rb +++ b/spec/chef/support/shared_examples/gitlab_yml_object_storage_shared_examples.rb @@ -1,4 +1,4 @@ -shared_examples 'renders object storage settings in gitlab.yml' do |component, component_default = {}, workhorse_accelerated = true| +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' diff --git a/spec/support/shared_examples/logrotate_config.rb b/spec/chef/support/shared_examples/logrotate_config.rb similarity index 76% rename from spec/support/shared_examples/logrotate_config.rb rename to spec/chef/support/shared_examples/logrotate_config.rb index d68fb37f0..2467894dd 100644 --- a/spec/support/shared_examples/logrotate_config.rb +++ b/spec/chef/support/shared_examples/logrotate_config.rb @@ -1,4 +1,4 @@ -shared_examples 'configured logrotate service' do |svc, username = 'git', group = 'git'| +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 diff --git a/spec/support/shared_examples/registry_service.rb b/spec/chef/support/shared_examples/registry_service.rb similarity index 98% rename from spec/support/shared_examples/registry_service.rb rename to spec/chef/support/shared_examples/registry_service.rb index 3b6cb7c2c..0aeaf64f2 100644 --- a/spec/support/shared_examples/registry_service.rb +++ b/spec/chef/support/shared_examples/registry_service.rb @@ -1,4 +1,4 @@ -shared_examples 'enabled registry service' do +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') diff --git a/spec/support/shared_examples/runit_service.rb b/spec/chef/support/shared_examples/runit_service.rb similarity index 96% rename from spec/support/shared_examples/runit_service.rb rename to spec/chef/support/shared_examples/runit_service.rb index af23c3aa0..e0b1233f7 100644 --- a/spec/support/shared_examples/runit_service.rb +++ b/spec/chef/support/shared_examples/runit_service.rb @@ -6,7 +6,7 @@ def get_env_string(username, groupname) env_string end -shared_examples 'enabled runit service' do |svc_name, owner, group, username = nil, groupname = nil| +RSpec.shared_examples 'enabled runit service' do |svc_name, owner, group, username = nil, groupname = nil| it 'creates directories' do expect(chef_run).to create_directory("/opt/gitlab/sv/#{svc_name}").with( owner: owner, @@ -100,7 +100,7 @@ shared_examples 'enabled runit service' do |svc_name, owner, group, username = n end end -shared_examples 'disabled runit service' do |svc_name| +RSpec.shared_examples 'disabled runit service' do |svc_name| it 'does not create directories' do expect(chef_run).not_to create_directory("/opt/gitlab/sv/#{svc_name}") expect(chef_run).not_to create_directory("/opt/gitlab/sv/#{svc_name}/log") diff --git a/spec/support/shared_examples/yaml_check.rb b/spec/chef/support/shared_examples/yaml_check.rb similarity index 75% rename from spec/support/shared_examples/yaml_check.rb rename to spec/chef/support/shared_examples/yaml_check.rb index 739e1bf77..52764e126 100644 --- a/spec/support/shared_examples/yaml_check.rb +++ b/spec/chef/support/shared_examples/yaml_check.rb @@ -1,6 +1,6 @@ require 'yaml' -shared_examples 'renders a valid YAML file' do |filename| +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 diff --git a/spec/chef_helper.rb b/spec/chef_helper.rb index 95197a2de..9b928d519 100644 --- a/spec/chef_helper.rb +++ b/spec/chef_helper.rb @@ -5,10 +5,17 @@ require 'spec_helper' require 'chefspec' require 'ohai' -# Load our cookbook libraries so we can stub them in our tests -cookbooks = %w(package gitlab gitaly mattermost gitlab-ee letsencrypt monitoring patroni gitlab-kas gitlab-pages pgbouncer consul) +# Load chef specific support libraries to provide common convenience methods for our tests +Dir["./spec/chef/support/**/*.rb"].each { |library| require library } + +# Load our cookbook libraries so we can stub them in our tests. package, gitlab +# and gitlab-ee needs to be loaded first as others depend on them for proper +# functionality. +cookbooks = %w[package gitlab gitlab-ee].map { |cookbook| File.join(__dir__, "../files/gitlab-cookbooks/#{cookbook}") } +cookbooks = cookbooks.concat(Dir[File.join(__dir__, "../files/gitlab-cookbooks/*")].select { |d| File.directory?(d) }).uniq + cookbooks.each do |cookbook| - Dir[File.join(__dir__, "../files/gitlab-cookbooks/#{cookbook}/libraries/**/*.rb")].each { |f| require f } + Dir["#{cookbook}/libraries/**/*.rb"].each { |library| require library } end def deep_clone(obj) @@ -35,7 +42,7 @@ RSpec.configure do |config| config.platform = platform config.version = version - config.cookbook_path = ['files/gitlab-cookbooks/', 'spec/fixtures/cookbooks'] + config.cookbook_path = ['files/gitlab-cookbooks/', 'spec/chef/fixtures/cookbooks'] config.log_level = :error config.before do @@ -66,7 +73,9 @@ RSpec.configure do |config| # Prevent chef converge from reloading any of our previously loaded libraries allow(Kernel).to receive(:load).and_call_original - cookbooks.each do |cookbook| + + cookbooks.each do |cookbook_path| + cookbook = File.basename(cookbook_path) allow(Kernel).to receive(:load).with(%r{#{cookbook}/libraries}).and_return(true) end diff --git a/spec/support/macros.rb b/spec/support/macros.rb index 8db4d840d..0ae6ab816 100644 --- a/spec/support/macros.rb +++ b/spec/support/macros.rb @@ -99,7 +99,7 @@ module GitlabSpec # Return the full path for the spec fixtures folder # @return [String] full path def fixture_path - File.join(__dir__, '../fixtures') + File.join(__dir__, '../chef/fixtures') end def get_rendered_toml(chef_run, path)