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

Add back code coverage workflow #145

Merged
merged 25 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6835016
Rounding issue fixed to match SAS rounding approach
Mar 30, 2023
8358f22
account for 0 row data frame when getting denominator totals with a d…
asbates Jul 7, 2023
73ad52e
add test for bug fix #131
asbates Jul 7, 2023
71e7732
pull in copy of call_standardise
mstackhouse Sep 22, 2023
cc3b9dd
Fix for #136
mstackhouse Sep 22, 2023
eccdd6c
further fixes to fix unit tests for #136
mstackhouse Sep 24, 2023
83884b8
Docs for #138
mstackhouse Sep 24, 2023
fc6f885
document fix
mstackhouse Sep 24, 2023
d438e54
Switch up snapshots to use dataframes instead of tibbles for more con…
mstackhouse Sep 24, 2023
cbddc85
snaps
mstackhouse Sep 24, 2023
039a762
snaps
mstackhouse Sep 24, 2023
392a84f
Update snaps for dataframe print for better consistency
mstackhouse Sep 24, 2023
063cfd6
Updates for snaps
mstackhouse Sep 24, 2023
aafec93
Specifically fix and reverify #136, add supporting tests
mstackhouse Sep 24, 2023
76e904c
I think this is finally working and if it's not I really just don't k…
mstackhouse Sep 25, 2023
edf9b55
Add test coverage workflow
mstackhouse Oct 26, 2023
e037427
Merge pull request #144 from atorus-research/gh_actions_fix
mstackhouse Oct 26, 2023
468319d
Update forcats version requirement
mstackhouse Oct 26, 2023
c183c9b
Add commenting to explain non-intuitive sections
mstackhouse Oct 27, 2023
c31a8e2
remove dead and unnecessary code
mstackhouse Oct 27, 2023
3dca0aa
Push up new round test
elimillera Nov 7, 2023
96911c4
Merge pull request #139 from atorus-research/gh_issues_136_138
mstackhouse Nov 7, 2023
0776d9c
Merge pull request #126 from atorus-research/gh_issue_124
mstackhouse Nov 7, 2023
daafa49
Merge branch 'devel' of github.com:atorus-research/Tplyr into 131-0-r…
mstackhouse Nov 7, 2023
f7d07fa
Merge pull request #132 from atorus-research/131-0-row-bug
mstackhouse Nov 7, 2023
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
50 changes: 50 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Imports:
tidyselect (>= 1.1.0),
tibble (>= 3.0.1),
lifecycle,
forcats (>= 0.4.0)
forcats (>= 1.0.0)
Suggests:
testthat (>= 2.1.0),
haven (>= 2.2.0),
Expand Down
5 changes: 4 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ importFrom(dplyr,between)
importFrom(dplyr,bind_cols)
importFrom(dplyr,bind_rows)
importFrom(dplyr,case_when)
importFrom(dplyr,cur_column)
importFrom(dplyr,cur_group)
importFrom(dplyr,distinct)
importFrom(dplyr,do)
Expand All @@ -146,6 +147,7 @@ importFrom(dplyr,group_keys)
importFrom(dplyr,if_else)
importFrom(dplyr,lag)
importFrom(dplyr,left_join)
importFrom(dplyr,matches)
importFrom(dplyr,mutate)
importFrom(dplyr,mutate_all)
importFrom(dplyr,mutate_at)
Expand All @@ -164,7 +166,7 @@ importFrom(dplyr,vars)
importFrom(forcats,fct_collapse)
importFrom(forcats,fct_drop)
importFrom(forcats,fct_expand)
importFrom(forcats,fct_explicit_na)
importFrom(forcats,fct_na_value_to_level)
importFrom(lifecycle,deprecate_soft)
importFrom(lifecycle,deprecate_stop)
importFrom(magrittr,"%>%")
Expand Down Expand Up @@ -257,6 +259,7 @@ importFrom(tibble,add_column)
importFrom(tibble,rownames_to_column)
importFrom(tibble,tibble)
importFrom(tidyr,complete)
importFrom(tidyr,fill)
importFrom(tidyr,nesting)
importFrom(tidyr,pivot_longer)
importFrom(tidyr,pivot_wider)
Expand Down
56 changes: 56 additions & 0 deletions R/call_standardise.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# # MIT License
#
# Copyright (c) 2020 rlang authors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

#' rlang deprecated call_standardise, but this is necessary for
#' the `modify_nested_call()` function. The capability isn't
#' matched by the `call_match()` function.
#'
#' In modify nested call, this is used to restructure the function call
#' to have all named arguments. Since all the functions called inside
#' `call_standardise()` are exported and currently stable within rlang,
#' I'm porting the function here.
#'
#' @param call
#'
#' @return call
#' @noRd
tplyr_call_standardise <- function(call, env= rlang::caller_env()) {

expr <- rlang::get_expr(call)

if (!rlang::is_call(expr)) {
stop("call_standardise error")
}

# The call name might be a literal, not necessarily a symbol
env <- rlang::get_env(call, env)
fn <- rlang::eval_bare(rlang::node_car(expr), env)

if (rlang::is_primitive(fn)) {
call
} else {
matched <- match.call(fn, expr)
rlang::set_expr(call, matched)
}

}

Loading
Loading