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

Dev #3

Open
wants to merge 53 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
8579bce
Remove very last new line character
hsonne Feb 15, 2021
b590418
Update Rd files with new Roxygen version
hsonne Feb 15, 2021
df89bac
Use kwb.utils::defaultIfNULL()
hsonne Feb 15, 2021
fff9f4d
Return early, avoid helper variable "skip"
hsonne Feb 15, 2021
800d9a4
Skip functions for which test files exists
hsonne Feb 15, 2021
1725285
Compress code
hsonne Feb 15, 2021
bc52ad2
Use shortcut "f" for function name
hsonne Feb 15, 2021
94f932e
Update NAMESPACE
hsonne Feb 15, 2021
fa28dc2
Move to GitHub actions
mrustl Feb 16, 2021
1d22647
Update LICENSE year
mrustl Feb 16, 2021
8de2723
Merge pull request #4 from KWB-R/patch-ci
hsonne Feb 18, 2021
4deee18
Delete docs (now deployed to "gh-pages")
mrustl Feb 18, 2021
8892dfb
Merge pull request #5 from KWB-R/no-docs
hsonne Feb 18, 2021
1a62356
Exclude files starting with dot, use full.names
hsonne Jul 16, 2023
d04a6d1
Rename file to create_test_files.R
hsonne Jul 16, 2023
166262e
Simplify create_test_files()
hsonne Jul 16, 2023
72ee65b
Move warn_if_file_exists() to new file utils.R
hsonne Jul 16, 2023
e8863bf
Move functions to different script files
hsonne Jul 16, 2023
4682b69
Simplify, use file.path()
hsonne Jul 16, 2023
7391556
Let get_function_assignment() name the elements
hsonne Jul 16, 2023
0928a76
Separate excludeNULL() from lapply()
hsonne Jul 16, 2023
9e6847a
Test for existing files beforehand
hsonne Jul 16, 2023
54b1d19
Assume that there is a function shortcut "f"
hsonne Jul 16, 2023
2230fa3
Simplify and shorten the descriptive comment
hsonne Jul 16, 2023
ead410c
Use get_function_assignments_from kwb.code
hsonne Jul 27, 2023
84f993b
Fix CI: Replace "master" with "v2"
hsonne Sep 26, 2023
e841e51
Add missing comma
hsonne Sep 26, 2023
d4524c9
Remove test of get_function_assignments()
hsonne Feb 12, 2024
a4bb178
Indent argument list, add comments
hsonne Feb 12, 2024
1853e9b
Extract get_full_function_name()
hsonne Feb 14, 2024
08342f5
Extract full_function_name()
hsonne Feb 14, 2024
5d15760
Update NAMESPACE and DESCRIPTION
hsonne Feb 14, 2024
89d8126
Rename "templates_raw" to "templates"
hsonne Feb 14, 2024
3ab29a6
Recreate testthat.R
hsonne Feb 15, 2024
98273d9
Reintegrate get_test_for_function() into lapply
hsonne Feb 15, 2024
21f2dc1
Change interface to get_test_for_function_calls()
hsonne Feb 15, 2024
7bc7fbe
Use different call strings for actual calls
hsonne Feb 15, 2024
289fa90
Add comments to facilitate debugging
hsonne Feb 15, 2024
26c181a
Remove single_quoted() (never used)
hsonne Feb 15, 2024
4a849bd
Simplify/repair get_test_for_function_calls()
hsonne Feb 15, 2024
3d3a284
Do not support the "full" argument any more
hsonne Feb 15, 2024
fb4a3f2
Always return a data frame
hsonne Feb 16, 2024
14b04ca
Fix :bug:: call kwb.utils::resolve() in a loop
hsonne Feb 16, 2024
799012b
Suppress warnings when evaluating expressions
hsonne Feb 16, 2024
11dcd09
Seq along what was the base for "fail_indices"
hsonne Feb 16, 2024
30b0fa4
Allow argument "full" again
hsonne Feb 16, 2024
2c3738d
Use env variable "GITHUB_PAT"
hsonne Feb 16, 2024
0ffdc72
Rely on kwb.code from the "dev" branch
hsonne Feb 16, 2024
a5db297
Rely on kwb.code from the "dev" branch
hsonne Feb 16, 2024
4fc1037
Merge branch 'fix-test-generation' of https://github.com/KWB-R/kwb.te…
hsonne Feb 16, 2024
027a2cd
Fix package dependency in DESCRIPTION
hsonne Feb 16, 2024
6bcf363
Merge pull request #8 from KWB-R/fix-test-generation
hsonne Feb 16, 2024
b349c8b
Mention name of current script in debug message
hsonne Apr 18, 2024
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
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
^docs\.*
_pkgdown.yaml
^.gitlab-ci\.yml$
^\.github$
82 changes: 82 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
on:
push:
branches:
- master
- main
- dev
pull_request:
branches:
- master
- main
- dev

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: windows-latest, r: 'devel'}
- {os: windows-latest, r: 'oldrel'}
- {os: windows-latest, r: 'release'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}

