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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
627b4833
Commit
627b4833
authored
Nov 23, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test case for scheduling runners tokens migration
parent
9ab50c86
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
1 deletion
+31
-1
spec/lib/gitlab/crypto_helper_spec.rb
spec/lib/gitlab/crypto_helper_spec.rb
+0
-1
spec/migrations/schedule_runners_token_encryption_spec.rb
spec/migrations/schedule_runners_token_encryption_spec.rb
+31
-0
No files found.
spec/lib/gitlab/crypto_helper_spec.rb
View file @
627b4833
...
...
@@ -15,7 +15,6 @@ describe Gitlab::CryptoHelper do
encrypted
=
described_class
.
aes256_gcm_encrypt
(
'some-value'
)
expect
(
encrypted
).
to
match
%r{^[A-Za-z0-9+/=]+$}
expect
(
encrypted
).
to
eq
encrypted
.
strip
end
end
...
...
spec/migrations/schedule_runners_token_encryption_spec.rb
0 → 100644
View file @
627b4833
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'post_migrate'
,
'20181121111200_schedule_runners_token_encryption'
)
describe
ScheduleRunnersTokenEncryption
,
:migration
do
let
(
:settings
)
{
table
(
:application_settings
)
}
let
(
:namespaces
)
{
table
(
:namespaces
)
}
let
(
:projects
)
{
table
(
:projects
)
}
let
(
:runners
)
{
table
(
:ci_runners
)
}
before
do
stub_const
(
"
#{
described_class
.
name
}
::BATCH_SIZE"
,
1
)
settings
.
create!
(
id:
1
,
runners_registration_token:
'plain-text-token1'
)
namespaces
.
create!
(
id:
11
,
name:
'gitlab'
,
path:
'gitlab-org'
,
runners_token:
'my-token1'
)
namespaces
.
create!
(
id:
12
,
name:
'gitlab'
,
path:
'gitlab-org'
,
runners_token:
'my-token2'
)
projects
.
create!
(
id:
111
,
namespace_id:
11
,
name:
'gitlab'
,
path:
'gitlab-ce'
,
runners_token:
'my-token1'
)
projects
.
create!
(
id:
114
,
namespace_id:
11
,
name:
'gitlab'
,
path:
'gitlab-ce'
,
runners_token:
'my-token2'
)
runners
.
create!
(
id:
201
,
runner_type:
1
,
token:
'plain-text-token1'
)
runners
.
create!
(
id:
202
,
runner_type:
1
,
token:
'plain-text-token2'
)
end
it
'schedules runners token encryption migration for multiple resources'
do
Sidekiq
::
Testing
.
fake!
do
Timecop
.
freeze
do
migrate!
expect
(
BackgroundMigrationWorker
.
jobs
.
size
).
to
eq
7
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