Add default test directory descriptions to Statistics::TEST_TYPES.#13
Add default test directory descriptions to Statistics::TEST_TYPES.#13jimtreadway wants to merge 2 commits intobf4:masterfrom
Conversation
"Test LOC" is always 0 unless you have manually configured test your test directories via CodeMetrics::StatsDirectories#add_test_directory, CodeMetrics::StatsDirectories#add_test_directories, etc. Modify CodeMetrics::Statistics#initialize so that the default test directories are also added to the CodeMetrics::Statistics::TEST_TYPES array. This allows CodeMetrics::Statistics#calculate_tests to work in the default configuration case (eg., when using "metric_fu" without and custom "code_metrics" configuration changes). Also, add a dummy controller test and adjust the expected results in the test_code_metrics_sanity to look for the correct, updated values for "Test LOC" and "Code to Test Ratio".
There was a problem hiding this comment.
Line is too long. [89/80]
|
Well, ruby-2.0 works. The other versions are failing CI, but I don't think this is a new problem... |
There was a problem hiding this comment.
wait, you're calculating LOC on this, n/m
There was a problem hiding this comment.
I think that "Test LOC" will always be zero for rake_test.rb if this file is not present.
The "negativity" test is so that the ratio is not 1:1.
|
Looks good, thanks! |
|
Sorry about the test failures. I haven't worked on this in a while (because there's not much to do), so I guess the deps have changed in a non-pessimistic way. I'll take a look at what Rails might have changed. |
|
No worries. I only noticed it because "metric_fu" uses "code_metrics" for graphing, and I just ran it again on a new project and figured I might as well investigate this time. |
|
@jimtreadway Would you like if I added you as a collaborator so you can help bring this completion? I've just very distracted with other things right now. |
"Test LOC" is always 0 unless you have manually configured test your
test directories via CodeMetrics::StatsDirectories#add_test_directory,
CodeMetrics::StatsDirectories#add_test_directories, etc.
Modify CodeMetrics::Statistics#initialize so that the default test
directories are also added to the CodeMetrics::Statistics::TEST_TYPES
array. This allows CodeMetrics::Statistics#calculate_tests to work
in the default configuration case (eg., when using "metric_fu" without
and custom "code_metrics" configuration changes).
Also, add a dummy controller test and adjust the expected results
in the test_code_metrics_sanity to look for the correct, updated
values for "Test LOC" and "Code to Test Ratio".