Commit cc9fb8b0 authored by Michael Eddington's avatar Michael Eddington Committed by Jan Provaznik

Add API Fuzzing usage data

parent bb9d8871
---
title: Add API Fuzzing job counts to telemetry pings
merge_request: 47451
author:
type: changed
......@@ -36,6 +36,12 @@ module EE
},
coverage_fuzzing: {
name: :coverage_fuzzing_jobs
},
apifuzzer_fuzz: {
name: :api_fuzzing_jobs
},
apifuzzer_fuzz_dnd: {
name: :api_fuzzing_dnd_jobs
}
}.freeze
......
......@@ -29,6 +29,8 @@ RSpec.describe Gitlab::UsageData do
create(:ci_build, name: 'sast', pipeline: pipeline)
create(:ci_build, name: 'secret_detection', pipeline: pipeline)
create(:ci_build, name: 'coverage_fuzzing', pipeline: pipeline)
create(:ci_build, name: 'apifuzzer_fuzz', pipeline: pipeline)
create(:ci_build, name: 'apifuzzer_fuzz_dnd', pipeline: pipeline)
create(:ci_pipeline, source: :ondemand_dast_scan, project: projects[0])
create(:prometheus_alert, project: projects[0])
......@@ -145,6 +147,8 @@ RSpec.describe Gitlab::UsageData do
expect(count_data[:sast_jobs]).to eq(1)
expect(count_data[:secret_detection_jobs]).to eq(1)
expect(count_data[:coverage_fuzzing_jobs]).to eq(1)
expect(count_data[:api_fuzzing_jobs]).to eq(1)
expect(count_data[:api_fuzzing_dnd_jobs]).to eq(1)
expect(count_data[:dast_on_demand_pipelines]).to eq(1)
end
......@@ -528,6 +532,8 @@ RSpec.describe Gitlab::UsageData do
before do
for_defined_days_back do
create(:ci_build, name: 'apifuzzer_fuzz', user: user)
create(:ci_build, name: 'apifuzzer_fuzz_dnd', user: user)
create(:ci_build, name: 'container_scanning', user: user)
create(:ci_build, name: 'coverage_fuzzing', user: user)
create(:ci_build, name: 'dast', user: user)
......@@ -542,6 +548,8 @@ RSpec.describe Gitlab::UsageData do
expect(described_class.usage_activity_by_stage_secure(described_class.last_28_days_time_period)).to eq(
user_preferences_group_overview_security_dashboard: 3,
user_container_scanning_jobs: 1,
user_api_fuzzing_jobs: 1,
user_api_fuzzing_dnd_jobs: 1,
user_coverage_fuzzing_jobs: 1,
user_dast_jobs: 1,
user_dependency_scanning_jobs: 1,
......@@ -601,7 +609,10 @@ RSpec.describe Gitlab::UsageData do
expect(described_class.usage_activity_by_stage_secure(described_class.last_28_days_time_period)).to include(
user_preferences_group_overview_security_dashboard: 3,
user_api_fuzzing_jobs: 1,
user_api_fuzzing_dnd_jobs: 1,
user_container_scanning_jobs: 1,
user_coverage_fuzzing_jobs: 1,
user_dast_jobs: 1,
user_dependency_scanning_jobs: 1,
user_license_management_jobs: 1,
......@@ -634,6 +645,8 @@ RSpec.describe Gitlab::UsageData do
expect(described_class.usage_activity_by_stage_secure(described_class.last_28_days_time_period)).to eq(
user_preferences_group_overview_security_dashboard: 3,
user_api_fuzzing_jobs: 1,
user_api_fuzzing_dnd_jobs: 1,
user_container_scanning_jobs: 1,
user_coverage_fuzzing_jobs: 1,
user_dast_jobs: 3,
......@@ -666,6 +679,8 @@ RSpec.describe Gitlab::UsageData do
expect(described_class.usage_activity_by_stage_secure(described_class.last_28_days_time_period)).to eq(
user_preferences_group_overview_security_dashboard: 3,
user_api_fuzzing_jobs: 1,
user_api_fuzzing_dnd_jobs: 1,
user_container_scanning_jobs: 1,
user_coverage_fuzzing_jobs: 1,
user_dast_jobs: 1,
......@@ -698,6 +713,8 @@ RSpec.describe Gitlab::UsageData do
expect(described_class.usage_activity_by_stage_secure(described_class.last_28_days_time_period)).to eq(
user_preferences_group_overview_security_dashboard: -1,
user_api_fuzzing_jobs: -1,
user_api_fuzzing_dnd_jobs: -1,
user_container_scanning_jobs: -1,
user_coverage_fuzzing_jobs: -1,
user_dast_jobs: -1,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment