| 1 |
Feature: analizo metrics-history |
| 2 |
As a software engineering researcher |
| 3 |
I want to analyse the entire history of a project |
| 4 |
To understand its development process |
| 5 |
|
| 6 |
Scenario: listing merge commits with code changes that should be analyzed |
| 7 |
When I explode t/samples/evolution.tar.gz |
| 8 |
And I run "analizo metrics-history --list ." |
| 9 |
Then the output must match "0a06a6fcc2e7b4fe56d134e89d74ad028bb122ed" |
| 10 |
And the output must match "eb67c27055293e835049b58d7d73ce3664d3f90e" |
| 11 |
And the output must match "aa2d0fcb7879485d5ff1cd189743f91f04bea8ce" |
| 12 |
And the output must match "e8faf88f0e20a193d700b6c68eeb31897dd85e53" |
| 13 |
And the output must match "d7f52e74dc3d8f57640e83d41c5e9f8fcf621c00" |
| 14 |
And the output must match "0d3c023120ad4e9f519a03fff275d048c52671ad" |
| 15 |
|
| 16 |
Scenario: non-code commits should not be analyzed |
| 17 |
When I explode t/samples/evolution.tar.gz |
| 18 |
And I run "analizo metrics-history --list ." |
| 19 |
Then the output must not match "ba62278e976944c0334103aa0044535169e1a51e" |
| 20 |
|
| 21 |
Scenario: merge commits without code change should not be analyzed |
| 22 |
When I explode t/samples/evolution.tar.gz |
| 23 |
And I run "analizo metrics-history --list ." |
| 24 |
Then the output must not match "0fdaaa7dcc8073332a957024fafc8c98f165e725" |
| 25 |
|
| 26 |
Scenario: actually processing merge commits |
| 27 |
When I explode t/samples/evolution.tar.gz |
| 28 |
And I run "analizo metrics-history -o metrics.csv . && cat metrics.csv" |
| 29 |
Then the output must match "^id,previous_commit_id,author_date,author_name,author_email,.*,sc_mean" |
| 30 |
And the output must match "0a06a6fcc2e7b4fe56d134e89d74ad028bb122ed,eb67c27055293e835049b58d7d73ce3664d3f90e" |
| 31 |
And the output must match "eb67c27055293e835049b58d7d73ce3664d3f90e,," |
| 32 |
And the output must match "aa2d0fcb7879485d5ff1cd189743f91f04bea8ce,d7f52e74dc3d8f57640e83d41c5e9f8fcf621c00" |
| 33 |
And the output must match "e8faf88f0e20a193d700b6c68eeb31897dd85e53,d7f52e74dc3d8f57640e83d41c5e9f8fcf621c00" |
| 34 |
And the output must match "d7f52e74dc3d8f57640e83d41c5e9f8fcf621c00,0d3c023120ad4e9f519a03fff275d048c52671ad" |
| 35 |
|
| 36 |
Scenario: actually processing initial commit and first commit after a non-relevant merge |
| 37 |
When I explode t/samples/evolution.tar.gz |
| 38 |
And I run "analizo metrics-history -o metrics.csv . && cat metrics.csv" |
| 39 |
Then the output must match "0d3c023120ad4e9f519a03fff275d048c52671ad,," |
| 40 |
And the output must match "8183eafad3a0f3eff6e8869f1bdbfd255e86825a,0a06a6fcc2e7b4fe56d134e89d74ad028bb122ed" |
| 41 |
|
| 42 |
Scenario: support for parallel processing |
| 43 |
Given I copy t/samples/evolution.tar.gz into a temporary directory |
| 44 |
When I run "tar xzf evolution.tar.gz" |
| 45 |
And I run "cd evolution && analizo metrics-history -o ../sequential.csv" |
| 46 |
And I run "cd evolution && analizo metrics-history -p 2 -o ../parallel.csv" |
| 47 |
Then the exit status must be 0 |
| 48 |
When I run "sort sequential.csv > sequential-sorted.csv" |
| 49 |
And I run "sort parallel.csv > parallel-sorted.csv" |
| 50 |
And I run "diff -u sequential-sorted.csv parallel-sorted.csv" |
| 51 |
Then the output must not match "---" |
| 52 |
And the exit status must be 0 |
| 53 |
|
| 54 |
Scenario: parsing git log format containing renamed files among status of changed files |
| 55 |
Given I copy t/samples/evolution.tar.gz into a temporary directory |
| 56 |
When I run "tar xzf evolution.tar.gz" |
| 57 |
And I run "cd evolution && git checkout doc && analizo metrics-history ." |
| 58 |
Then the exit status must be 0 |
| 59 |
|
| 60 |
Scenario: language filters |
| 61 |
Given I copy t/samples/mixed into a temporary directory |
| 62 |
When I run "(cd mixed && git init && git add * && git commit -m 'initial commit')" |
| 63 |
And I run "analizo metrics-history --language java mixed" |
| 64 |
Then the output must not match "native_backend.c" |