Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
29714d78
Commit
29714d78
authored
Jan 09, 2020
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rc/rubocop-factorybot' into 'master'
Enable factorybot cop See merge request gitlab-org/gitlab!22136
parents
b55a4a72
2aebe31f
Changes
138
Hide whitespace changes
Inline
Side-by-side
Showing
138 changed files
with
190 additions
and
224 deletions
+190
-224
.rubocop.yml
.rubocop.yml
+0
-6
ee/spec/factories/alerting/alert.rb
ee/spec/factories/alerting/alert.rb
+1
-1
ee/spec/factories/allowed_email_domains.rb
ee/spec/factories/allowed_email_domains.rb
+1
-1
ee/spec/factories/analytics/cycle_analytics/group_stages.rb
ee/spec/factories/analytics/cycle_analytics/group_stages.rb
+1
-1
ee/spec/factories/ci/builds.rb
ee/spec/factories/ci/builds.rb
+1
-1
ee/spec/factories/ci/job_artifacts.rb
ee/spec/factories/ci/job_artifacts.rb
+1
-1
ee/spec/factories/ci/pipelines.rb
ee/spec/factories/ci/pipelines.rb
+1
-1
ee/spec/factories/ci/reports/license_scanning/dependency.rb
ee/spec/factories/ci/reports/license_scanning/dependency.rb
+1
-1
ee/spec/factories/ci/reports/license_scanning/license.rb
ee/spec/factories/ci/reports/license_scanning/license.rb
+1
-1
ee/spec/factories/ci/reports/license_scanning/report.rb
ee/spec/factories/ci/reports/license_scanning/report.rb
+1
-1
ee/spec/factories/ci/reports/metrics/report.rb
ee/spec/factories/ci/reports/metrics/report.rb
+1
-1
ee/spec/factories/ci/reports/security/aggregated_reports.rb
ee/spec/factories/ci/reports/security/aggregated_reports.rb
+1
-1
ee/spec/factories/ci/reports/security/identifiers.rb
ee/spec/factories/ci/reports/security/identifiers.rb
+1
-1
ee/spec/factories/ci/reports/security/locations/container_scanning.rb
...ories/ci/reports/security/locations/container_scanning.rb
+1
-1
ee/spec/factories/ci/reports/security/locations/dast.rb
ee/spec/factories/ci/reports/security/locations/dast.rb
+1
-1
ee/spec/factories/ci/reports/security/locations/dependency_scanning.rb
...ries/ci/reports/security/locations/dependency_scanning.rb
+1
-1
ee/spec/factories/ci/reports/security/locations/sast.rb
ee/spec/factories/ci/reports/security/locations/sast.rb
+1
-1
ee/spec/factories/ci/reports/security/occurrences.rb
ee/spec/factories/ci/reports/security/occurrences.rb
+1
-1
ee/spec/factories/ci/reports/security/reports.rb
ee/spec/factories/ci/reports/security/reports.rb
+1
-1
ee/spec/factories/ci/reports/security/scanners.rb
ee/spec/factories/ci/reports/security/scanners.rb
+1
-1
ee/spec/factories/ci/subscriptions/projects.rb
ee/spec/factories/ci/subscriptions/projects.rb
+1
-1
ee/spec/factories/dependencies.rb
ee/spec/factories/dependencies.rb
+1
-1
ee/spec/factories/dependency_proxy.rb
ee/spec/factories/dependency_proxy.rb
+1
-1
ee/spec/factories/design_management/design_at_version.rb
ee/spec/factories/design_management/design_at_version.rb
+1
-1
ee/spec/factories/design_management/designs.rb
ee/spec/factories/design_management/designs.rb
+1
-1
ee/spec/factories/design_management/versions.rb
ee/spec/factories/design_management/versions.rb
+1
-1
ee/spec/factories/doorkeeper.rb
ee/spec/factories/doorkeeper.rb
+3
-3
ee/spec/factories/geo/container_repository_registry.rb
ee/spec/factories/geo/container_repository_registry.rb
+1
-1
ee/spec/factories/geo/design_registry.rb
ee/spec/factories/geo/design_registry.rb
+1
-1
ee/spec/factories/geo/event_log.rb
ee/spec/factories/geo/event_log.rb
+15
-15
ee/spec/factories/geo/event_log_state.rb
ee/spec/factories/geo/event_log_state.rb
+1
-1
ee/spec/factories/geo/job_artifact_registry.rb
ee/spec/factories/geo/job_artifact_registry.rb
+1
-1
ee/spec/factories/geo/lfs_object_registry.rb
ee/spec/factories/geo/lfs_object_registry.rb
+1
-1
ee/spec/factories/geo/project_registry.rb
ee/spec/factories/geo/project_registry.rb
+1
-1
ee/spec/factories/geo/upload_registry.rb
ee/spec/factories/geo/upload_registry.rb
+1
-1
ee/spec/factories/group_saml_identities.rb
ee/spec/factories/group_saml_identities.rb
+1
-1
ee/spec/factories/incident_management/project_incident_management_settings.rb
...cident_management/project_incident_management_settings.rb
+1
-1
ee/spec/factories/insights.rb
ee/spec/factories/insights.rb
+3
-3
ee/spec/factories/notes.rb
ee/spec/factories/notes.rb
+1
-1
ee/spec/factories/operations/feature_flag_scopes.rb
ee/spec/factories/operations/feature_flag_scopes.rb
+1
-1
ee/spec/factories/operations/feature_flags.rb
ee/spec/factories/operations/feature_flags.rb
+1
-1
ee/spec/factories/operations/feature_flags_clients.rb
ee/spec/factories/operations/feature_flags_clients.rb
+1
-1
ee/spec/factories/packages.rb
ee/spec/factories/packages.rb
+9
-9
ee/spec/factories/project_alerting_settings.rb
ee/spec/factories/project_alerting_settings.rb
+1
-1
ee/spec/factories/protected_branches/merge_access_levels.rb
ee/spec/factories/protected_branches/merge_access_levels.rb
+1
-1
ee/spec/factories/protected_branches/push_access_levels.rb
ee/spec/factories/protected_branches/push_access_levels.rb
+1
-1
ee/spec/factories/protected_branches/unprotect_access_levels.rb
...c/factories/protected_branches/unprotect_access_levels.rb
+1
-1
ee/spec/factories/protected_environments/deploy_access_levels.rb
.../factories/protected_environments/deploy_access_levels.rb
+1
-1
ee/spec/factories/protected_tags/create_access_levels.rb
ee/spec/factories/protected_tags/create_access_levels.rb
+1
-1
ee/spec/factories/software_license.rb
ee/spec/factories/software_license.rb
+1
-1
ee/spec/factories/software_license_policy.rb
ee/spec/factories/software_license_policy.rb
+1
-1
ee/spec/factories/spdx_catalogue.rb
ee/spec/factories/spdx_catalogue.rb
+1
-1
ee/spec/factories/spdx_license.rb
ee/spec/factories/spdx_license.rb
+1
-1
ee/spec/factories/user_ops_dashboard_project.rb
ee/spec/factories/user_ops_dashboard_project.rb
+1
-1
ee/spec/factories/vulnerabilities/feedback.rb
ee/spec/factories/vulnerabilities/feedback.rb
+1
-1
ee/spec/factories/vulnerabilities/identifiers.rb
ee/spec/factories/vulnerabilities/identifiers.rb
+1
-1
ee/spec/factories/vulnerabilities/issue_links.rb
ee/spec/factories/vulnerabilities/issue_links.rb
+1
-1
ee/spec/factories/vulnerabilities/occurrence_identifiers.rb
ee/spec/factories/vulnerabilities/occurrence_identifiers.rb
+1
-1
ee/spec/factories/vulnerabilities/occurrence_pipelines.rb
ee/spec/factories/vulnerabilities/occurrence_pipelines.rb
+1
-1
ee/spec/factories/vulnerabilities/occurrences.rb
ee/spec/factories/vulnerabilities/occurrences.rb
+1
-1
ee/spec/factories/vulnerabilities/scanners.rb
ee/spec/factories/vulnerabilities/scanners.rb
+1
-1
ee/spec/lib/ee/gitlab/auth/ldap/sync/groups_spec.rb
ee/spec/lib/ee/gitlab/auth/ldap/sync/groups_spec.rb
+1
-1
ee/spec/models/license_spec.rb
ee/spec/models/license_spec.rb
+3
-3
ee/spec/models/project_spec.rb
ee/spec/models/project_spec.rb
+3
-9
ee/spec/workers/elastic_namespace_rollout_worker_spec.rb
ee/spec/workers/elastic_namespace_rollout_worker_spec.rb
+1
-3
spec/controllers/autocomplete_controller_spec.rb
spec/controllers/autocomplete_controller_spec.rb
+1
-3
spec/factories/analytics/cycle_analytics/project_stages.rb
spec/factories/analytics/cycle_analytics/project_stages.rb
+1
-1
spec/factories/aws/roles.rb
spec/factories/aws/roles.rb
+1
-1
spec/factories/badge.rb
spec/factories/badge.rb
+2
-2
spec/factories/chat_names.rb
spec/factories/chat_names.rb
+1
-1
spec/factories/chat_teams.rb
spec/factories/chat_teams.rb
+1
-1
spec/factories/ci/bridge.rb
spec/factories/ci/bridge.rb
+1
-1
spec/factories/ci/build_need.rb
spec/factories/ci/build_need.rb
+1
-1
spec/factories/ci/build_trace_chunks.rb
spec/factories/ci/build_trace_chunks.rb
+1
-1
spec/factories/ci/build_trace_section_names.rb
spec/factories/ci/build_trace_section_names.rb
+1
-1
spec/factories/ci/builds.rb
spec/factories/ci/builds.rb
+1
-1
spec/factories/ci/group_variables.rb
spec/factories/ci/group_variables.rb
+1
-1
spec/factories/ci/job_artifacts.rb
spec/factories/ci/job_artifacts.rb
+1
-1
spec/factories/ci/job_variables.rb
spec/factories/ci/job_variables.rb
+1
-1
spec/factories/ci/pipeline_schedule.rb
spec/factories/ci/pipeline_schedule.rb
+1
-1
spec/factories/ci/pipeline_schedule_variables.rb
spec/factories/ci/pipeline_schedule_variables.rb
+1
-1
spec/factories/ci/pipeline_variables.rb
spec/factories/ci/pipeline_variables.rb
+1
-1
spec/factories/ci/pipelines.rb
spec/factories/ci/pipelines.rb
+1
-1
spec/factories/ci/resource.rb
spec/factories/ci/resource.rb
+1
-1
spec/factories/ci/resource_group.rb
spec/factories/ci/resource_group.rb
+1
-1
spec/factories/ci/runner_projects.rb
spec/factories/ci/runner_projects.rb
+1
-1
spec/factories/ci/runners.rb
spec/factories/ci/runners.rb
+1
-1
spec/factories/ci/sources/pipelines.rb
spec/factories/ci/sources/pipelines.rb
+1
-1
spec/factories/ci/stages.rb
spec/factories/ci/stages.rb
+2
-2
spec/factories/ci/trigger_requests.rb
spec/factories/ci/trigger_requests.rb
+1
-1
spec/factories/ci/triggers.rb
spec/factories/ci/triggers.rb
+1
-1
spec/factories/ci/variables.rb
spec/factories/ci/variables.rb
+1
-1
spec/factories/clusters/applications/helm.rb
spec/factories/clusters/applications/helm.rb
+9
-9
spec/factories/clusters/clusters.rb
spec/factories/clusters/clusters.rb
+1
-1
spec/factories/clusters/kubernetes_namespaces.rb
spec/factories/clusters/kubernetes_namespaces.rb
+1
-1
spec/factories/clusters/platforms/kubernetes.rb
spec/factories/clusters/platforms/kubernetes.rb
+1
-1
spec/factories/clusters/projects.rb
spec/factories/clusters/projects.rb
+1
-1
spec/factories/clusters/providers/aws.rb
spec/factories/clusters/providers/aws.rb
+1
-1
spec/factories/clusters/providers/gcp.rb
spec/factories/clusters/providers/gcp.rb
+1
-1
spec/factories/commit_statuses.rb
spec/factories/commit_statuses.rb
+2
-2
spec/factories/deployments.rb
spec/factories/deployments.rb
+1
-1
spec/factories/dev_ops_score_metrics.rb
spec/factories/dev_ops_score_metrics.rb
+1
-1
spec/factories/environments.rb
spec/factories/environments.rb
+1
-1
spec/factories/error_tracking/detailed_error.rb
spec/factories/error_tracking/detailed_error.rb
+1
-1
spec/factories/error_tracking/error.rb
spec/factories/error_tracking/error.rb
+1
-1
spec/factories/error_tracking/error_event.rb
spec/factories/error_tracking/error_event.rb
+1
-1
spec/factories/error_tracking/project.rb
spec/factories/error_tracking/project.rb
+1
-1
spec/factories/events.rb
spec/factories/events.rb
+1
-1
spec/factories/gitaly/commit.rb
spec/factories/gitaly/commit.rb
+1
-1
spec/factories/gitaly/commit_author.rb
spec/factories/gitaly/commit_author.rb
+1
-1
spec/factories/gitaly/tag.rb
spec/factories/gitaly/tag.rb
+1
-1
spec/factories/grafana_integrations.rb
spec/factories/grafana_integrations.rb
+1
-1
spec/factories/groups.rb
spec/factories/groups.rb
+1
-1
spec/factories/import_states.rb
spec/factories/import_states.rb
+1
-1
spec/factories/labels.rb
spec/factories/labels.rb
+1
-1
spec/factories/namespace/aggregation_schedules.rb
spec/factories/namespace/aggregation_schedules.rb
+1
-1
spec/factories/namespace/root_storage_statistics.rb
spec/factories/namespace/root_storage_statistics.rb
+1
-1
spec/factories/notes.rb
spec/factories/notes.rb
+10
-10
spec/factories/project_error_tracking_settings.rb
spec/factories/project_error_tracking_settings.rb
+1
-1
spec/factories/project_metrics_settings.rb
spec/factories/project_metrics_settings.rb
+1
-1
spec/factories/prometheus_metrics.rb
spec/factories/prometheus_metrics.rb
+1
-1
spec/factories/releases/link.rb
spec/factories/releases/link.rb
+1
-1
spec/factories/sentry_issue.rb
spec/factories/sentry_issue.rb
+1
-1
spec/factories/serverless/domain_cluster.rb
spec/factories/serverless/domain_cluster.rb
+1
-1
spec/factories/services.rb
spec/factories/services.rb
+1
-1
spec/factories/terms.rb
spec/factories/terms.rb
+1
-1
spec/factories/todos.rb
spec/factories/todos.rb
+1
-1
spec/features/boards/boards_spec.rb
spec/features/boards/boards_spec.rb
+2
-6
spec/features/instance_statistics/cohorts_spec.rb
spec/features/instance_statistics/cohorts_spec.rb
+1
-1
spec/features/issuables/issuable_list_spec.rb
spec/features/issuables/issuable_list_spec.rb
+1
-3
spec/finders/issues_finder_spec.rb
spec/finders/issues_finder_spec.rb
+1
-3
spec/models/concerns/each_batch_spec.rb
spec/models/concerns/each_batch_spec.rb
+1
-1
spec/models/concerns/issuable_spec.rb
spec/models/concerns/issuable_spec.rb
+1
-1
spec/models/project_spec.rb
spec/models/project_spec.rb
+2
-6
spec/models/trending_project_spec.rb
spec/models/trending_project_spec.rb
+2
-6
spec/requests/api/jobs_spec.rb
spec/requests/api/jobs_spec.rb
+1
-1
spec/requests/api/pipelines_spec.rb
spec/requests/api/pipelines_spec.rb
+1
-3
spec/views/search/_results.html.haml_spec.rb
spec/views/search/_results.html.haml_spec.rb
+1
-1
No files found.
.rubocop.yml
View file @
29714d78
...
...
@@ -301,12 +301,6 @@ RSpec/AnyInstanceOf:
Enabled
:
false
# Cops for upgrade to gitlab-styles 3.1.0
FactoryBot/FactoryClassName
:
Enabled
:
false
FactoryBot/CreateList
:
Enabled
:
false
Rails/SafeNavigationWithBlank
:
Enabled
:
false
...
...
ee/spec/factories/alerting/alert.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:alerting_alert
,
class:
Gitlab
::
Alerting
::
Alert
do
factory
:alerting_alert
,
class:
'Gitlab::Alerting::Alert'
do
project
payload
{
{}
}
...
...
ee/spec/factories/allowed_email_domains.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:allowed_email_domain
,
class:
AllowedEmailDomain
do
factory
:allowed_email_domain
,
class:
'AllowedEmailDomain'
do
domain
{
'gitlab.com'
}
group
end
...
...
ee/spec/factories/analytics/cycle_analytics/group_stages.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:cycle_analytics_group_stage
,
class:
Analytics
::
CycleAnalytics
::
GroupStage
do
factory
:cycle_analytics_group_stage
,
class:
'Analytics::CycleAnalytics::GroupStage'
do
sequence
(
:name
)
{
|
n
|
"Stage #
#{
n
}
"
}
start_event_identifier
{
Gitlab
::
Analytics
::
CycleAnalytics
::
StageEvents
::
MergeRequestCreated
.
identifier
}
end_event_identifier
{
Gitlab
::
Analytics
::
CycleAnalytics
::
StageEvents
::
MergeRequestMerged
.
identifier
}
...
...
ee/spec/factories/ci/builds.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ee_ci_build
,
class:
Ci
::
Build
,
parent: :ci_build
do
factory
:ee_ci_build
,
class:
'Ci::Build'
,
parent: :ci_build
do
trait
:protected_environment_failure
do
failed
failure_reason
{
Ci
::
Build
.
failure_reasons
[
:protected_environment_failure
]
}
...
...
ee/spec/factories/ci/job_artifacts.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ee_ci_job_artifact
,
class:
::
Ci
::
JobArtifact
,
parent: :ci_job_artifact
do
factory
:ee_ci_job_artifact
,
class:
'::Ci::JobArtifact'
,
parent: :ci_job_artifact
do
trait
:sast
do
file_type
{
:sast
}
file_format
{
:raw
}
...
...
ee/spec/factories/ci/pipelines.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ee_ci_pipeline
,
class:
Ci
::
Pipeline
,
parent: :ci_pipeline
do
factory
:ee_ci_pipeline
,
class:
'Ci::Pipeline'
,
parent: :ci_pipeline
do
trait
:webide
do
source
{
:webide
}
config_source
{
:webide_source
}
...
...
ee/spec/factories/ci/reports/license_scanning/dependency.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:license_scanning_dependency
,
class:
::
Gitlab
::
Ci
::
Reports
::
LicenseScanning
::
Dependency
do
factory
:license_scanning_dependency
,
class:
'::Gitlab::Ci::Reports::LicenseScanning::Dependency'
do
initialize_with
{
new
(
name
,
path:
path
)
}
trait
:rails
do
...
...
ee/spec/factories/ci/reports/license_scanning/license.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:license_scanning_license
,
class:
::
Gitlab
::
Ci
::
Reports
::
LicenseScanning
::
License
do
factory
:license_scanning_license
,
class:
'::Gitlab::Ci::Reports::LicenseScanning::License'
do
initialize_with
{
new
(
id:
id
,
name:
name
,
url:
url
)
}
trait
:mit
do
...
...
ee/spec/factories/ci/reports/license_scanning/report.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_reports_license_scanning_report
,
class:
::
Gitlab
::
Ci
::
Reports
::
LicenseScanning
::
Report
,
aliases:
[
:license_scan_report
]
do
factory
:ci_reports_license_scanning_report
,
class:
'::Gitlab::Ci::Reports::LicenseScanning::Report'
,
aliases:
[
:license_scan_report
]
do
trait
:version_1
do
version
{
'1.0'
}
end
...
...
ee/spec/factories/ci/reports/metrics/report.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_reports_metrics_report
,
class:
::
Gitlab
::
Ci
::
Reports
::
Metrics
::
Report
do
factory
:ci_reports_metrics_report
,
class:
'::Gitlab::Ci::Reports::Metrics::Report'
do
trait
:base_metrics
do
after
(
:build
)
do
|
report
,
_
|
report
.
add_metric
(
'metric_name'
,
'metric_value'
)
...
...
ee/spec/factories/ci/reports/security/aggregated_reports.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_reports_security_aggregated_reports
,
class:
::
Gitlab
::
Ci
::
Reports
::
Security
::
AggregatedReport
do
factory
:ci_reports_security_aggregated_reports
,
class:
'::Gitlab::Ci::Reports::Security::AggregatedReport'
do
reports
{
FactoryBot
.
build_list
(
:ci_reports_security_report
,
1
)
}
occurrences
{
FactoryBot
.
build_list
(
:ci_reports_security_occurrence
,
1
)
}
...
...
ee/spec/factories/ci/reports/security/identifiers.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_reports_security_identifier
,
class:
::
Gitlab
::
Ci
::
Reports
::
Security
::
Identifier
do
factory
:ci_reports_security_identifier
,
class:
'::Gitlab::Ci::Reports::Security::Identifier'
do
external_id
{
'PREDICTABLE_RANDOM'
}
external_type
{
'find_sec_bugs_type'
}
name
{
"
#{
external_type
}
-
#{
external_id
}
"
}
...
...
ee/spec/factories/ci/reports/security/locations/container_scanning.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_reports_security_locations_container_scanning
,
class:
::
Gitlab
::
Ci
::
Reports
::
Security
::
Locations
::
ContainerScanning
do
factory
:ci_reports_security_locations_container_scanning
,
class:
'::Gitlab::Ci::Reports::Security::Locations::ContainerScanning'
do
image
{
'registry.gitlab.com/my/project:latest'
}
operating_system
{
'debian:9'
}
package_name
{
'glibc'
}
...
...
ee/spec/factories/ci/reports/security/locations/dast.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_reports_security_locations_dast
,
class:
::
Gitlab
::
Ci
::
Reports
::
Security
::
Locations
::
Dast
do
factory
:ci_reports_security_locations_dast
,
class:
'::Gitlab::Ci::Reports::Security::Locations::Dast'
do
hostname
{
'my-app.com'
}
method_name
{
'GET'
}
param
{
'X-Content-Type-Options'
}
...
...
ee/spec/factories/ci/reports/security/locations/dependency_scanning.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_reports_security_locations_dependency_scanning
,
class:
::
Gitlab
::
Ci
::
Reports
::
Security
::
Locations
::
DependencyScanning
do
factory
:ci_reports_security_locations_dependency_scanning
,
class:
'::Gitlab::Ci::Reports::Security::Locations::DependencyScanning'
do
file_path
{
'app/pom.xml'
}
package_name
{
'io.netty/netty'
}
package_version
{
'1.2.3'
}
...
...
ee/spec/factories/ci/reports/security/locations/sast.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_reports_security_locations_sast
,
class:
::
Gitlab
::
Ci
::
Reports
::
Security
::
Locations
::
Sast
do
factory
:ci_reports_security_locations_sast
,
class:
'::Gitlab::Ci::Reports::Security::Locations::Sast'
do
file_path
{
'maven/src/main/java/com/gitlab/security_products/tests/App.java'
}
start_line
{
29
}
end_line
{
31
}
...
...
ee/spec/factories/ci/reports/security/occurrences.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_reports_security_occurrence
,
class:
::
Gitlab
::
Ci
::
Reports
::
Security
::
Occurrence
do
factory
:ci_reports_security_occurrence
,
class:
'::Gitlab::Ci::Reports::Security::Occurrence'
do
compare_key
{
"
#{
identifiers
.
first
.
external_type
}
:
#{
identifiers
.
first
.
external_id
}
:
#{
location
.
fingerprint
}
"
}
confidence
{
:medium
}
identifiers
{
Array
.
new
(
1
)
{
FactoryBot
.
build
(
:ci_reports_security_identifier
)
}
}
...
...
ee/spec/factories/ci/reports/security/reports.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_reports_security_report
,
class:
::
Gitlab
::
Ci
::
Reports
::
Security
::
Report
do
factory
:ci_reports_security_report
,
class:
'::Gitlab::Ci::Reports::Security::Report'
do
type
{
:sast
}
commit_sha
{
Digest
::
SHA1
.
hexdigest
(
SecureRandom
.
hex
)
}
created_at
{
2
.
weeks
.
ago
}
...
...
ee/spec/factories/ci/reports/security/scanners.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_reports_security_scanner
,
class:
::
Gitlab
::
Ci
::
Reports
::
Security
::
Scanner
do
factory
:ci_reports_security_scanner
,
class:
'::Gitlab::Ci::Reports::Security::Scanner'
do
external_id
{
'find_sec_bugs'
}
name
{
'Find Security Bugs'
}
...
...
ee/spec/factories/ci/subscriptions/projects.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_subscriptions_project
,
class:
Ci
::
Subscriptions
::
Project
do
factory
:ci_subscriptions_project
,
class:
'Ci::Subscriptions::Project'
do
downstream_project
factory: :project
upstream_project
factory:
[
:project
,
:public
]
end
...
...
ee/spec/factories/dependencies.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:dependency
,
class:
Hash
do
factory
:dependency
,
class:
'Hash'
do
sequence
(
:name
)
{
|
n
|
"library
#{
n
}
"
}
packager
{
'Ruby (Bundler)'
}
version
{
'1.8.0'
}
...
...
ee/spec/factories/dependency_proxy.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:dependency_proxy_blob
,
class:
DependencyProxy
::
Blob
do
factory
:dependency_proxy_blob
,
class:
'DependencyProxy::Blob'
do
group
file
{
fixture_file_upload
(
'ee/spec/fixtures/dependency_proxy/a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4.gz'
)
}
file_name
{
'a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4.gz'
}
...
...
ee/spec/factories/design_management/design_at_version.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:design_at_version
,
class:
DesignManagement
::
DesignAtVersion
do
factory
:design_at_version
,
class:
'DesignManagement::DesignAtVersion'
do
skip_create
# This is not an Active::Record model.
design
{
nil
}
...
...
ee/spec/factories/design_management/designs.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:design
,
class:
DesignManagement
::
Design
do
factory
:design
,
class:
'DesignManagement::Design'
do
issue
{
create
(
:issue
)
}
project
{
issue
&
.
project
||
create
(
:project
)
}
sequence
(
:filename
)
{
|
n
|
"homescreen-
#{
n
}
.jpg"
}
...
...
ee/spec/factories/design_management/versions.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:design_version
,
class:
DesignManagement
::
Version
do
factory
:design_version
,
class:
'DesignManagement::Version'
do
sequence
(
:sha
)
{
|
n
|
Digest
::
SHA1
.
hexdigest
(
"commit-like-
#{
n
}
"
)
}
issue
{
designs
.
first
&
.
issue
||
create
(
:issue
)
}
author
{
issue
&
.
author
||
create
(
:user
)
}
...
...
ee/spec/factories/doorkeeper.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:doorkeeper_access_grant
,
class:
Doorkeeper
::
AccessGrant
do
factory
:doorkeeper_access_grant
,
class:
'Doorkeeper::AccessGrant'
do
sequence
(
:resource_owner_id
)
{
|
n
|
n
}
association
:application
,
factory: :doorkeeper_application
redirect_uri
{
'https://app.com/callback'
}
...
...
@@ -9,7 +9,7 @@ FactoryBot.define do
scopes
{
'public write'
}
end
factory
:doorkeeper_access_token
,
class:
Doorkeeper
::
AccessToken
do
factory
:doorkeeper_access_token
,
class:
'Doorkeeper::AccessToken'
do
sequence
(
:resource_owner_id
)
{
|
n
|
n
}
association
:application
,
factory: :doorkeeper_application
expires_in
{
2
.
hours
}
...
...
@@ -19,7 +19,7 @@ FactoryBot.define do
end
end
factory
:doorkeeper_application
,
class:
Doorkeeper
::
Application
do
factory
:doorkeeper_application
,
class:
'Doorkeeper::Application'
do
sequence
(
:name
)
{
|
n
|
"Application
#{
n
}
"
}
redirect_uri
{
'https://app.com/callback'
}
end
...
...
ee/spec/factories/geo/container_repository_registry.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:container_repository_registry
,
class:
Geo
::
ContainerRepositoryRegistry
do
factory
:container_repository_registry
,
class:
'Geo::ContainerRepositoryRegistry'
do
container_repository
last_sync_failure
{
nil
}
last_synced_at
{
nil
}
...
...
ee/spec/factories/geo/design_registry.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:geo_design_registry
,
class:
Geo
::
DesignRegistry
do
factory
:geo_design_registry
,
class:
'Geo::DesignRegistry'
do
project
last_sync_failure
{
nil
}
last_synced_at
{
nil
}
...
...
ee/spec/factories/geo/event_log.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:geo_event_log
,
class:
Geo
::
EventLog
do
factory
:geo_event_log
,
class:
'Geo::EventLog'
do
trait
:created_event
do
repository_created_event
factory: :geo_repository_created_event
end
...
...
@@ -55,7 +55,7 @@ FactoryBot.define do
end
end
factory
:geo_repository_created_event
,
class:
Geo
::
RepositoryCreatedEvent
do
factory
:geo_repository_created_event
,
class:
'Geo::RepositoryCreatedEvent'
do
project
repository_storage_name
{
project
.
repository_storage
}
...
...
@@ -64,7 +64,7 @@ FactoryBot.define do
wiki_path
{
project
.
wiki
.
disk_path
}
end
factory
:geo_repository_updated_event
,
class:
Geo
::
RepositoryUpdatedEvent
do
factory
:geo_repository_updated_event
,
class:
'Geo::RepositoryUpdatedEvent'
do
project
source
{
Geo
::
RepositoryUpdatedEvent
::
REPOSITORY
}
...
...
@@ -72,7 +72,7 @@ FactoryBot.define do
tags_affected
{
0
}
end
factory
:geo_design_repository_updated_event
,
class:
Geo
::
RepositoryUpdatedEvent
do
factory
:geo_design_repository_updated_event
,
class:
'Geo::RepositoryUpdatedEvent'
do
project
source
{
Geo
::
RepositoryUpdatedEvent
::
DESIGN
}
...
...
@@ -80,7 +80,7 @@ FactoryBot.define do
tags_affected
{
0
}
end
factory
:geo_repository_deleted_event
,
class:
Geo
::
RepositoryDeletedEvent
do
factory
:geo_repository_deleted_event
,
class:
'Geo::RepositoryDeletedEvent'
do
project
repository_storage_name
{
project
.
repository_storage
}
...
...
@@ -88,11 +88,11 @@ FactoryBot.define do
deleted_project_name
{
project
.
name
}
end
factory
:geo_repositories_changed_event
,
class:
Geo
::
RepositoriesChangedEvent
do
factory
:geo_repositories_changed_event
,
class:
'Geo::RepositoriesChangedEvent'
do
geo_node
end
factory
:geo_repository_renamed_event
,
class:
Geo
::
RepositoryRenamedEvent
do
factory
:geo_repository_renamed_event
,
class:
'Geo::RepositoryRenamedEvent'
do
project
{
create
(
:project
,
:repository
)
}
repository_storage_name
{
project
.
repository_storage
}
...
...
@@ -104,7 +104,7 @@ FactoryBot.define do
new_path
{
project
.
path
+
'_new'
}
end
factory
:geo_hashed_storage_migrated_event
,
class:
Geo
::
HashedStorageMigratedEvent
do
factory
:geo_hashed_storage_migrated_event
,
class:
'Geo::HashedStorageMigratedEvent'
do
project
{
create
(
:project
,
:repository
)
}
repository_storage_name
{
project
.
repository_storage
}
...
...
@@ -115,14 +115,14 @@ FactoryBot.define do
new_storage_version
{
Project
::
HASHED_STORAGE_FEATURES
[
:repository
]
}
end
factory
:geo_hashed_storage_attachments_event
,
class:
Geo
::
HashedStorageAttachmentsEvent
do
factory
:geo_hashed_storage_attachments_event
,
class:
'Geo::HashedStorageAttachmentsEvent'
do
project
{
create
(
:project
,
:repository
)
}
old_attachments_path
{
Storage
::
LegacyProject
.
new
(
project
).
disk_path
}
new_attachments_path
{
Storage
::
HashedProject
.
new
(
project
).
disk_path
}
end
factory
:geo_lfs_object_deleted_event
,
class:
Geo
::
LfsObjectDeletedEvent
do
factory
:geo_lfs_object_deleted_event
,
class:
'Geo::LfsObjectDeletedEvent'
do
lfs_object
{
create
(
:lfs_object
,
:with_file
)
}
after
(
:build
,
:stub
)
do
|
event
,
_
|
...
...
@@ -134,7 +134,7 @@ FactoryBot.define do
end
end
factory
:geo_job_artifact_deleted_event
,
class:
Geo
::
JobArtifactDeletedEvent
do
factory
:geo_job_artifact_deleted_event
,
class:
'Geo::JobArtifactDeletedEvent'
do
job_artifact
{
create
(
:ci_job_artifact
,
:archive
)
}
after
(
:build
,
:stub
)
do
|
event
,
_
|
...
...
@@ -145,7 +145,7 @@ FactoryBot.define do
end
end
factory
:geo_upload_deleted_event
,
class:
Geo
::
UploadDeletedEvent
do
factory
:geo_upload_deleted_event
,
class:
'Geo::UploadDeletedEvent'
do
upload
{
create
(
:upload
)
}
file_path
{
upload
.
path
}
model_id
{
upload
.
model_id
}
...
...
@@ -165,15 +165,15 @@ FactoryBot.define do
end
end
factory
:geo_reset_checksum_event
,
class:
Geo
::
ResetChecksumEvent
do
factory
:geo_reset_checksum_event
,
class:
'Geo::ResetChecksumEvent'
do
project
end
factory
:geo_cache_invalidation_event
,
class:
Geo
::
CacheInvalidationEvent
do
factory
:geo_cache_invalidation_event
,
class:
'Geo::CacheInvalidationEvent'
do
sequence
(
:key
)
{
|
n
|
"cache-key-
#{
n
}
"
}
end
factory
:geo_container_repository_updated_event
,
class:
Geo
::
ContainerRepositoryUpdatedEvent
do
factory
:geo_container_repository_updated_event
,
class:
'Geo::ContainerRepositoryUpdatedEvent'
do
container_repository
end
end
ee/spec/factories/geo/event_log_state.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:geo_event_log_state
,
class:
Geo
::
EventLogState
do
factory
:geo_event_log_state
,
class:
'Geo::EventLogState'
do
sequence
(
:event_id
)
end
end
ee/spec/factories/geo/job_artifact_registry.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:geo_job_artifact_registry
,
class:
Geo
::
JobArtifactRegistry
do
factory
:geo_job_artifact_registry
,
class:
'Geo::JobArtifactRegistry'
do
sequence
(
:artifact_id
)
success
{
true
}
...
...
ee/spec/factories/geo/lfs_object_registry.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:geo_lfs_object_registry
,
class:
Geo
::
LfsObjectRegistry
do
factory
:geo_lfs_object_registry
,
class:
'Geo::LfsObjectRegistry'
do
sequence
(
:lfs_object_id
)
success
{
true
}
...
...
ee/spec/factories/geo/project_registry.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:geo_project_registry
,
class:
Geo
::
ProjectRegistry
do
factory
:geo_project_registry
,
class:
'Geo::ProjectRegistry'
do
project
last_repository_synced_at
{
nil
}
last_repository_successful_sync_at
{
nil
}
...
...
ee/spec/factories/geo/upload_registry.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:geo_upload_registry
,
class:
Geo
::
UploadRegistry
do
factory
:geo_upload_registry
,
class:
'Geo::UploadRegistry'
do
sequence
(
:file_id
)
file_type
{
:file
}
success
{
true
}
...
...
ee/spec/factories/group_saml_identities.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:group_saml_identity
,
class:
Identity
,
parent: :identity
do
factory
:group_saml_identity
,
class:
'Identity'
,
parent: :identity
do
provider
{
'group_saml'
}
extern_uid
{
generate
(
:username
)
}
saml_provider
...
...
ee/spec/factories/incident_management/project_incident_management_settings.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:project_incident_management_setting
,
class:
IncidentManagement
::
ProjectIncidentManagementSetting
do
factory
:project_incident_management_setting
,
class:
'IncidentManagement::ProjectIncidentManagementSetting'
do
project
create_issue
{
false
}
issue_template_key
{
nil
}
...
...
ee/spec/factories/insights.rb
View file @
29714d78
...
...
@@ -6,7 +6,7 @@ FactoryBot.define do
project
end
factory
:insights_issues_by_team
,
class:
Hash
do
factory
:insights_issues_by_team
,
class:
'Hash'
do
initialize_with
do
{
Manage
:
1
,
...
...
@@ -17,7 +17,7 @@ FactoryBot.define do
end
end
factory
:insights_merge_requests_per_month
,
class:
Hash
do
factory
:insights_merge_requests_per_month
,
class:
'Hash'
do
initialize_with
do
{
'January 2019'
=>
1
,
...
...
@@ -27,7 +27,7 @@ FactoryBot.define do
end
end
factory
:insights_issues_by_team_per_month
,
class:
Hash
do
factory
:insights_issues_by_team_per_month
,
class:
'Hash'
do
initialize_with
do
{
'January 2019'
=>
{
...
...
ee/spec/factories/notes.rb
View file @
29714d78
...
...
@@ -20,7 +20,7 @@ end
FactoryBot
.
define
do
factory
:note_on_epic
,
parent: :note
,
traits:
[
:on_epic
]
factory
:diff_note_on_design
,
parent: :note
,
traits:
[
:on_design
],
class:
DiffNote
do
factory
:diff_note_on_design
,
parent: :note
,
traits:
[
:on_design
],
class:
'DiffNote'
do
position
do
Gitlab
::
Diff
::
Position
.
new
(
old_path:
noteable
.
full_path
,
...
...
ee/spec/factories/operations/feature_flag_scopes.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:operations_feature_flag_scope
,
class:
Operations
::
FeatureFlagScope
do
factory
:operations_feature_flag_scope
,
class:
'Operations::FeatureFlagScope'
do
association
:feature_flag
,
factory: :operations_feature_flag
active
{
true
}
strategies
{
[{
name:
"default"
,
parameters:
{}
}]
}
...
...
ee/spec/factories/operations/feature_flags.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:operations_feature_flag
,
class:
Operations
::
FeatureFlag
do
factory
:operations_feature_flag
,
class:
'Operations::FeatureFlag'
do
sequence
(
:name
)
{
|
n
|
"feature_flag_
#{
n
}
"
}
project
active
{
true
}
...
...
ee/spec/factories/operations/feature_flags_clients.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:operations_feature_flags_client
,
class:
Operations
::
FeatureFlagsClient
do
factory
:operations_feature_flags_client
,
class:
'Operations::FeatureFlagsClient'
do
project
end
end
ee/spec/factories/packages.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:package
,
class:
Packages
::
Package
do
factory
:package
,
class:
'Packages::Package'
do
project
name
{
'my/company/app/my-app'
}
sequence
(
:version
)
{
|
n
|
"1.
#{
n
}
-SNAPSHOT"
}
...
...
@@ -65,10 +65,10 @@ FactoryBot.define do
end
end
factory
:package_build_info
,
class:
Packages
::
BuildInfo
do
factory
:package_build_info
,
class:
'Packages::BuildInfo'
do
end
factory
:package_file
,
class:
Packages
::
PackageFile
do
factory
:package_file
,
class:
'Packages::PackageFile'
do
package
factory
:conan_package_file
do
...
...
@@ -175,7 +175,7 @@ FactoryBot.define do
end
end
factory
:maven_metadatum
,
class:
Packages
::
MavenMetadatum
do
factory
:maven_metadatum
,
class:
'Packages::MavenMetadatum'
do
package
path
{
'my/company/app/my-app/1.0-SNAPSHOT'
}
app_group
{
'my.company.app'
}
...
...
@@ -183,13 +183,13 @@ FactoryBot.define do
app_version
{
'1.0-SNAPSHOT'
}
end
factory
:conan_metadatum
,
class:
Packages
::
ConanMetadatum
do
factory
:conan_metadatum
,
class:
'Packages::ConanMetadatum'
do
package
package_username
{
'username'
}
package_channel
{
'stable'
}
end
factory
:conan_file_metadatum
,
class:
Packages
::
ConanFileMetadatum
do
factory
:conan_file_metadatum
,
class:
'Packages::ConanFileMetadatum'
do
package_file
recipe_revision
{
'0'
}
...
...
@@ -204,18 +204,18 @@ FactoryBot.define do
end
end
factory
:packages_dependency
,
class:
Packages
::
Dependency
do
factory
:packages_dependency
,
class:
'Packages::Dependency'
do
sequence
(
:name
)
{
|
n
|
"@test/package-
#{
n
}
"
}
sequence
(
:version_pattern
)
{
|
n
|
"~6.2.
#{
n
}
"
}
end
factory
:packages_dependency_link
,
class:
Packages
::
DependencyLink
do
factory
:packages_dependency_link
,
class:
'Packages::DependencyLink'
do
package
dependency
{
create
(
:packages_dependency
)
}
dependency_type
{
:dependencies
}
end
factory
:packages_tag
,
class:
Packages
::
Tag
do
factory
:packages_tag
,
class:
'Packages::Tag'
do
package
sequence
(
:name
)
{
|
n
|
"tag-
#{
n
}
"
}
end
...
...
ee/spec/factories/project_alerting_settings.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:project_alerting_setting
,
class:
Alerting
::
ProjectAlertingSetting
do
factory
:project_alerting_setting
,
class:
'Alerting::ProjectAlertingSetting'
do
project
token
{
'access_token_123'
}
end
...
...
ee/spec/factories/protected_branches/merge_access_levels.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:protected_branch_merge_access_level
,
class:
ProtectedBranch
::
MergeAccessLevel
do
factory
:protected_branch_merge_access_level
,
class:
'ProtectedBranch::MergeAccessLevel'
do
user
{
nil
}
group
{
nil
}
protected_branch
...
...
ee/spec/factories/protected_branches/push_access_levels.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:protected_branch_push_access_level
,
class:
ProtectedBranch
::
PushAccessLevel
do
factory
:protected_branch_push_access_level
,
class:
'ProtectedBranch::PushAccessLevel'
do
user
{
nil
}
group
{
nil
}
protected_branch
...
...
ee/spec/factories/protected_branches/unprotect_access_levels.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:protected_branch_unprotect_access_level
,
class:
ProtectedBranch
::
UnprotectAccessLevel
do
factory
:protected_branch_unprotect_access_level
,
class:
'ProtectedBranch::UnprotectAccessLevel'
do
user
{
nil
}
group
{
nil
}
protected_branch
...
...
ee/spec/factories/protected_environments/deploy_access_levels.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:protected_environment_deploy_access_level
,
class:
ProtectedEnvironment
::
DeployAccessLevel
do
factory
:protected_environment_deploy_access_level
,
class:
'ProtectedEnvironment::DeployAccessLevel'
do
user
{
nil
}
group
{
nil
}
protected_environment
...
...
ee/spec/factories/protected_tags/create_access_levels.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:protected_tag_create_access_level
,
class:
ProtectedTag
::
CreateAccessLevel
do
factory
:protected_tag_create_access_level
,
class:
'ProtectedTag::CreateAccessLevel'
do
user
{
nil
}
group
{
nil
}
protected_tag
...
...
ee/spec/factories/software_license.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:software_license
,
class:
SoftwareLicense
do
factory
:software_license
,
class:
'SoftwareLicense'
do
sequence
(
:name
)
{
|
n
|
"SOFTWARE-LICENSE-2.7/example_
#{
n
}
"
}
trait
:mit
do
...
...
ee/spec/factories/software_license_policy.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:software_license_policy
,
class:
SoftwareLicensePolicy
do
factory
:software_license_policy
,
class:
'SoftwareLicensePolicy'
do
classification
{
:allowed
}
project
software_license
...
...
ee/spec/factories/spdx_catalogue.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:spdx_catalogue
,
class:
::
Gitlab
::
SPDX
::
Catalogue
do
factory
:spdx_catalogue
,
class:
'::Gitlab::SPDX::Catalogue'
do
initialize_with
do
content
=
IO
.
read
(
Rails
.
root
.
join
(
'spec'
,
'fixtures'
,
'spdx.json'
))
::
Gitlab
::
SPDX
::
Catalogue
.
new
(
JSON
.
parse
(
content
,
symbolize_names:
true
))
...
...
ee/spec/factories/spdx_license.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:spdx_license
,
class:
::
Gitlab
::
SPDX
::
License
do
factory
:spdx_license
,
class:
'::Gitlab::SPDX::License'
do
id
{
|
n
|
"License-
#{
n
}
"
}
name
{
|
n
|
"License
#{
n
}
"
}
...
...
ee/spec/factories/user_ops_dashboard_project.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:users_ops_dashboard_project
,
class:
UsersOpsDashboardProject
do
factory
:users_ops_dashboard_project
,
class:
'UsersOpsDashboardProject'
do
user
factory: :user
project
factory: :project
end
...
...
ee/spec/factories/vulnerabilities/feedback.rb
View file @
29714d78
...
...
@@ -7,7 +7,7 @@ FactoryBot.define do
Digest
::
SHA1
.
hexdigest
n
.
to_s
end
factory
:vulnerability_feedback
,
class:
Vulnerabilities
::
Feedback
do
factory
:vulnerability_feedback
,
class:
'Vulnerabilities::Feedback'
do
project
author
issue
{
nil
}
...
...
ee/spec/factories/vulnerabilities/identifiers.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:vulnerabilities_identifier
,
class:
Vulnerabilities
::
Identifier
do
factory
:vulnerabilities_identifier
,
class:
'Vulnerabilities::Identifier'
do
external_type
{
'CVE'
}
external_id
{
'CVE-2018-1234'
}
fingerprint
{
'52d084cede3db8fafcd6b8ae382ddf1970da3b7f'
}
...
...
ee/spec/factories/vulnerabilities/issue_links.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:vulnerabilities_issue_link
,
class:
Vulnerabilities
::
IssueLink
do
factory
:vulnerabilities_issue_link
,
class:
'Vulnerabilities::IssueLink'
do
vulnerability
issue
...
...
ee/spec/factories/vulnerabilities/occurrence_identifiers.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:vulnerabilities_occurrence_identifier
,
class:
Vulnerabilities
::
OccurrenceIdentifier
do
factory
:vulnerabilities_occurrence_identifier
,
class:
'Vulnerabilities::OccurrenceIdentifier'
do
occurrence
factory: :vulnerabilities_occurrence
identifier
factory: :vulnerabilities_identifier
end
...
...
ee/spec/factories/vulnerabilities/occurrence_pipelines.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:vulnerabilities_occurrence_pipeline
,
class:
Vulnerabilities
::
OccurrencePipeline
do
factory
:vulnerabilities_occurrence_pipeline
,
class:
'Vulnerabilities::OccurrencePipeline'
do
occurrence
factory: :vulnerabilities_occurrence
pipeline
factory: :ci_pipeline
end
...
...
ee/spec/factories/vulnerabilities/occurrences.rb
View file @
29714d78
...
...
@@ -5,7 +5,7 @@ FactoryBot.define do
Digest
::
SHA1
.
hexdigest
(
"uuid-
#{
n
}
"
)[
0
..
35
]
end
factory
:vulnerabilities_occurrence
,
class:
Vulnerabilities
::
Occurrence
,
aliases:
[
:vulnerabilities_finding
]
do
factory
:vulnerabilities_occurrence
,
class:
'Vulnerabilities::Occurrence'
,
aliases:
[
:vulnerabilities_finding
]
do
name
{
'Cipher with no integrity'
}
project
sequence
(
:uuid
)
{
generate
(
:vulnerability_occurrence_uuid
)
}
...
...
ee/spec/factories/vulnerabilities/scanners.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:vulnerabilities_scanner
,
class:
Vulnerabilities
::
Scanner
do
factory
:vulnerabilities_scanner
,
class:
'Vulnerabilities::Scanner'
do
external_id
{
'find_sec_bugs'
}
name
{
'Find Security Bugs'
}
project
...
...
ee/spec/lib/ee/gitlab/auth/ldap/sync/groups_spec.rb
View file @
29714d78
...
...
@@ -14,7 +14,7 @@ describe EE::Gitlab::Auth::LDAP::Sync::Groups do
allow
(
EE
::
Gitlab
::
Auth
::
LDAP
::
Sync
::
AdminUsers
).
to
receive
(
:execute
)
allow
(
EE
::
Gitlab
::
Auth
::
LDAP
::
Sync
::
ExternalUsers
).
to
receive
(
:execute
)
2
.
times
{
create
(
:group_with_ldap_group_link
)
}
create_list
(
:group_with_ldap_group_link
,
2
)
end
after
do
...
...
ee/spec/models/license_spec.rb
View file @
29714d78
...
...
@@ -171,7 +171,7 @@ describe License do
context
'but active users exceeds restricted user count'
do
it
'is invalid'
do
6
.
times
{
create
(
:user
)
}
create_list
(
:user
,
6
)
expect
(
license
).
not_to
be_valid
end
...
...
@@ -192,14 +192,14 @@ describe License do
end
it
'uses current active user count to calculate the expected true-up'
do
3
.
times
{
create
(
:user
)
}
create_list
(
:user
,
3
)
expect
(
license
).
to
be_valid
end
context
'with wrong true-up quantity'
do
it
'is invalid'
do
2
.
times
{
create
(
:user
)
}
create_list
(
:user
,
2
)
expect
(
license
).
not_to
be_valid
end
...
...
ee/spec/models/project_spec.rb
View file @
29714d78
...
...
@@ -2375,15 +2375,9 @@ describe Project do
group2
.
update
(
custom_project_templates_group_id:
group2_sub2
.
id
)
create
(
:project
,
group:
group1
)
2
.
times
do
create
(
:project
,
group:
group2
)
end
3
.
times
do
create
(
:project
,
group:
group2_sub1
)
end
4
.
times
do
create
(
:project
,
group:
group2_sub2
)
end
create_list
(
:project
,
2
,
group:
group2
)
create_list
(
:project
,
3
,
group:
group2_sub1
)
create_list
(
:project
,
4
,
group:
group2_sub2
)
end
it
'counts instance level templates'
do
...
...
ee/spec/workers/elastic_namespace_rollout_worker_spec.rb
View file @
29714d78
...
...
@@ -13,9 +13,7 @@ describe ElasticNamespaceRolloutWorker do
before_all
do
Plan
::
PAID_HOSTED_PLANS
.
each
do
|
plan
|
4
.
times
do
create
(
:gitlab_subscription
,
hosted_plan:
public_send
(
"
#{
plan
}
_plan"
))
end
create_list
(
:gitlab_subscription
,
4
,
hosted_plan:
public_send
(
"
#{
plan
}
_plan"
))
end
end
...
...
spec/controllers/autocomplete_controller_spec.rb
View file @
29714d78
...
...
@@ -112,9 +112,7 @@ describe AutocompleteController do
context
'limited users per page'
do
before
do
25
.
times
do
create
(
:user
)
end
create_list
(
:user
,
25
)
sign_in
(
user
)
get
(
:users
)
...
...
spec/factories/analytics/cycle_analytics/project_stages.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:cycle_analytics_project_stage
,
class:
Analytics
::
CycleAnalytics
::
ProjectStage
do
factory
:cycle_analytics_project_stage
,
class:
'Analytics::CycleAnalytics::ProjectStage'
do
project
sequence
(
:name
)
{
|
n
|
"Stage #
#{
n
}
"
}
hidden
{
false
}
...
...
spec/factories/aws/roles.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:aws_role
,
class:
Aws
::
Role
do
factory
:aws_role
,
class:
'Aws::Role'
do
user
role_arn
{
'arn:aws:iam::123456789012:role/role-name'
}
...
...
spec/factories/badge.rb
View file @
29714d78
...
...
@@ -6,11 +6,11 @@ FactoryBot.define do
image_url
{
generate
(
:url
)
}
end
factory
:project_badge
,
traits:
[
:base_badge
],
class:
ProjectBadge
do
factory
:project_badge
,
traits:
[
:base_badge
],
class:
'ProjectBadge'
do
project
end
factory
:group_badge
,
aliases:
[
:badge
],
traits:
[
:base_badge
],
class:
GroupBadge
do
factory
:group_badge
,
aliases:
[
:badge
],
traits:
[
:base_badge
],
class:
'GroupBadge'
do
group
end
end
spec/factories/chat_names.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:chat_name
,
class:
ChatName
do
factory
:chat_name
,
class:
'ChatName'
do
user
factory: :user
service
factory: :service
...
...
spec/factories/chat_teams.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:chat_team
,
class:
ChatTeam
do
factory
:chat_team
,
class:
'ChatTeam'
do
sequence
(
:team_id
)
{
|
n
|
"abcdefghijklm
#{
n
}
"
}
namespace
factory: :group
end
...
...
spec/factories/ci/bridge.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_bridge
,
class:
Ci
::
Bridge
do
factory
:ci_bridge
,
class:
'Ci::Bridge'
do
name
{
'bridge'
}
stage
{
'test'
}
stage_idx
{
0
}
...
...
spec/factories/ci/build_need.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_build_need
,
class:
Ci
::
BuildNeed
do
factory
:ci_build_need
,
class:
'Ci::BuildNeed'
do
build
factory: :ci_build
sequence
(
:name
)
{
|
n
|
"build_
#{
n
}
"
}
end
...
...
spec/factories/ci/build_trace_chunks.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_build_trace_chunk
,
class:
Ci
::
BuildTraceChunk
do
factory
:ci_build_trace_chunk
,
class:
'Ci::BuildTraceChunk'
do
build
factory: :ci_build
chunk_index
{
0
}
data_store
{
:redis
}
...
...
spec/factories/ci/build_trace_section_names.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_build_trace_section_name
,
class:
Ci
::
BuildTraceSectionName
do
factory
:ci_build_trace_section_name
,
class:
'Ci::BuildTraceSectionName'
do
sequence
(
:name
)
{
|
n
|
"section_
#{
n
}
"
}
project
factory: :project
end
...
...
spec/factories/ci/builds.rb
View file @
29714d78
...
...
@@ -3,7 +3,7 @@
include
ActionDispatch
::
TestProcess
FactoryBot
.
define
do
factory
:ci_build
,
class:
Ci
::
Build
do
factory
:ci_build
,
class:
'Ci::Build'
do
name
{
'test'
}
stage
{
'test'
}
stage_idx
{
0
}
...
...
spec/factories/ci/group_variables.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_group_variable
,
class:
Ci
::
GroupVariable
do
factory
:ci_group_variable
,
class:
'Ci::GroupVariable'
do
sequence
(
:key
)
{
|
n
|
"VARIABLE_
#{
n
}
"
}
value
{
'VARIABLE_VALUE'
}
masked
{
false
}
...
...
spec/factories/ci/job_artifacts.rb
View file @
29714d78
...
...
@@ -3,7 +3,7 @@
include
ActionDispatch
::
TestProcess
FactoryBot
.
define
do
factory
:ci_job_artifact
,
class:
Ci
::
JobArtifact
do
factory
:ci_job_artifact
,
class:
'Ci::JobArtifact'
do
job
factory: :ci_build
file_type
{
:archive
}
file_format
{
:zip
}
...
...
spec/factories/ci/job_variables.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_job_variable
,
class:
Ci
::
JobVariable
do
factory
:ci_job_variable
,
class:
'Ci::JobVariable'
do
sequence
(
:key
)
{
|
n
|
"VARIABLE_
#{
n
}
"
}
value
{
'VARIABLE_VALUE'
}
...
...
spec/factories/ci/pipeline_schedule.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_pipeline_schedule
,
class:
Ci
::
PipelineSchedule
do
factory
:ci_pipeline_schedule
,
class:
'Ci::PipelineSchedule'
do
cron
{
'0 1 * * *'
}
cron_timezone
{
Gitlab
::
Ci
::
CronParser
::
VALID_SYNTAX_SAMPLE_TIME_ZONE
}
ref
{
'master'
}
...
...
spec/factories/ci/pipeline_schedule_variables.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_pipeline_schedule_variable
,
class:
Ci
::
PipelineScheduleVariable
do
factory
:ci_pipeline_schedule_variable
,
class:
'Ci::PipelineScheduleVariable'
do
sequence
(
:key
)
{
|
n
|
"VARIABLE_
#{
n
}
"
}
value
{
'VARIABLE_VALUE'
}
variable_type
{
'env_var'
}
...
...
spec/factories/ci/pipeline_variables.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_pipeline_variable
,
class:
Ci
::
PipelineVariable
do
factory
:ci_pipeline_variable
,
class:
'Ci::PipelineVariable'
do
sequence
(
:key
)
{
|
n
|
"VARIABLE_
#{
n
}
"
}
value
{
'VARIABLE_VALUE'
}
...
...
spec/factories/ci/pipelines.rb
View file @
29714d78
...
...
@@ -2,7 +2,7 @@
FactoryBot
.
define
do
# TODO: we can remove this factory in favour of :ci_pipeline
factory
:ci_empty_pipeline
,
class:
Ci
::
Pipeline
do
factory
:ci_empty_pipeline
,
class:
'Ci::Pipeline'
do
source
{
:push
}
ref
{
'master'
}
sha
{
'97de212e80737a608d939f648d959671fb0a0142'
}
...
...
spec/factories/ci/resource.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_resource
,
class:
Ci
::
Resource
do
factory
:ci_resource
,
class:
'Ci::Resource'
do
resource_group
factory: :ci_resource_group
trait
(
:retained
)
do
...
...
spec/factories/ci/resource_group.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_resource_group
,
class:
Ci
::
ResourceGroup
do
factory
:ci_resource_group
,
class:
'Ci::ResourceGroup'
do
project
sequence
(
:key
)
{
|
n
|
"IOS_
#{
n
}
"
}
end
...
...
spec/factories/ci/runner_projects.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_runner_project
,
class:
Ci
::
RunnerProject
do
factory
:ci_runner_project
,
class:
'Ci::RunnerProject'
do
runner
factory:
[
:ci_runner
,
:project
]
project
end
...
...
spec/factories/ci/runners.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_runner
,
class:
Ci
::
Runner
do
factory
:ci_runner
,
class:
'Ci::Runner'
do
sequence
(
:description
)
{
|
n
|
"My runner
#{
n
}
"
}
platform
{
"darwin"
}
...
...
spec/factories/ci/sources/pipelines.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_sources_pipeline
,
class:
Ci
::
Sources
::
Pipeline
do
factory
:ci_sources_pipeline
,
class:
'Ci::Sources::Pipeline'
do
after
(
:build
)
do
|
source
|
source
.
project
||=
source
.
pipeline
.
project
source
.
source_pipeline
||=
source
.
source_job
.
pipeline
...
...
spec/factories/ci/stages.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_stage
,
class:
Ci
::
LegacyStage
do
factory
:ci_stage
,
class:
'Ci::LegacyStage'
do
skip_create
transient
do
...
...
@@ -18,7 +18,7 @@ FactoryBot.define do
end
end
factory
:ci_stage_entity
,
class:
Ci
::
Stage
do
factory
:ci_stage_entity
,
class:
'Ci::Stage'
do
project
factory: :project
pipeline
factory: :ci_empty_pipeline
...
...
spec/factories/ci/trigger_requests.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_trigger_request
,
class:
Ci
::
TriggerRequest
do
factory
:ci_trigger_request
,
class:
'Ci::TriggerRequest'
do
trigger
factory: :ci_trigger
end
end
spec/factories/ci/triggers.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_trigger_without_token
,
class:
Ci
::
Trigger
do
factory
:ci_trigger_without_token
,
class:
'Ci::Trigger'
do
owner
factory
:ci_trigger
do
...
...
spec/factories/ci/variables.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:ci_variable
,
class:
Ci
::
Variable
do
factory
:ci_variable
,
class:
'Ci::Variable'
do
sequence
(
:key
)
{
|
n
|
"VARIABLE_
#{
n
}
"
}
value
{
'VARIABLE_VALUE'
}
masked
{
false
}
...
...
spec/factories/clusters/applications/helm.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:clusters_applications_helm
,
class:
Clusters
::
Applications
::
Helm
do
factory
:clusters_applications_helm
,
class:
'Clusters::Applications::Helm'
do
cluster
factory:
%i(cluster provided_by_gcp)
before
(
:create
)
do
...
...
@@ -70,40 +70,40 @@ FactoryBot.define do
updated_at
{
ClusterWaitForAppInstallationWorker
::
TIMEOUT
.
ago
}
end
factory
:clusters_applications_ingress
,
class:
Clusters
::
Applications
::
Ingress
do
factory
:clusters_applications_ingress
,
class:
'Clusters::Applications::Ingress'
do
modsecurity_enabled
{
false
}
cluster
factory:
%i(cluster with_installed_helm provided_by_gcp)
end
factory
:clusters_applications_cert_manager
,
class:
Clusters
::
Applications
::
CertManager
do
factory
:clusters_applications_cert_manager
,
class:
'Clusters::Applications::CertManager'
do
email
{
'admin@example.com'
}
cluster
factory:
%i(cluster with_installed_helm provided_by_gcp)
end
factory
:clusters_applications_elastic_stack
,
class:
Clusters
::
Applications
::
ElasticStack
do
factory
:clusters_applications_elastic_stack
,
class:
'Clusters::Applications::ElasticStack'
do
cluster
factory:
%i(cluster with_installed_helm provided_by_gcp)
end
factory
:clusters_applications_crossplane
,
class:
Clusters
::
Applications
::
Crossplane
do
factory
:clusters_applications_crossplane
,
class:
'Clusters::Applications::Crossplane'
do
stack
{
'gcp'
}
cluster
factory:
%i(cluster with_installed_helm provided_by_gcp)
end
factory
:clusters_applications_prometheus
,
class:
Clusters
::
Applications
::
Prometheus
do
factory
:clusters_applications_prometheus
,
class:
'Clusters::Applications::Prometheus'
do
cluster
factory:
%i(cluster with_installed_helm provided_by_gcp)
end
factory
:clusters_applications_runner
,
class:
Clusters
::
Applications
::
Runner
do
factory
:clusters_applications_runner
,
class:
'Clusters::Applications::Runner'
do
runner
factory:
%i(ci_runner)
cluster
factory:
%i(cluster with_installed_helm provided_by_gcp)
end
factory
:clusters_applications_knative
,
class:
Clusters
::
Applications
::
Knative
do
factory
:clusters_applications_knative
,
class:
'Clusters::Applications::Knative'
do
hostname
{
'example.com'
}
cluster
factory:
%i(cluster with_installed_helm provided_by_gcp)
end
factory
:clusters_applications_jupyter
,
class:
Clusters
::
Applications
::
Jupyter
do
factory
:clusters_applications_jupyter
,
class:
'Clusters::Applications::Jupyter'
do
oauth_application
factory: :oauth_application
cluster
factory:
%i(cluster with_installed_helm provided_by_gcp project)
end
...
...
spec/factories/clusters/clusters.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:cluster
,
class:
Clusters
::
Cluster
do
factory
:cluster
,
class:
'Clusters::Cluster'
do
user
name
{
'test-cluster'
}
cluster_type
{
:project_type
}
...
...
spec/factories/clusters/kubernetes_namespaces.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:cluster_kubernetes_namespace
,
class:
Clusters
::
KubernetesNamespace
do
factory
:cluster_kubernetes_namespace
,
class:
'Clusters::KubernetesNamespace'
do
association
:cluster
,
:project
,
:provided_by_gcp
after
(
:build
)
do
|
kubernetes_namespace
|
...
...
spec/factories/clusters/platforms/kubernetes.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:cluster_platform_kubernetes
,
class:
Clusters
::
Platforms
::
Kubernetes
do
factory
:cluster_platform_kubernetes
,
class:
'Clusters::Platforms::Kubernetes'
do
association
:cluster
,
platform_type: :kubernetes
,
provider_type: :user
namespace
{
nil
}
api_url
{
'https://kubernetes.example.com'
}
...
...
spec/factories/clusters/projects.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:cluster_project
,
class:
Clusters
::
Project
do
factory
:cluster_project
,
class:
'Clusters::Project'
do
cluster
project
end
...
...
spec/factories/clusters/providers/aws.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:cluster_provider_aws
,
class:
Clusters
::
Providers
::
Aws
do
factory
:cluster_provider_aws
,
class:
'Clusters::Providers::Aws'
do
association
:cluster
,
platform_type: :kubernetes
,
provider_type: :aws
role_arn
{
'arn:aws:iam::123456789012:role/role-name'
}
...
...
spec/factories/clusters/providers/gcp.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:cluster_provider_gcp
,
class:
Clusters
::
Providers
::
Gcp
do
factory
:cluster_provider_gcp
,
class:
'Clusters::Providers::Gcp'
do
association
:cluster
,
platform_type: :kubernetes
,
provider_type: :gcp
gcp_project_id
{
'test-gcp-project'
}
...
...
spec/factories/commit_statuses.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:commit_status
,
class:
CommitStatus
do
factory
:commit_status
,
class:
'CommitStatus'
do
name
{
'default'
}
stage
{
'test'
}
stage_idx
{
0
}
...
...
@@ -59,7 +59,7 @@ FactoryBot.define do
build
.
project
=
build
.
pipeline
.
project
end
factory
:generic_commit_status
,
class:
GenericCommitStatus
do
factory
:generic_commit_status
,
class:
'GenericCommitStatus'
do
name
{
'generic'
}
description
{
'external commit status'
}
end
...
...
spec/factories/deployments.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:deployment
,
class:
Deployment
do
factory
:deployment
,
class:
'Deployment'
do
sha
{
'b83d6e391c22777fca1ed3012fce84f633d7fed0'
}
ref
{
'master'
}
tag
{
false
}
...
...
spec/factories/dev_ops_score_metrics.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:dev_ops_score_metric
,
class:
DevOpsScore
::
Metric
do
factory
:dev_ops_score_metric
,
class:
'DevOpsScore::Metric'
do
leader_issues
{
9.256
}
instance_issues
{
1.234
}
percentage_issues
{
13.331
}
...
...
spec/factories/environments.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:environment
,
class:
Environment
do
factory
:environment
,
class:
'Environment'
do
sequence
(
:name
)
{
|
n
|
"environment
#{
n
}
"
}
association
:project
,
:repository
...
...
spec/factories/error_tracking/detailed_error.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:detailed_error_tracking_error
,
class:
Gitlab
::
ErrorTracking
::
DetailedError
do
factory
:detailed_error_tracking_error
,
class:
'Gitlab::ErrorTracking::DetailedError'
do
id
{
'1'
}
title
{
'title'
}
type
{
'error'
}
...
...
spec/factories/error_tracking/error.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:error_tracking_error
,
class:
Gitlab
::
ErrorTracking
::
Error
do
factory
:error_tracking_error
,
class:
'Gitlab::ErrorTracking::Error'
do
id
{
'id'
}
title
{
'title'
}
type
{
'error'
}
...
...
spec/factories/error_tracking/error_event.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:error_tracking_error_event
,
class:
Gitlab
::
ErrorTracking
::
ErrorEvent
do
factory
:error_tracking_error_event
,
class:
'Gitlab::ErrorTracking::ErrorEvent'
do
issue_id
{
'id'
}
date_received
{
Time
.
now
.
iso8601
}
stack_trace_entries
do
...
...
spec/factories/error_tracking/project.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:error_tracking_project
,
class:
Gitlab
::
ErrorTracking
::
Project
do
factory
:error_tracking_project
,
class:
'Gitlab::ErrorTracking::Project'
do
id
{
'1'
}
name
{
'Sentry Example'
}
slug
{
'sentry-example'
}
...
...
spec/factories/events.rb
View file @
29714d78
...
...
@@ -24,7 +24,7 @@ FactoryBot.define do
end
end
factory
:push_event
,
class:
PushEvent
do
factory
:push_event
,
class:
'PushEvent'
do
project
factory: :project_empty_repo
author
(
factory: :user
)
{
project
.
creator
}
action
{
Event
::
PUSHED
}
...
...
spec/factories/gitaly/commit.rb
View file @
29714d78
...
...
@@ -3,7 +3,7 @@
FactoryBot
.
define
do
sequence
(
:gitaly_commit_id
)
{
Digest
::
SHA1
.
hexdigest
(
Time
.
now
.
to_f
.
to_s
)
}
factory
:gitaly_commit
,
class:
Gitaly
::
GitCommit
do
factory
:gitaly_commit
,
class:
'Gitaly::GitCommit'
do
skip_create
id
{
generate
(
:gitaly_commit_id
)
}
...
...
spec/factories/gitaly/commit_author.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:gitaly_commit_author
,
class:
Gitaly
::
CommitAuthor
do
factory
:gitaly_commit_author
,
class:
'Gitaly::CommitAuthor'
do
skip_create
name
{
generate
(
:name
)
}
...
...
spec/factories/gitaly/tag.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:gitaly_tag
,
class:
Gitaly
::
Tag
do
factory
:gitaly_tag
,
class:
'Gitaly::Tag'
do
skip_create
name
{
'v3.1.4'
}
...
...
spec/factories/grafana_integrations.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:grafana_integration
,
class:
GrafanaIntegration
do
factory
:grafana_integration
,
class:
'GrafanaIntegration'
do
project
grafana_url
{
'https://grafana.example.com'
}
token
{
SecureRandom
.
hex
(
10
)
}
...
...
spec/factories/groups.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:group
,
class:
Group
,
parent: :namespace
do
factory
:group
,
class:
'Group'
,
parent: :namespace
do
sequence
(
:name
)
{
|
n
|
"group
#{
n
}
"
}
path
{
name
.
downcase
.
gsub
(
/\s/
,
'_'
)
}
type
{
'Group'
}
...
...
spec/factories/import_states.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:import_state
,
class:
ProjectImportState
do
factory
:import_state
,
class:
'ProjectImportState'
do
status
{
:none
}
association
:project
,
factory: :project
...
...
spec/factories/labels.rb
View file @
29714d78
...
...
@@ -6,7 +6,7 @@ FactoryBot.define do
color
{
"#990000"
}
end
factory
:label
,
traits:
[
:base_label
],
class:
ProjectLabel
do
factory
:label
,
traits:
[
:base_label
],
class:
'ProjectLabel'
do
project
transient
do
...
...
spec/factories/namespace/aggregation_schedules.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:namespace_aggregation_schedules
,
class:
Namespace
::
AggregationSchedule
do
factory
:namespace_aggregation_schedules
,
class:
'Namespace::AggregationSchedule'
do
namespace
end
end
spec/factories/namespace/root_storage_statistics.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:namespace_root_storage_statistics
,
class:
Namespace
::
RootStorageStatistics
do
factory
:namespace_root_storage_statistics
,
class:
'Namespace::RootStorageStatistics'
do
namespace
end
end
spec/factories/notes.rb
View file @
29714d78
...
...
@@ -18,9 +18,9 @@ FactoryBot.define do
factory
:note_on_personal_snippet
,
traits:
[
:on_personal_snippet
]
factory
:system_note
,
traits:
[
:system
]
factory
:discussion_note
,
class:
DiscussionNote
factory
:discussion_note
,
class:
'DiscussionNote'
factory
:discussion_note_on_merge_request
,
traits:
[
:on_merge_request
],
class:
DiscussionNote
do
factory
:discussion_note_on_merge_request
,
traits:
[
:on_merge_request
],
class:
'DiscussionNote'
do
association
:project
,
:repository
trait
:resolved
do
...
...
@@ -29,22 +29,22 @@ FactoryBot.define do
end
end
factory
:discussion_note_on_issue
,
traits:
[
:on_issue
],
class:
DiscussionNote
factory
:discussion_note_on_issue
,
traits:
[
:on_issue
],
class:
'DiscussionNote'
factory
:discussion_note_on_commit
,
traits:
[
:on_commit
],
class:
DiscussionNote
factory
:discussion_note_on_commit
,
traits:
[
:on_commit
],
class:
'DiscussionNote'
factory
:discussion_note_on_personal_snippet
,
traits:
[
:on_personal_snippet
],
class:
DiscussionNote
factory
:discussion_note_on_personal_snippet
,
traits:
[
:on_personal_snippet
],
class:
'DiscussionNote'
factory
:discussion_note_on_snippet
,
traits:
[
:on_snippet
],
class:
DiscussionNote
factory
:discussion_note_on_snippet
,
traits:
[
:on_snippet
],
class:
'DiscussionNote'
factory
:legacy_diff_note_on_commit
,
traits:
[
:on_commit
,
:legacy_diff_note
],
class:
LegacyDiffNote
factory
:legacy_diff_note_on_commit
,
traits:
[
:on_commit
,
:legacy_diff_note
],
class:
'LegacyDiffNote'
factory
:legacy_diff_note_on_merge_request
,
traits:
[
:on_merge_request
,
:legacy_diff_note
],
class:
LegacyDiffNote
do
factory
:legacy_diff_note_on_merge_request
,
traits:
[
:on_merge_request
,
:legacy_diff_note
],
class:
'LegacyDiffNote'
do
association
:project
,
:repository
position
{
''
}
end
factory
:diff_note_on_merge_request
,
traits:
[
:on_merge_request
],
class:
DiffNote
do
factory
:diff_note_on_merge_request
,
traits:
[
:on_merge_request
],
class:
'DiffNote'
do
association
:project
,
:repository
transient
do
...
...
@@ -95,7 +95,7 @@ FactoryBot.define do
end
end
factory
:diff_note_on_commit
,
traits:
[
:on_commit
],
class:
DiffNote
do
factory
:diff_note_on_commit
,
traits:
[
:on_commit
],
class:
'DiffNote'
do
association
:project
,
:repository
transient
do
...
...
spec/factories/project_error_tracking_settings.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:project_error_tracking_setting
,
class:
ErrorTracking
::
ProjectErrorTrackingSetting
do
factory
:project_error_tracking_setting
,
class:
'ErrorTracking::ProjectErrorTrackingSetting'
do
project
api_url
{
'https://gitlab.com/api/0/projects/sentry-org/sentry-project'
}
enabled
{
true
}
...
...
spec/factories/project_metrics_settings.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:project_metrics_setting
,
class:
ProjectMetricsSetting
do
factory
:project_metrics_setting
,
class:
'ProjectMetricsSetting'
do
project
external_dashboard_url
{
'https://grafana.com'
}
end
...
...
spec/factories/prometheus_metrics.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:prometheus_metric
,
class:
PrometheusMetric
do
factory
:prometheus_metric
,
class:
'PrometheusMetric'
do
title
{
'title'
}
query
{
'avg(metric)'
}
y_label
{
'y_label'
}
...
...
spec/factories/releases/link.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:release_link
,
class:
::
Releases
::
Link
do
factory
:release_link
,
class:
'::Releases::Link'
do
release
sequence
(
:name
)
{
|
n
|
"release-18.
#{
n
}
.dmg"
}
sequence
(
:url
)
{
|
n
|
"https://example.com/scrambled-url/app-
#{
n
}
.zip"
}
...
...
spec/factories/sentry_issue.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:sentry_issue
,
class:
SentryIssue
do
factory
:sentry_issue
,
class:
'SentryIssue'
do
issue
sentry_issue_identifier
{
1234567891
}
end
...
...
spec/factories/serverless/domain_cluster.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:serverless_domain_cluster
,
class:
Serverless
::
DomainCluster
do
factory
:serverless_domain_cluster
,
class:
'Serverless::DomainCluster'
do
pages_domain
{
create
(
:pages_domain
)
}
knative
{
create
(
:clusters_applications_knative
)
}
creator
{
create
(
:user
)
}
...
...
spec/factories/services.rb
View file @
29714d78
...
...
@@ -6,7 +6,7 @@ FactoryBot.define do
type
{
'Service'
}
end
factory
:custom_issue_tracker_service
,
class:
CustomIssueTrackerService
do
factory
:custom_issue_tracker_service
,
class:
'CustomIssueTrackerService'
do
project
active
{
true
}
issue_tracker
...
...
spec/factories/terms.rb
View file @
29714d78
# frozen_string_literal: true
FactoryBot
.
define
do
factory
:term
,
class:
ApplicationSetting
::
Term
do
factory
:term
,
class:
'ApplicationSetting::Term'
do
terms
{
"Lorem ipsum dolor sit amet, consectetur adipiscing elit."
}
end
end
spec/factories/todos.rb
View file @
29714d78
...
...
@@ -46,7 +46,7 @@ FactoryBot.define do
end
end
factory
:on_commit_todo
,
class:
Todo
do
factory
:on_commit_todo
,
class:
'Todo'
do
project
author
user
...
...
spec/features/boards/boards_spec.rb
View file @
29714d78
...
...
@@ -163,9 +163,7 @@ describe 'Issue Boards', :js do
end
it
'infinite scrolls list'
do
50
.
times
do
create
(
:labeled_issue
,
project:
project
,
labels:
[
planning
])
end
create_list
(
:labeled_issue
,
50
,
project:
project
,
labels:
[
planning
])
visit
project_board_path
(
project
,
board
)
wait_for_requests
...
...
@@ -475,9 +473,7 @@ describe 'Issue Boards', :js do
end
it
'infinite scrolls list with label filter'
do
50
.
times
do
create
(
:labeled_issue
,
project:
project
,
labels:
[
planning
,
testing
])
end
create_list
(
:labeled_issue
,
50
,
project:
project
,
labels:
[
planning
,
testing
])
set_filter
(
"label"
,
testing
.
title
)
click_filter_link
(
testing
.
title
)
...
...
spec/features/instance_statistics/cohorts_spec.rb
View file @
29714d78
...
...
@@ -10,7 +10,7 @@ describe 'Cohorts page' do
end
it
'See users count per month'
do
2
.
times
{
create
(
:user
)
}
create_list
(
:user
,
2
)
visit
instance_statistics_cohorts_path
...
...
spec/features/issuables/issuable_list_spec.rb
View file @
29714d78
...
...
@@ -83,9 +83,7 @@ describe 'issuable list' do
create
(
:merge_request
,
title:
FFaker
::
Lorem
.
sentence
,
source_project:
project
,
source_branch:
source_branch
,
head_pipeline:
pipeline
)
end
2
.
times
do
create
(
:note_on_issue
,
noteable:
issuable
,
project:
project
)
end
create_list
(
:note_on_issue
,
2
,
noteable:
issuable
,
project:
project
)
create
(
:award_emoji
,
:downvote
,
awardable:
issuable
)
create
(
:award_emoji
,
:upvote
,
awardable:
issuable
)
...
...
spec/finders/issues_finder_spec.rb
View file @
29714d78
...
...
@@ -435,9 +435,7 @@ describe IssuesFinder do
let
(
:params
)
{
{
label_name:
described_class
::
FILTER_ANY
}
}
it
'returns issues that have one or more label'
do
2
.
times
do
create
(
:label_link
,
label:
create
(
:label
,
project:
project2
),
target:
issue3
)
end
create_list
(
:label_link
,
2
,
label:
create
(
:label
,
project:
project2
),
target:
issue3
)
expect
(
issues
).
to
contain_exactly
(
issue2
,
issue3
)
end
...
...
spec/models/concerns/each_batch_spec.rb
View file @
29714d78
...
...
@@ -13,7 +13,7 @@ describe EachBatch do
end
before
do
5
.
times
{
create
(
:user
,
updated_at:
1
.
day
.
ago
)
}
create_list
(
:user
,
5
,
updated_at:
1
.
day
.
ago
)
end
shared_examples
'each_batch handling'
do
|
kwargs
|
...
...
spec/models/concerns/issuable_spec.rb
View file @
29714d78
...
...
@@ -326,7 +326,7 @@ describe Issuable do
context
'when all of the results are level on the sort key'
do
let!
(
:issues
)
do
10
.
times
{
create
(
:issue
,
project:
project
)
}
create_list
(
:issue
,
10
,
project:
project
)
end
it
'has no duplicates across pages'
do
...
...
spec/models/project_spec.rb
View file @
29714d78
...
...
@@ -1348,9 +1348,7 @@ describe Project do
let
(
:project2
)
{
create
(
:project
,
:public
,
group:
group
)
}
before
do
2
.
times
do
create
(
:note_on_commit
,
project:
project1
)
end
create_list
(
:note_on_commit
,
2
,
project:
project1
)
create
(
:note_on_commit
,
project:
project2
)
...
...
@@ -1364,9 +1362,7 @@ describe Project do
end
it
'does not take system notes into account'
do
10
.
times
do
create
(
:note_on_commit
,
project:
project2
,
system:
true
)
end
create_list
(
:note_on_commit
,
10
,
project:
project2
,
system:
true
)
expect
(
described_class
.
trending
.
to_a
).
to
eq
([
project1
,
project2
])
end
...
...
spec/models/trending_project_spec.rb
View file @
29714d78
...
...
@@ -11,13 +11,9 @@ describe TrendingProject do
let
(
:internal_project
)
{
create
(
:project
,
:internal
)
}
before
do
3
.
times
do
create
(
:note_on_commit
,
project:
public_project1
)
end
create_list
(
:note_on_commit
,
3
,
project:
public_project1
)
2
.
times
do
create
(
:note_on_commit
,
project:
public_project2
)
end
create_list
(
:note_on_commit
,
2
,
project:
public_project2
)
create
(
:note_on_commit
,
project:
public_project3
,
created_at:
5
.
weeks
.
ago
)
create
(
:note_on_commit
,
project:
private_project
)
...
...
spec/requests/api/jobs_spec.rb
View file @
29714d78
...
...
@@ -244,7 +244,7 @@ describe API::Jobs do
get
api
(
"/projects/
#{
project
.
id
}
/pipelines/
#{
pipeline
.
id
}
/jobs"
,
api_user
),
params:
query
end
.
count
3
.
times
{
create
(
:ci_build
,
:trace_artifact
,
:artifacts
,
:test_reports
,
pipeline:
pipeline
)
}
create_list
(
:ci_build
,
3
,
:trace_artifact
,
:artifacts
,
:test_reports
,
pipeline:
pipeline
)
expect
do
get
api
(
"/projects/
#{
project
.
id
}
/pipelines/
#{
pipeline
.
id
}
/jobs"
,
api_user
),
params:
query
...
...
spec/requests/api/pipelines_spec.rb
View file @
29714d78
...
...
@@ -254,9 +254,7 @@ describe API::Pipelines do
context
'when order_by and sort are specified'
do
context
'when order_by user_id'
do
before
do
3
.
times
do
create
(
:ci_pipeline
,
project:
project
,
user:
create
(
:user
))
end
create_list
(
:ci_pipeline
,
3
,
project:
project
,
user:
create
(
:user
))
end
context
'when sort parameter is valid'
do
...
...
spec/views/search/_results.html.haml_spec.rb
View file @
29714d78
...
...
@@ -6,7 +6,7 @@ describe 'search/_results' do
before
do
controller
.
params
[
:action
]
=
'show'
3
.
times
{
create
(
:issue
)
}
create_list
(
:issue
,
3
)
@search_objects
=
Issue
.
page
(
1
).
per
(
2
)
@scope
=
'issues'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment