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
ae91c723
Commit
ae91c723
authored
Jun 08, 2018
by
Micaël Bergeron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some legitimate specs failures
parent
47b9ef3f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
7 deletions
+14
-7
app/workers/all_queues.yml
app/workers/all_queues.yml
+1
-0
ee/app/helpers/ee/application_settings_helper.rb
ee/app/helpers/ee/application_settings_helper.rb
+1
-1
lib/pseudonymizer/dumper.rb
lib/pseudonymizer/dumper.rb
+3
-3
spec/lib/pseudonymizer/dumper_spec.rb
spec/lib/pseudonymizer/dumper_spec.rb
+9
-3
No files found.
app/workers/all_queues.yml
View file @
ae91c723
...
...
@@ -144,6 +144,7 @@
-
cronjob:ldap_all_groups_sync
-
cronjob:ldap_sync
-
cronjob:update_all_mirrors
-
cronjob:pseudonymizer
-
geo:geo_scheduler_scheduler
-
geo:geo_scheduler_primary_scheduler
...
...
ee/app/helpers/ee/application_settings_helper.rb
View file @
ae91c723
...
...
@@ -68,7 +68,7 @@ module EE
:slack_app_secret
,
:slack_app_verification_token
,
:allow_group_owners_to_manage_ldap
,
:
elt_database_dump
_enabled
:
pseudonymizer
_enabled
]
end
...
...
lib/pseudonymizer/dumper.rb
View file @
ae91c723
...
...
@@ -26,7 +26,7 @@ module Pseudonymizer
end
class
Dumper
attr_accessor
:config
attr_accessor
:config
,
:output_dir
def
initialize
(
options
)
@config
=
options
.
config
...
...
@@ -39,7 +39,7 @@ module Pseudonymizer
def
tables_to_csv
tables
=
config
[
"tables"
]
FileUtils
.
mkdir_p
(
@output_dir
)
unless
File
.
directory?
(
@
output_dir
)
FileUtils
.
mkdir_p
(
output_dir
)
unless
File
.
directory?
(
output_dir
)
new_tables
=
tables
.
map
do
|
k
,
v
|
@schema
[
k
]
=
{}
...
...
@@ -55,7 +55,7 @@ module Pseudonymizer
file_timestamp
=
filename
||
"
#{
prefix
}
_
#{
Time
.
now
.
to_i
}
"
file_timestamp
=
"
#{
file_timestamp
}
.
#{
ext
}
"
@output_files
<<
file_timestamp
File
.
join
(
@
output_dir
,
file_timestamp
)
File
.
join
(
output_dir
,
file_timestamp
)
end
def
schema_to_yml
...
...
spec/lib/pseudonymizer/dumper_spec.rb
View file @
ae91c723
...
...
@@ -3,9 +3,16 @@ require 'spec_helper'
describe
Pseudonymizer
::
Dumper
do
let!
(
:project
)
{
create
(
:project
)
}
let
(
:base_dir
)
{
Dir
.
mktmpdir
}
let
(
:options
)
{
Pseudonymizer
::
Options
.
new
()
}
let
(
:options
)
do
Pseudonymizer
::
Options
.
new
(
config:
Gitlab
.
config
.
pseudonymizer
,
start_at:
Time
.
now
.
utc
)
end
subject
(
:pseudo
)
{
described_class
.
new
(
options
)
}
before
do
allow
(
options
).
to
receive
(
:output_dir
).
and_return
(
base_dir
)
end
after
do
FileUtils
.
rm_rf
(
base_dir
)
end
...
...
@@ -13,7 +20,6 @@ describe Pseudonymizer::Dumper do
# create temp directory in before block
describe
'Pseudo tables'
do
it
'outputs project tables to csv'
do
pseudo
.
config
[
"output"
][
"csv"
]
=
base_dir
pseudo
.
config
[
"tables"
]
=
{
"projects"
=>
{
"whitelist"
=>
%w(id name path description)
,
...
...
@@ -21,7 +27,7 @@ describe Pseudonymizer::Dumper do
}
}
expect
(
pseudo
.
config
[
"output"
][
"csv"
]
).
to
eq
(
base_dir
)
expect
(
pseudo
.
output_dir
).
to
eq
(
base_dir
)
# grab the first table it outputs. There would only be 1.
project_table_file
=
pseudo
.
tables_to_csv
[
0
]
...
...
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