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
dde318ce
Commit
dde318ce
authored
Apr 10, 2018
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use RspecFlaky::Report in scripts/prune-old-flaky-specs
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
6a517e8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
15 deletions
+5
-15
scripts/prune-old-flaky-specs
scripts/prune-old-flaky-specs
+5
-15
No files found.
scripts/prune-old-flaky-specs
View file @
dde318ce
#!/usr/bin/env ruby
require
'json'
require
'time'
def
days_from_now
(
days
)
Time
.
now
-
(
3600
*
24
*
days
)
end
require_relative
'../lib/rspec_flaky/report'
report_file
=
ARGV
.
shift
unless
report_file
...
...
@@ -14,16 +9,11 @@ unless report_file
end
new_report_file
=
ARGV
.
shift
||
report_file
report
=
RspecFlaky
::
Report
.
load
(
report_file
)
puts
"Loading
#{
report_file
}
..."
report
=
JSON
.
parse
(
File
.
read
(
report_file
))
old_report_size
=
report
.
size
puts
"Current report has
#{
report
.
size
}
entries."
report
.
delete_if
{
|
uid
,
hash
|
Time
.
parse
(
hash
[
'last_flaky_at'
]).
to_i
<
days_from_now
(
90
).
to_i
}
puts
"New report has
#{
report
.
size
}
entries:
#{
old_report_size
-
report
.
size
}
entries older than 90 days were removed."
new_report
=
report
.
prune_outdated
File
.
write
(
new_report_file
,
JSON
.
pretty_generate
(
report
))
puts
"Saved
#{
new_report_file
}
."
puts
"New report has
#{
new_report
.
size
}
entries:
#{
report
.
size
-
new_report
.
size
}
entries older than 90 days were removed."
puts
"Saved
#{
new_report_file
}
."
if
new_report
.
write
(
new_report_file
)
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