Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

480 bump version to 210 #482

Merged
merged 4 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: GitStats
Title: Get Statistics from GitHub and GitLab
Version: 2.0.2.9005
Version: 2.1.0
Authors@R: c(
person(given = "Maciej", family = "Banas", email = "[email protected]", role = c("aut", "cre")),
person(given = "Kamil", family = "Koziej", email = "[email protected]", role = "aut"),
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# GitStats (development version)
# GitStats 2.1.0

## New features:

Expand All @@ -9,6 +9,7 @@
## Other:

- Changed message when searching scope is set to scan whole git host (no `orgs` nor `repos` specified) from warning to info ([#456](https://github.com/r-world-devs/GitStats/issues/456)).
- Added new CI/CD jobs: deploy to `gh-pages`, lint and check for bumping version.

# GitStats 2.0.2

Expand Down
37 changes: 37 additions & 0 deletions tests/testthat/helper-fixtures.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,40 @@ test_fixtures$half_empty_gql_response <- list(
)
)
)

test_fixtures$github_file_response <- list(
"data" = list(
"repository" = list(
"repo_id" = "01010101",
"repo_name" = "TestProject",
"repo_url" = "https://github.com/r-world-devs/GitStats",
"file" = list(
"text" = "Some interesting text.",
"byteSize" = 50L
)
)
)
)

test_fixtures$gitlab_search_response <- list(
list(
"basename" = "test",
"data" = "some text with searched phrase",
"path" = "test.R",
"filename" = "test.R",
"id" = NULL,
"ref" = "main",
"startline" = 10,
"project_id" = 43398933
),
list(
"basename" = "test",
"data" = "some text with searched phrase",
"path" = "test.R",
"filename" = "test.R",
"id" = NULL,
"ref" = "main",
"startline" = 15,
"project_id" = 43400864
)
)
19 changes: 5 additions & 14 deletions tests/testthat/test-get_repos-GitLab.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,12 @@ test_that("`get_repos_from_org()` does not fail when GraphQL response is not com
)
})

test_that("`response()` returns responses from GitLab's REST API", {
gl_search_response <- test_rest_gitlab$response(
"https://gitlab.com/api/v4/groups/9970/search?scope=blobs&search=git"
)
expect_gl_search_response(gl_search_response)
test_mocker$cache(gl_search_response)
})

test_that("`map_search_into_repos()` works", {
gl_search_response <- test_mocker$use("gl_search_response")
suppressMessages(
gl_search_repos_by_code <- test_rest_gitlab_priv$map_search_into_repos(
gl_search_response,
progress = FALSE
)
gl_search_response <- test_fixtures$gitlab_search_response
test_mocker$cache(gl_search_response)
gl_search_repos_by_code <- test_rest_gitlab_priv$map_search_into_repos(
gl_search_response,
progress = FALSE
)
expect_gl_repos_rest_response(
gl_search_repos_by_code
Expand Down
9 changes: 4 additions & 5 deletions tests/testthat/test-z-get_repos_urls-GitLab.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ test_that("get_all_repos_urls prepares web repo_urls vector", {
})

test_that("`get_repo_url_from_response()` works", {
suppressMessages(
gl_repo_web_urls <- gitlab_testhost_priv$get_repo_url_from_response(
search_response = test_mocker$use("gl_search_response"),
type = "web"
)
gl_repo_web_urls <- gitlab_testhost_priv$get_repo_url_from_response(
search_response = test_mocker$use("gl_search_response"),
type = "web",
progress = FALSE
)
expect_gt(length(gl_repo_web_urls), 0)
expect_type(gl_repo_web_urls, "character")
Expand Down
Loading