- uses: r-lib/actions/setup-pandoc@v2

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds", version = 2)
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-3-${{ hashFiles('depends.Rds') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-3-

- name: Install system dependencies
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Check
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Upload check results
if: failure()
uses: actions/upload-artifact@master
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
49 changes: 49 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
on:
push:
branches:
- main
- master
- dev

name: pkgdown

jobs:
pkgdown:
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v2

- uses: r-lib/actions/setup-pandoc@v2

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
install.packages("pkgdown", type = "binary")
shell: Rscript {0}

- name: Install package
run: R CMD INSTALL .

- name: Deploy package
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
51 changes: 51 additions & 0 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
on:
issue_comment:
types: [created]
name: Commands
jobs:
document:
if: startsWith(github.event.comment.body, '/document')
name: document
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@v2
- name: Install dependencies
run: Rscript -e 'install.packages(c("remotes", "roxygen2"))' -e 'remotes::install_deps(dependencies = TRUE)'
- name: Document
run: Rscript -e 'roxygen2::roxygenise()'
- name: commit
run: |
git add man/\* NAMESPACE
git commit -m 'Document'
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
style:
if: startsWith(github.event.comment.body, '/style')
name: style
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@v2
- name: Install dependencies
run: Rscript -e 'install.packages("styler")'
- name: Style
run: Rscript -e 'styler::style_pkg()'
- name: commit
run: |
git add \*.R
git commit -m 'Style'
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
48 changes: 48 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main

name: test-coverage

jobs:
test-coverage:
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v2

- uses: r-lib/actions/setup-pandoc@v2

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install dependencies
run: |
install.packages(c("remotes"))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("covr")
shell: Rscript {0}

- name: Test coverage
run: covr::codecov()
shell: Rscript {0}
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

7 changes: 5 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ License: MIT + file LICENSE
URL: https://github.com/kwb-r/kwb.test
BugReports: https://github.com/kwb-r/kwb.test/issues
Imports:
kwb.code,
kwb.utils,
usethis
Suggests:
compare,
testthat
testthat (>= 3.0.0)
Remotes:
github::kwb-r/kwb.code@dev,
github::kwb-r/kwb.utils
Encoding: UTF-8
LazyData: TRUE
RoxygenNote: 6.1.1
RoxygenNote: 7.3.1
Config/testthat/edition: 3
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017-2019 Kompetenzzentrum Wasser Berlin gGmbH (KWB)
Copyright (c) 2017-2021 Kompetenzzentrum Wasser Berlin gGmbH (KWB)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License

Copyright (c) 2017-2019 Kompetenzzentrum Wasser Berlin gGmbH
Copyright (c) 2017-2021 Kompetenzzentrum Wasser Berlin gGmbH

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ export(printTestMessage)
export(saveArgs)
export(testColumnwiseIdentity)
export(test_function)
importFrom(kwb.utils,asColumnList)
importFrom(kwb.utils,catAndRun)
importFrom(kwb.utils,collapsed)
importFrom(kwb.utils,createDirectory)
importFrom(kwb.utils,expandGrid)
importFrom(kwb.utils,getAttribute)
importFrom(kwb.utils,resolve)
importFrom(kwb.utils,toNamedList)
importFrom(kwb.utils,user)
importFrom(usethis,use_testthat)
Loading
Loading