Skip to content
代码片段 群组 项目
未验证 提交 99acdf38 编辑于 作者: Chloe Liu's avatar Chloe Liu 提交者: GitLab
浏览文件

Merge branch 'secure_specs_use_commit' into 'master'

Update the Secure E2E specs to use commit rather than projectpush

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



Merged-by: default avatarChloe Liu <yliu@gitlab.com>
Approved-by: default avatarDésirée Chevalier <dchevalier@gitlab.com>
Approved-by: default avatarChloe Liu <yliu@gitlab.com>
Co-authored-by: default avatarWill Meek <wmeek@gitlab.com>
No related branches found
No related tags found
无相关合并请求
...@@ -48,18 +48,21 @@ module QA ...@@ -48,18 +48,21 @@ module QA
context 'when Advanced SAST is enabled' do context 'when Advanced SAST is enabled' do
it 'finds a vulnerability', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/471561' do it 'finds a vulnerability', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/471561' do
Resource::Repository::ProjectPush.fabricate! do |push| create(:commit,
push.project = project project: project,
push.file_name = '.gitlab-ci.yml' branch: project.default_branch,
push.file_content = File.read( commit_message: 'Commit .gitlab-ci.yml',
File.join( actions: [
EE::Runtime::Path.fixtures_path, 'secure_advanced_sast_files', {
'.gitlab-ci.yml' action: 'create',
) file_path: '.gitlab-ci.yml',
) content: File.read(
push.commit_message = 'Commit .gitlab-ci.yml' File.join(
push.new_branch = false EE::Runtime::Path.fixtures_path, 'secure_advanced_sast_files',
end '.gitlab-ci.yml'
))
}
])
Flow::Login.sign_in_unless_signed_in Flow::Login.sign_in_unless_signed_in
project.visit! project.visit!
......
...@@ -23,13 +23,12 @@ module QA ...@@ -23,13 +23,12 @@ module QA
let(:project) { create(:project, name: 'project-with-secure', description: 'Project with Secure') } let(:project) { create(:project, name: 'project-with-secure', description: 'Project with Secure') }
before do before do
Resource::Repository::ProjectPush.fabricate! do |project_push| build(:commit, project: project,
project_push.project = project commit_message: 'Create Secure compatible application to serve premade reports') do |commit|
project_push.commit_message = 'Create Secure compatible application to serve premade reports' commit.add_directory(Pathname.new(
project_push.directory = Pathname.new(
EE::Runtime::Path.fixture('secure_scanning_enable_from_ui_files') EE::Runtime::Path.fixture('secure_scanning_enable_from_ui_files')
) ))
end end.fabricate_via_api!
Flow::Login.sign_in_unless_signed_in Flow::Login.sign_in_unless_signed_in
project.visit! project.visit!
......
...@@ -32,10 +32,16 @@ module QA ...@@ -32,10 +32,16 @@ module QA
before do before do
webgoat.register! webgoat.register!
Resource::Repository::ProjectPush.fabricate! do |push|
push.project = test_project create(:commit,
push.file_name = '.gitlab-ci.yml' project: test_project,
push.file_content = <<~YML branch: test_project.default_branch,
commit_message: 'Commit .gitlab-ci.yml',
actions: [
{
action: 'create',
file_path: '.gitlab-ci.yml',
content: <<~YML
stages: # List of stages for jobs, and their order of execution stages: # List of stages for jobs, and their order of execution
- build - build
...@@ -43,10 +49,9 @@ module QA ...@@ -43,10 +49,9 @@ module QA
stage: build stage: build
script: script:
- echo "Compiling the code..." - echo "Compiling the code..."
YML YML
push.commit_message = 'Commit .gitlab-ci.yml' }
push.new_branch = false ])
end
# observe pipeline creation # observe pipeline creation
Flow::Login.sign_in_unless_signed_in Flow::Login.sign_in_unless_signed_in
......
...@@ -8,6 +8,7 @@ module QA ...@@ -8,6 +8,7 @@ module QA
create(:project, :with_readme, name: 'secret-push-project', description: 'Secret Push Protection Project') create(:project, :with_readme, name: 'secret-push-project', description: 'Secret Push Protection Project')
end end
# In reverse so that the test itself does not flag up a secret detection issue
let(:reverse_token_prefix) { 'taplg' } let(:reverse_token_prefix) { 'taplg' }
let(:test_token) { '-JUST20LETTERSANDNUMB' } let(:test_token) { '-JUST20LETTERSANDNUMB' }
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册