debian-mirror-gitlab/spec/factories/ci/reports/sbom/components.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
641 B
Ruby
Raw Permalink Normal View History

2022-10-11 01:57:18 +05:30
# frozen_string_literal: true
FactoryBot.define do
factory :ci_reports_sbom_component, class: '::Gitlab::Ci::Reports::Sbom::Component' do
2022-11-25 23:54:43 +05:30
type { "library" }
2023-01-13 00:05:48 +05:30
2022-10-11 01:57:18 +05:30
sequence(:name) { |n| "component-#{n}" }
sequence(:version) { |n| "v0.0.#{n}" }
2023-01-13 00:05:48 +05:30
transient do
purl_type { 'npm' }
end
purl do
::Sbom::PackageUrl.new(
type: purl_type,
name: name,
version: version
).to_s
end
2022-10-11 01:57:18 +05:30
skip_create
initialize_with do
::Gitlab::Ci::Reports::Sbom::Component.new(
type: type,
name: name,
2023-01-13 00:05:48 +05:30
purl: purl,
2022-10-11 01:57:18 +05:30
version: version
)
end
end
end