repo_analyzer 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/app/extractors/repo_analyzer/tests_info_extractor.rb +21 -1
- data/lib/repo_analyzer/version.rb +1 -1
- data/spec/assets/test_project/coverage/coverage.json +1391 -0
- data/spec/extractors/tests_info_extractor_spec.rb +13 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a60dbbb94a7f27c25a22c5ccf343f51417776bcb831a5ce09b182935bcd47747
|
4
|
+
data.tar.gz: e98fc9a0bc751b6820e33fda6748886117e18a5eee6001db35564b9d51be3c5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d44705ef852496e883102f16de06035d749fe94aefb4b5f871193d31d26e08e349f8090707c2feafd63ace0148e04a457931a705813bd0d50ab37b79d9e18b1a
|
7
|
+
data.tar.gz: 4115478f54237810e9c89483e14fb2633d9954315b2c895a86cf61ee7f44b7e63856310f89d594110c5ad2d8a1d2f1023ce04037f314f1a0c358996028fb32b7
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
|
+
### v1.1.0
|
6
|
+
|
7
|
+
#### Added
|
8
|
+
|
9
|
+
* Extract code coverage using Simplecov JSON formatter's generated file.
|
10
|
+
|
5
11
|
### v1.0.0
|
6
12
|
|
7
13
|
* Initial release.
|
data/Gemfile.lock
CHANGED
@@ -36,7 +36,8 @@ module RepoAnalyzer
|
|
36
36
|
swagger_tests_count: swagger_tests,
|
37
37
|
system_tests_count: system_tests_count,
|
38
38
|
jest_tests_count: jest_tests_count,
|
39
|
-
rails_code_coverage: rails_code_coverage.merge(total: coverage_total)
|
39
|
+
rails_code_coverage: rails_code_coverage.merge(total: coverage_total),
|
40
|
+
simplecov_coverage: simplecov_coverage
|
40
41
|
}
|
41
42
|
end
|
42
43
|
|
@@ -54,6 +55,25 @@ module RepoAnalyzer
|
|
54
55
|
end
|
55
56
|
end
|
56
57
|
|
58
|
+
def simplecov_coverage
|
59
|
+
@simplecov_coverage ||= TESTEABLE_RAILS_RESOURCES.inject({}) do |data, resource|
|
60
|
+
covered_percent = coverage_file.dig(
|
61
|
+
"groups", resource.to_s.camelize, "lines", "covered_percent"
|
62
|
+
)
|
63
|
+
data[resource] = covered_percent&.to_f&.round(2)
|
64
|
+
data
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def coverage_file
|
69
|
+
@coverage_file ||= begin
|
70
|
+
content = project_data_bridge.file_content("coverage/coverage.json")
|
71
|
+
return {} if content.blank?
|
72
|
+
|
73
|
+
JSON.parse(content).with_indifferent_access
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
57
77
|
def rails_code_coverage
|
58
78
|
TESTEABLE_RAILS_RESOURCES.inject({}) do |data, resource|
|
59
79
|
tests_count = project_data_bridge.dir_files("spec/#{resource}").count do |file|
|