test-prof 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/README.md +2 -2
- data/guides/factory_default.md +1 -1
- data/lib/test_prof.rb +6 -3
- data/lib/test_prof/factory_doctor/rspec.rb +3 -1
- data/lib/test_prof/factory_prof/printers/flamegraph.rb +1 -1
- data/lib/test_prof/ruby_prof.rb +1 -1
- data/lib/test_prof/stack_prof.rb +1 -1
- data/lib/test_prof/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 801b84df6d3f7ee580f2cdd0bb907a5d973d0f12
|
4
|
+
data.tar.gz: 7a1295fa606ba8fcbdb6d22867e0b6dfb5709519
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '078e932d7605e8399820ecdd3d7b4ee1098093c73d4f0f647c94ba095fad4b64531848304f86a3e1debce528bf815d2f78085b983c20ab906d0ca388d1874522'
|
7
|
+
data.tar.gz: '09c1d29d373158828d5d44d0a96a2413960934a60170b81a1f3974bc9c10e59fcdf4bcb20df2f842cd2985d82510c9e46ba024eca4f080d6008656e72a86a649'
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,18 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 0.2.0
|
6
|
+
|
7
|
+
- Ensure output directory exists. ([@danielwestendorf][])
|
8
|
+
|
9
|
+
**Change default output dir** to "tmp/test_prof".
|
10
|
+
|
11
|
+
Rename `#artefact_path` to `#artifact_path` to be more US-like
|
12
|
+
|
13
|
+
Ensure output dir exists in `#artifact_path` method.
|
14
|
+
|
15
|
+
- FactoryDoctor: print success message when no bad examples found. ([@palkan][])
|
16
|
+
|
5
17
|
## 0.1.1
|
6
18
|
|
7
19
|
- AnyFixture: clean tables in reverse order to not fail when foreign keys exist. ([@marshall-lee][])
|
@@ -12,3 +24,4 @@
|
|
12
24
|
|
13
25
|
[@palkan]: https://github.com/palkan
|
14
26
|
[@marshall-lee]: https://github.com/marshall-lee
|
27
|
+
[@danielwestendorf]: https://github.com/danielwestendorf
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![Gem Version](https://badge.fury.io/rb/test-prof.svg)](https://rubygems.org/gems/test-prof) [![Build Status](https://travis-ci.org/palkan/test-prof.svg?branch=master)](https://travis-ci.org/palkan/test-prof) [![CircleCI](https://circleci.com/gh/palkan/test-prof.svg?style=svg)](https://circleci.com/gh/palkan/test-prof)
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/test-prof.svg)](https://rubygems.org/gems/test-prof) [![Build Status](https://travis-ci.org/palkan/test-prof.svg?branch=master)](https://travis-ci.org/palkan/test-prof) [![CircleCI](https://circleci.com/gh/palkan/test-prof.svg?style=svg)](https://circleci.com/gh/palkan/test-prof) [![Code Triagers Badge](https://www.codetriage.com/palkan/test-prof/badges/users.svg)](https://www.codetriage.com/palkan/test-prof)
|
2
2
|
|
3
3
|
# Ruby Tests Profiling Toolbox
|
4
4
|
|
@@ -85,7 +85,7 @@ TestProf global configuration is used by most of the profilers:
|
|
85
85
|
|
86
86
|
```ruby
|
87
87
|
TestProf.configure do |config|
|
88
|
-
# the directory to put artifacts (reports) in ("tmp" by default)
|
88
|
+
# the directory to put artifacts (reports) in ("tmp/test_prof" by default)
|
89
89
|
config.output_dir = "tmp/test_prof"
|
90
90
|
|
91
91
|
# use unique filenames for reports (by simply appending current timestamp)
|
data/guides/factory_default.md
CHANGED
data/lib/test_prof.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "fileutils"
|
3
4
|
require "test_prof/version"
|
4
5
|
require "test_prof/logging"
|
5
6
|
|
@@ -58,8 +59,10 @@ module TestProf
|
|
58
59
|
::File.expand_path(filename, ::File.join(::File.dirname(__FILE__), "..", "assets"))
|
59
60
|
end
|
60
61
|
|
61
|
-
# Return a path to store
|
62
|
-
def
|
62
|
+
# Return a path to store artifact
|
63
|
+
def artifact_path(filename)
|
64
|
+
FileUtils.mkdir_p(config.output_dir)
|
65
|
+
|
63
66
|
with_timestamps(
|
64
67
|
::File.join(
|
65
68
|
config.output_dir,
|
@@ -91,7 +94,7 @@ module TestProf
|
|
91
94
|
def initialize
|
92
95
|
@output = $stdout
|
93
96
|
@color = true
|
94
|
-
@output_dir = "tmp"
|
97
|
+
@output_dir = "tmp/test_prof"
|
95
98
|
@timestamps = false
|
96
99
|
end
|
97
100
|
|
@@ -8,6 +8,8 @@ module TestProf
|
|
8
8
|
include Logging
|
9
9
|
using FloatDuration
|
10
10
|
|
11
|
+
SUCCESS_MESSAGE = 'FactoryDoctor says: "Looks good to me!"'
|
12
|
+
|
11
13
|
NOTIFICATIONS = %i[
|
12
14
|
example_started
|
13
15
|
example_finished
|
@@ -42,7 +44,7 @@ module TestProf
|
|
42
44
|
end
|
43
45
|
|
44
46
|
def print
|
45
|
-
return if @example_groups.empty?
|
47
|
+
return log(:info, SUCCESS_MESSAGE) if @example_groups.empty?
|
46
48
|
|
47
49
|
msgs = []
|
48
50
|
|
@@ -61,7 +61,7 @@ module TestProf::FactoryProf
|
|
61
61
|
template = File.read(TestProf.asset_path("flamegraph.template.html"))
|
62
62
|
template.sub! '/**REPORT-DATA**/', data.to_json
|
63
63
|
|
64
|
-
outpath = TestProf.
|
64
|
+
outpath = TestProf.artifact_path("factory-flame.html")
|
65
65
|
File.write(outpath, template)
|
66
66
|
outpath
|
67
67
|
end
|
data/lib/test_prof/ruby_prof.rb
CHANGED
data/lib/test_prof/stack_prof.rb
CHANGED
data/lib/test_prof/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test-prof
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Dementyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|