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
7f113da3
Commit
7f113da3
authored
Apr 14, 2020
by
Qingyu Zhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix flaky ndjson reader spec
parent
438d67c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
spec/lib/gitlab/import_export/json/ndjson_reader_spec.rb
spec/lib/gitlab/import_export/json/ndjson_reader_spec.rb
+1
-1
spec/support/import_export/common_util.rb
spec/support/import_export/common_util.rb
+7
-5
No files found.
spec/lib/gitlab/import_export/json/ndjson_reader_spec.rb
View file @
7f113da3
...
@@ -21,7 +21,7 @@ describe Gitlab::ImportExport::JSON::NdjsonReader do
...
@@ -21,7 +21,7 @@ describe Gitlab::ImportExport::JSON::NdjsonReader do
describe
'#exist?'
do
describe
'#exist?'
do
subject
{
ndjson_reader
.
exist?
}
subject
{
ndjson_reader
.
exist?
}
context
'given valid dir_path'
,
quarantine:
'https://gitlab.com/gitlab-org/gitlab/-/issues/213843'
do
context
'given valid dir_path'
do
let
(
:dir_path
)
{
fixture
}
let
(
:dir_path
)
{
fixture
}
it
{
is_expected
.
to
be
true
}
it
{
is_expected
.
to
be
true
}
...
...
spec/support/import_export/common_util.rb
View file @
7f113da3
...
@@ -15,15 +15,17 @@ module ImportExport
...
@@ -15,15 +15,17 @@ module ImportExport
export_path
=
[
prefix
,
'spec'
,
'fixtures'
,
'lib'
,
'gitlab'
,
'import_export'
,
name
].
compact
export_path
=
[
prefix
,
'spec'
,
'fixtures'
,
'lib'
,
'gitlab'
,
'import_export'
,
name
].
compact
export_path
=
File
.
join
(
*
export_path
)
export_path
=
File
.
join
(
*
export_path
)
extract_archive
(
export_path
,
'tree.tar.gz'
)
if
File
.
exist?
(
File
.
join
(
export_path
,
'tree.tar.gz'
))
extract_archive
(
export_path
,
'tree.tar.gz'
)
end
allow_any_instance_of
(
Gitlab
::
ImportExport
).
to
receive
(
:export_path
)
{
export_path
}
allow_any_instance_of
(
Gitlab
::
ImportExport
).
to
receive
(
:export_path
)
{
export_path
}
end
end
def
extract_archive
(
path
,
archive
)
def
extract_archive
(
path
,
archive
)
if
File
.
exist?
(
File
.
join
(
path
,
archive
)
)
output
,
exit_status
=
Gitlab
::
Popen
.
popen
([
"cd
#{
path
}
; tar xzf
#{
archive
}
"
]
)
system
(
"cd
#{
path
}
; tar xzvf
#{
archive
}
&> /dev/null"
)
end
raise
"Failed to extract archive. Output:
#{
output
}
"
unless
exit_status
.
zero?
end
end
def
cleanup_artifacts_from_extract_archive
(
name
,
prefix
=
nil
)
def
cleanup_artifacts_from_extract_archive
(
name
,
prefix
=
nil
)
...
@@ -31,7 +33,7 @@ module ImportExport
...
@@ -31,7 +33,7 @@ module ImportExport
export_path
=
File
.
join
(
*
export_path
)
export_path
=
File
.
join
(
*
export_path
)
if
File
.
exist?
(
File
.
join
(
export_path
,
'tree.tar.gz'
))
if
File
.
exist?
(
File
.
join
(
export_path
,
'tree.tar.gz'
))
system
(
"cd
#{
export_path
}
; rm -fr tree
&> /dev/null
"
)
system
(
"cd
#{
export_path
}
; rm -fr tree"
)
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