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
13e0ee37
Commit
13e0ee37
authored
Nov 07, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test batch processing
parent
3dc74378
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb
...b/background_migration/populate_untracked_uploads_spec.rb
+42
-0
No files found.
spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb
View file @
13e0ee37
...
...
@@ -53,6 +53,12 @@ describe Gitlab::BackgroundMigration::PopulateUntrackedUploads, :migration, :sid
expect
(
appearance
.
uploads
.
count
).
to
eq
(
2
)
end
it
'sets all added or confirmed tracked files to tracked'
do
expect
do
described_class
.
new
.
perform
(
1
,
1000
)
end
.
to
change
{
unhashed_upload_files
.
where
(
tracked:
true
).
count
}.
from
(
0
).
to
(
8
)
end
it
'does not create duplicate uploads of already tracked files'
do
described_class
.
new
.
perform
(
1
,
1000
)
...
...
@@ -60,6 +66,42 @@ describe Gitlab::BackgroundMigration::PopulateUntrackedUploads, :migration, :sid
expect
(
project1
.
uploads
.
count
).
to
eq
(
2
)
expect
(
appearance
.
uploads
.
count
).
to
eq
(
2
)
end
it
'uses the start and end batch ids [only 1st half]'
do
start_id
=
unhashed_upload_files
.
all
.
to_a
[
0
].
id
end_id
=
unhashed_upload_files
.
all
.
to_a
[
3
].
id
expect
do
described_class
.
new
.
perform
(
start_id
,
end_id
)
end
.
to
change
{
uploads
.
count
}.
from
(
4
).
to
(
6
)
expect
(
user1
.
uploads
.
count
).
to
eq
(
1
)
expect
(
user2
.
uploads
.
count
).
to
eq
(
1
)
expect
(
appearance
.
uploads
.
count
).
to
eq
(
2
)
expect
(
project1
.
uploads
.
count
).
to
eq
(
2
)
expect
(
project2
.
uploads
.
count
).
to
eq
(
0
)
# Only 4 have been either confirmed or added to uploads
expect
(
unhashed_upload_files
.
where
(
tracked:
true
).
count
).
to
eq
(
4
)
end
it
'uses the start and end batch ids [only 2nd half]'
do
start_id
=
unhashed_upload_files
.
all
.
to_a
[
4
].
id
end_id
=
unhashed_upload_files
.
all
.
to_a
[
7
].
id
expect
do
described_class
.
new
.
perform
(
start_id
,
end_id
)
end
.
to
change
{
uploads
.
count
}.
from
(
4
).
to
(
6
)
expect
(
user1
.
uploads
.
count
).
to
eq
(
1
)
expect
(
user2
.
uploads
.
count
).
to
eq
(
0
)
expect
(
appearance
.
uploads
.
count
).
to
eq
(
1
)
expect
(
project1
.
uploads
.
count
).
to
eq
(
2
)
expect
(
project2
.
uploads
.
count
).
to
eq
(
2
)
# Only 4 have been either confirmed or added to uploads
expect
(
unhashed_upload_files
.
where
(
tracked:
true
).
count
).
to
eq
(
4
)
end
end
context
'with no untracked files'
do
...
...
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