-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #176 from se-passau/dev
Version 3.6 Merged-by: Thomas Bock <[email protected]>
- Loading branch information
Showing
12 changed files
with
620 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,36 +11,32 @@ | |
## with this program; if not, write to the Free Software Foundation, Inc., | ||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
## | ||
## Copyright 2017-2018 by Claus Hunsen <[email protected]> | ||
## Copyright 2017-2018,2020 by Claus Hunsen <[email protected]> | ||
## All Rights Reserved. | ||
|
||
# TravisCI container | ||
os: linux | ||
dist: xenial | ||
warnings_are_errors: false | ||
|
||
# R environment, dependencies and information | ||
language: r | ||
r: | ||
- 3.3 | ||
- 3.4 | ||
- 3.5 | ||
|
||
# TravisCI container | ||
sudo: required | ||
dist: trusty | ||
warnings_are_errors: false | ||
|
||
# # Branches | ||
# branches: | ||
# only: | ||
# - travis | ||
# - claus-updates | ||
|
||
# R dependencies and information | ||
- 3.6 | ||
cache: packages | ||
repos: | ||
CRAN: https://cloud.r-project.org | ||
|
||
# installation | ||
# Installation | ||
install: | ||
# package dependencies | ||
- sudo apt-get install libudunits2-dev | ||
# package installation | ||
- Rscript install.R | ||
|
||
# Tests | ||
script: | ||
- Rscript tests.R |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
## Copyright 2017 by Felix Prasse <[email protected]> | ||
## Copyright 2017-2018 by Thomas Bock <[email protected]> | ||
## Copyright 2018 by Jakob Kronawitter <[email protected]> | ||
## Copyright 2019 by Klara Schlueter <[email protected]> | ||
## All Rights Reserved. | ||
|
||
|
||
|
@@ -80,6 +81,13 @@ revisions.callgraph = proj.conf$get.value("revisions.callgraph") | |
x.data = ProjectData$new(project.conf = proj.conf) | ||
x = NetworkBuilder$new(project.data = x.data, network.conf = net.conf) | ||
|
||
## * Evaluation plots ------------------------------------------------------ | ||
|
||
# edit.types = plot.commit.edit.types.in.project(x.data) | ||
# edit.types.scaled = plot.commit.edit.types.in.project(x.data, TRUE) | ||
# editor.types = plot.commit.editor.types.by.author(x.data) | ||
# editor.types.scaled = plot.commit.editor.types.by.author(x.data, TRUE) | ||
|
||
## * Data retrieval -------------------------------------------------------- | ||
|
||
# x.data$get.commits() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,8 @@ | |
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
## | ||
## Copyright 2018 by Christian Hechtl <[email protected]> | ||
## Copyright 2018 by Claus Hunsen <[email protected]> | ||
## Copyright 2018-2019 by Claus Hunsen <[email protected]> | ||
## Copyright 2019 by Jakob Kronawitter <[email protected]> | ||
## All Rights Reserved. | ||
|
||
|
||
|
@@ -34,6 +35,7 @@ test_that("Compare two ProjectData objects", { | |
|
||
##initialize a ProjectData object with the ProjectConf and clone it into another one | ||
proj.conf = ProjectConf$new(CF.DATA, CF.SELECTION.PROCESS, CASESTUDY, ARTIFACT) | ||
proj.conf$update.value("pasta", TRUE) | ||
proj.data.one = ProjectData$new(project.conf = proj.conf) | ||
proj.data.two = proj.data.one$clone() | ||
|
||
|
@@ -43,19 +45,20 @@ test_that("Compare two ProjectData objects", { | |
## second object, as well, and test for equality. | ||
|
||
##change the second data object | ||
proj.data.one$get.commits() | ||
|
||
proj.data.two$get.pasta() | ||
|
||
expect_false(proj.data.one$equals(proj.data.two), "Two not identical ProjectData objects.") | ||
|
||
proj.data.two$get.commits() | ||
proj.data.one$get.pasta() | ||
|
||
expect_true(proj.data.one$equals(proj.data.two), "Two identical ProjectData objects.") | ||
|
||
proj.data.two$get.pasta() | ||
proj.data.one$get.commits() | ||
|
||
expect_false(proj.data.one$equals(proj.data.two), "Two not identical ProjectData objects.") | ||
|
||
proj.data.one$get.pasta() | ||
proj.data.two$get.commits() | ||
|
||
expect_true(proj.data.one$equals(proj.data.two), "Two identical ProjectData objects.") | ||
|
||
|
@@ -123,3 +126,56 @@ test_that("Compare two RangeData objects", { | |
expect_false(proj.data.base$equals(range.data.four)) | ||
|
||
}) | ||
|
||
test_that("Filter patchstack mails", { | ||
|
||
proj.conf = ProjectConf$new(CF.DATA, CF.SELECTION.PROCESS, CASESTUDY, ARTIFACT) | ||
proj.conf$update.value("mails.filter.patchstack.mails", TRUE) | ||
|
||
## create the project data | ||
proj.data = ProjectData$new(proj.conf) | ||
|
||
## retrieve the mails while filtering patchstack mails | ||
mails.filtered = proj.data$get.mails() | ||
|
||
## create new project with filtering disabled | ||
proj.conf$update.value("mails.filter.patchstack.mails", FALSE) | ||
proj.data = ProjectData$new(proj.conf) | ||
|
||
## retrieve the mails without filtering patchstack mails | ||
mails.unfiltered = proj.data$get.mails() | ||
|
||
## get message ids | ||
mails.filtered.mids = mails.filtered[["message.id"]] | ||
mails.unfiltered.mids = mails.unfiltered[["message.id"]] | ||
|
||
expect_equal(setdiff(mails.unfiltered.mids, mails.filtered.mids), c("<[email protected]>", | ||
"<[email protected]>", | ||
"<[email protected]>", | ||
"<[email protected]>", | ||
"<[email protected]>")) | ||
}) | ||
|
||
test_that("Filter patchstack mails with PaStA enabled", { | ||
proj.conf = ProjectConf$new(CF.DATA, CF.SELECTION.PROCESS, CASESTUDY, ARTIFACT) | ||
proj.conf$update.value("mails.filter.patchstack.mails", TRUE) | ||
proj.conf$update.value("pasta", TRUE) | ||
|
||
proj.data = ProjectData$new(proj.conf) | ||
|
||
## retrieve filtered PaStA data by calling 'get.pasta' which calls the filtering functionality internally | ||
filtered.pasta = proj.data$get.pasta() | ||
|
||
## ensure that the remaining mails have not been touched | ||
expect_true("<[email protected]>" %in% filtered.pasta[["message.id"]]) | ||
expect_true("<[email protected]>" %in% filtered.pasta[["message.id"]]) | ||
expect_true("<[email protected]>" %in% filtered.pasta[["message.id"]]) | ||
expect_equal(2, sum(filtered.pasta[["message.id"]] == "<[email protected]>")) | ||
|
||
## ensure that the three PaStA entries relating to the filtered patchstack mails have been merged to a single new | ||
## PaStA entry which has assigned the message ID of the first patchstack mail | ||
expect_true("<[email protected]>" %in% filtered.pasta[["message.id"]]) | ||
|
||
## ensure that there are no other entries than the ones that have been verified to exist above | ||
expect_equal(6, nrow(filtered.pasta)) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
## Copyright 2017 by Mitchell Joblin <[email protected]> | ||
## Copyright 2017 by Ferdinand Frank <[email protected]> | ||
## Copyright 2017 by Sofie Kemper <[email protected]> | ||
## Copyright 2017-2019 by Claus Hunsen <[email protected]> | ||
## Copyright 2017-2020 by Claus Hunsen <[email protected]> | ||
## Copyright 2017 by Felix Prasse <[email protected]> | ||
## Copyright 2018-2019 by Christian Hechtl <[email protected]> | ||
## Copyright 2018 by Klara Schlüter <[email protected]> | ||
|
@@ -637,7 +637,7 @@ get.committer.not.author.commit.count = function(range.data) { | |
res = sqldf::sqldf("SELECT *, COUNT(*) AS `freq` FROM `commits.df` | ||
WHERE `committer.name` <> `author.name` | ||
GROUP BY `committer.name`, `author.name` | ||
ORDER BY `freq` DESC") | ||
ORDER BY `freq` DESC, `author.name` ASC") | ||
|
||
logging::logdebug("get.committer.not.author.commit.count: finished.") | ||
return(res) | ||
|
@@ -664,7 +664,7 @@ get.committer.and.author.commit.count = function(range.data) { | |
res = sqldf::sqldf("SELECT *, COUNT(*) AS `freq` FROM `commits.df` | ||
WHERE `committer.name` = `author.name` | ||
GROUP BY `committer.name`, `author.name` | ||
ORDER BY `freq` DESC") | ||
ORDER BY `freq` DESC, `author.name` ASC") | ||
|
||
logging::logdebug("get.committer.and.author.commit.count: finished.") | ||
return(res) | ||
|
@@ -699,7 +699,7 @@ get.committer.or.author.commit.count = function(range.data) { | |
|
||
res = sqldf::sqldf("SELECT *, COUNT(*) AS `freq` FROM `ungrouped` | ||
GROUP BY `name` | ||
ORDER BY `freq` DESC") | ||
ORDER BY `freq` DESC, `name` ASC") | ||
|
||
logging::logdebug("get.committer.or.author.commit.count: finished.") | ||
return(res) | ||
|
@@ -725,7 +725,7 @@ get.committer.commit.count = function(range.data) { | |
|
||
## Execute a query to get the commit count per author | ||
res = sqldf::sqldf("SELECT *, COUNT(*) AS `freq` FROM `commits.df` | ||
GROUP BY `committer.name` ORDER BY `freq` DESC") | ||
GROUP BY `committer.name` ORDER BY `freq` DESC, `committer.name` ASC") | ||
|
||
logging::logdebug("get.committer.commit.count: finished.") | ||
return(res) | ||
|
@@ -751,7 +751,7 @@ get.author.commit.count = function(proj.data) { | |
|
||
## Execute a query to get the commit count per author | ||
res = sqldf::sqldf("SELECT `author.name`, COUNT(*) AS `freq` FROM `commits.df` | ||
GROUP BY `author.name` ORDER BY `freq` DESC") | ||
GROUP BY `author.name` ORDER BY `freq` DESC, `author.name` ASC") | ||
|
||
logging::logdebug("get.author.commit.count: finished.") | ||
return(res) | ||
|
@@ -813,7 +813,7 @@ get.author.loc.count = function(proj.data) { | |
## Execute a query to get the changed lines per author | ||
res = sqldf::sqldf("SELECT `author.name`, SUM(`added.lines`) + SUM(`deleted.lines`) AS `loc` | ||
FROM `commits.df` | ||
GROUP BY `author.name` ORDER BY `loc` DESC") | ||
GROUP BY `author.name` ORDER BY `loc` DESC, `author.name` ASC") | ||
|
||
logging::logdebug("get.author.loc.count: finished.") | ||
return(res) | ||
|
Oops, something went wrong.