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
f5e017aa
Commit
f5e017aa
authored
Aug 21, 2020
by
Frédéric Caplette
Committed by
Sanad Liaquat
Aug 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add E2E test for locked artifacts
This adds the E2E test for locked artifacts in the qa folder.
parent
b6c6da88
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
125 additions
and
1 deletion
+125
-1
app/assets/javascripts/jobs/components/artifacts_block.vue
app/assets/javascripts/jobs/components/artifacts_block.vue
+1
-0
app/views/projects/artifacts/_tree_directory.html.haml
app/views/projects/artifacts/_tree_directory.html.haml
+1
-1
qa/qa/ee.rb
qa/qa/ee.rb
+4
-0
qa/qa/ee/page/project/artifact/show.rb
qa/qa/ee/page/project/artifact/show.rb
+21
-0
qa/qa/page/project/job/show.rb
qa/qa/page/project/job/show.rb
+12
-0
qa/qa/specs/features/ee/browser_ui/4_verify/locked_artifacts_spec.rb
.../features/ee/browser_ui/4_verify/locked_artifacts_spec.rb
+86
-0
No files found.
app/assets/javascripts/jobs/components/artifacts_block.vue
View file @
f5e017aa
...
...
@@ -71,6 +71,7 @@ export default {
:href=
"artifact.browse_path"
class=
"btn btn-sm btn-default"
data-testid=
"browse-artifacts"
data-qa-selector=
"browse_artifacts_button"
>
{{
s__
(
'
Job|Browse
'
)
}}
</gl-link
>
</div>
...
...
app/views/projects/artifacts/_tree_directory.html.haml
View file @
f5e017aa
...
...
@@ -3,6 +3,6 @@
%tr
.tree-item
{
'data-link'
=>
path_to_directory
}
%td
.tree-item-file-name
=
tree_icon
(
'folder'
,
'755'
,
directory
.
name
)
=
link_to
path_to_directory
,
class:
'str-truncated'
do
=
link_to
path_to_directory
,
class:
'str-truncated'
,
data:
{
qa_selector:
'directory_name_link'
,
qa_directory_name:
directory
.
name
}
do
%span
=
directory
.
name
%td
qa/qa/ee.rb
View file @
f5e017aa
...
...
@@ -100,6 +100,10 @@ module QA
autoload
:Show
,
'qa/ee/page/project/show'
autoload
:Menu
,
'qa/ee/page/project/menu'
module
Artifact
autoload
:Show
,
'qa/ee/page/project/artifact/show'
end
module
SubMenus
autoload
:SecurityCompliance
,
'qa/ee/page/project/sub_menus/security_compliance'
autoload
:Repository
,
'qa/ee/page/project/sub_menus/repository'
...
...
qa/qa/ee/page/project/artifact/show.rb
0 → 100644
View file @
f5e017aa
# frozen_string_literal: true
module
QA
module
EE
module
Page
module
Project
module
Artifact
class
Show
<
QA
::
Page
::
Base
view
'app/views/projects/artifacts/_tree_directory.html.haml'
do
element
:directory_name_link
end
def
go_to_directory
(
name
)
click_element
(
:directory_name_link
,
directory_name:
name
)
end
end
end
end
end
end
end
qa/qa/page/project/job/show.rb
View file @
f5e017aa
...
...
@@ -19,6 +19,10 @@ module QA
element
:retry_button
end
view
'app/assets/javascripts/jobs/components/artifacts_block.vue'
do
element
:browse_artifacts_button
end
def
successful?
(
timeout:
60
)
raise
"Timed out waiting for the build trace to load"
unless
loaded?
raise
"Timed out waiting for the status to be a valid completed state"
unless
completed?
(
timeout:
timeout
)
...
...
@@ -42,6 +46,14 @@ module QA
result
end
def
has_browse_button?
has_element?
:browse_artifacts_button
end
def
click_browse_button
click_element
:browse_artifacts_button
end
def
retry!
click_element
:retry_button
end
...
...
qa/qa/specs/features/ee/browser_ui/4_verify/locked_artifacts_spec.rb
0 → 100644
View file @
f5e017aa
# frozen_string_literal: true
module
QA
RSpec
.
describe
'Verify'
,
:docker
,
:runner
,
:requires_admin
do
describe
'Artifacts'
do
context
'when locked'
do
let
(
:ff_keep_latest
)
{
'keep_latest_artifacts_for_ref'
}
let
(
:ff_destroy_unlocked
)
{
'destroy_only_unlocked_expired_artifacts'
}
let
(
:file_name
)
{
'artifact.txt'
}
let
(
:directory_name
)
{
'my_artifacts'
}
let
(
:executor
)
{
"qa-runner-
#{
Time
.
now
.
to_i
}
"
}
let
(
:project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
'project-with-locked-artifacts'
end
end
let!
(
:runner
)
do
Resource
::
Runner
.
fabricate!
do
|
runner
|
runner
.
project
=
project
runner
.
name
=
executor
runner
.
tags
=
[
executor
]
end
end
before
do
[
ff_keep_latest
,
ff_destroy_unlocked
].
each
{
|
flag
|
Runtime
::
Feature
.
enable_and_verify
(
flag
)
}
Flow
::
Login
.
sign_in
end
after
do
[
ff_keep_latest
,
ff_destroy_unlocked
].
each
{
|
flag
|
Runtime
::
Feature
.
disable_and_verify
(
flag
)
}
runner
.
remove_via_api!
end
it
'can be browsed'
do
Resource
::
Repository
::
Commit
.
fabricate_via_api!
do
|
commit
|
commit
.
project
=
project
commit
.
commit_message
=
'Add .gitlab-ci.yml'
commit
.
add_files
(
[
{
file_path:
'.gitlab-ci.yml'
,
content:
<<~
YAML
test-artifacts:
tags:
- '
#{
executor
}
'
artifacts:
paths:
- '
#{
directory_name
}
'
expire_in: 1 sec
script:
- |
mkdir
#{
directory_name
}
echo "CONTENTS" >
#{
directory_name
}
/
#{
file_name
}
YAML
}
]
)
end
.
project
.
visit!
Page
::
Project
::
Menu
.
perform
(
&
:click_ci_cd_pipelines
)
Page
::
Project
::
Pipeline
::
Index
.
perform
do
|
index
|
index
.
wait_for_latest_pipeline_completion
index
.
click_on_latest_pipeline
end
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
click_job
(
'test-artifacts'
)
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
show
|
expect
(
show
).
to
have_browse_button
show
.
click_browse_button
end
EE
::
Page
::
Project
::
Artifact
::
Show
.
perform
do
|
show
|
show
.
go_to_directory
(
directory_name
)
expect
(
show
).
to
have_content
(
file_name
)
end
end
end
end
end
end
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