Skip to content
代码片段 群组 项目
提交 1b70913d 编辑于 作者: Laura Montemayor's avatar Laura Montemayor
浏览文件

Merge branch 'revert-6d919d67' into 'master'

Revert "Merge branch 'diffblue-ci-template' into 'master'"

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/138492



Merged-by: default avatarLaura Montemayor <lmontemayor@gitlab.com>
Approved-by: default avatarLaura Montemayor <lmontemayor@gitlab.com>
Co-authored-by: default avatarAvielle Wolfe <awolfe@gitlab.com>
No related branches found
No related tags found
无相关合并请求
...@@ -181,7 +181,6 @@ options: ...@@ -181,7 +181,6 @@ options:
- p_ci_templates_terraform_module_base - p_ci_templates_terraform_module_base
- p_ci_templates_terraform_module - p_ci_templates_terraform_module
- p_ci_templates_pages_zola - p_ci_templates_pages_zola
- p_ci_templates_diffblue_cover
distribution: distribution:
- ce - ce
- ee - ee
......
---
key_path: redis_hll_counters.ci_templates.p_ci_templates_diffblue_cover_monthly
description: Count of pipelines using the Diffblue Cover template
product_section: ci
product_stage: pipeline_authoring
product_group: pipeline_authoring
value_type: number
status: active
milestone: "16.7"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/137047
time_frame: 28d
data_source: redis_hll
data_category: optional
instrumentation_class: RedisHLLMetric
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate
options:
events:
- p_ci_templates_diffblue_cover
...@@ -182,7 +182,6 @@ options: ...@@ -182,7 +182,6 @@ options:
- p_ci_templates_terraform_module_base - p_ci_templates_terraform_module_base
- p_ci_templates_terraform_module - p_ci_templates_terraform_module
- p_ci_templates_pages_zola - p_ci_templates_pages_zola
- p_ci_templates_diffblue_cover
distribution: distribution:
- ce - ce
- ee - ee
......
---
key_path: redis_hll_counters.ci_templates.p_ci_templates_diffblue_cover_weekly
description: Count of pipelines using the Diffblue Cover template
product_section: ci
product_stage: pipeline_authoring
product_group: pipeline_authoring
value_type: number
status: active
milestone: "16.7"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/137047
time_frame: 7d
data_source: redis_hll
data_category: optional
instrumentation_class: RedisHLLMetric
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate
options:
events:
- p_ci_templates_diffblue_cover
# This template is provided and maintained by Diffblue.
# You can copy and paste this template into a new `.gitlab-ci.yml` file.
# This template is designed to be used with the Cover Pipeline for GitLab integration from Diffblue.
# It will download the latest version of Diffblue Cover, build the associated project, and
# automatically write Java unit tests for the project.
# Note that additional config is required:
# https://docs.diffblue.com/features/cover-pipeline/cover-pipeline-for-gitlab
# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword.
#
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Diffblue-Cover.gitlab-ci.yml
variables:
# Configure the following via the Diffblue Cover integration config for your project, or by
# using CI/CD masked Variables.
# For details, see https://docs.diffblue.com/features/cover-pipeline/cover-pipeline-for-gitlab
# Diffblue Cover license key: DIFFBLUE_LICENSE_KEY
# Refer to your welcome email or you can obtain a free trial key from
# https://www.diffblue.com/try-cover/gitlab
# GitLab access token: DIFFBLUE_ACCESS_TOKEN, DIFFBLUE_ACCESS_TOKEN_NAME
# The access token should have a role of Developer or better and should have
# api and write_repository permissions.
# Diffblue Cover requires a minimum of 4GB of memory.
JVM_ARGS: -Xmx4g
stages:
- build
diffblue-cover:
stage: build
# Select the Cover CLI docker image to use with your CI tool.
# Tag variations are produced for each supported JDK version.
# Go to https://hub.docker.com/r/diffblue/cover-cli for details.
# Note: To use the latest version of Diffblue Cover, use one of the latest-jdk<nn> tags.
# To use a specific release version, use one of the yyyy.mm.dd-jdk<nn> tags.
image: diffblue/cover-cli:latest-jdk17
# Diffblue Cover currently only supports running on merge_request_events.
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
# Diffblue Cover log files are saved to a .diffblue/ directory in the pipeline artifacts,
# and are available for download once the pipeline completes.
artifacts:
paths:
- "**/.diffblue/"
script:
# Diffblue Cover requires the project to be built before creating any tests.
# Either specify the build command here (one of the following), or provide
# prebuilt artifacts via a job dependency.
# Maven project example (comment out the Gradle version if used):
- mvn test-compile --batch-mode --no-transfer-progress
# Gradle project example (comment out the Maven version if used):
# - gradle testClasses
# Diffblue Cover commands and options to run.
# dcover – the core Diffblue Cover command
# ci – enable the GitLab CI/CD integration via environment variables
# activate - activate the license key
# validate - remove non-compiling and failing tests
# create - create new tests for your project
# --maven – use the maven build tool
# For detailed information on Cover CLI commands and options, see
# https://docs.diffblue.com/features/cover-cli/commands-and-arguments
- dcover
ci
activate
validate --maven
create --maven
# Diffblue Cover will also respond to specific project labels:
# Diffblue Cover: Baseline
# Used to mark a merge request as requiring a full suite of tests to be written.
# This overrides the default behaviour where Cover will only write tests related
# to the code changes already in the merge request. This is useful when running Diffblue
# Cover for the first time on a project and when new product enhancements are released.
# Diffblue Cover: Skip
# Used to mark a merge request as requiring no tests to be written.
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Diffblue-Cover.gitlab-ci.yml', feature_category: :continuous_integration do
subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Diffblue-Cover') }
describe 'the created pipeline' do
let(:pipeline_branch) { 'patch-1' }
let_it_be(:project) { create(:project, :repository, create_branch: 'patch-1') }
let(:user) { project.first_owner }
let(:mr_service) { MergeRequests::CreatePipelineService.new(project: project, current_user: user) }
let(:merge_request) { create(:merge_request, :simple, source_project: project, source_branch: pipeline_branch) }
let(:mr_pipeline) { mr_service.execute(merge_request).payload }
let(:mr_build_names) { mr_pipeline.builds.pluck(:name) }
before do
stub_ci_pipeline_yaml_file(template.content)
end
it 'creates diffblue-cover jobs' do
expect(mr_build_names).to include('diffblue-cover')
end
end
end
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
context 'that support autodevops' do context 'that support autodevops' do
exceptions = [ exceptions = [
'Diffblue-Cover.gitlab-ci.yml', # no auto-devops
'Security/DAST.gitlab-ci.yml', # DAST stage is defined inside AutoDevops yml 'Security/DAST.gitlab-ci.yml', # DAST stage is defined inside AutoDevops yml
'Security/DAST-API.gitlab-ci.yml', # no auto-devops 'Security/DAST-API.gitlab-ci.yml', # no auto-devops
'Security/API-Fuzzing.gitlab-ci.yml', # no auto-devops 'Security/API-Fuzzing.gitlab-ci.yml', # no auto-devops
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册