Skip to content

Add default test directory descriptions to Statistics::TEST_TYPES.#13

Open
jimtreadway wants to merge 2 commits intobf4:masterfrom
jimtreadway:issue-12
Open

Add default test directory descriptions to Statistics::TEST_TYPES.#13
jimtreadway wants to merge 2 commits intobf4:masterfrom
jimtreadway:issue-12

Conversation

@jimtreadway
Copy link
Copy Markdown

"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".

"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".
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [89/80]

@jimtreadway
Copy link
Copy Markdown
Author

Well, ruby-2.0 works. The other versions are failing CI, but I don't think this is a new problem...

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably don't need this test :)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait, you're calculating LOC on this, n/m

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bf4
Copy link
Copy Markdown
Owner

bf4 commented Aug 21, 2015

Looks good, thanks!

@bf4
Copy link
Copy Markdown
Owner

bf4 commented Aug 21, 2015

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.

@jimtreadway
Copy link
Copy Markdown
Author

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.

@bf4
Copy link
Copy Markdown
Owner

bf4 commented Sep 4, 2015

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants