Skip to content

Commit 99a70f5

Browse files
authored
update bit64::as.integer64 use in test (#1567)
And update snapshots
1 parent 5726930 commit 99a70f5

File tree

6 files changed

+27
-12
lines changed

6 files changed

+27
-12
lines changed

.github/workflows/test-coverage.yaml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ on:
66
pull_request:
77
branches: [main, master]
88

9-
name: test-coverage
9+
name: test-coverage.yaml
10+
11+
permissions: read-all
1012

1113
jobs:
1214
test-coverage:
@@ -15,36 +17,47 @@ jobs:
1517
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1618

1719
steps:
18-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
1921

2022
- uses: r-lib/actions/setup-r@v2
2123
with:
2224
use-public-rspm: true
2325

2426
- uses: r-lib/actions/setup-r-dependencies@v2
2527
with:
26-
extra-packages: any::covr
28+
extra-packages: any::covr, any::xml2
2729
needs: coverage
2830

2931
- name: Test coverage
3032
run: |
31-
covr::codecov(
33+
cov <- covr::package_coverage(
3234
quiet = FALSE,
3335
clean = FALSE,
3436
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
3537
)
38+
print(cov)
39+
covr::to_cobertura(cov)
3640
shell: Rscript {0}
3741

42+
- uses: codecov/codecov-action@v5
43+
with:
44+
# Fail if error if not on PR, or if on PR and token is given
45+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
46+
files: ./cobertura.xml
47+
plugins: noop
48+
disable_search: true
49+
token: ${{ secrets.CODECOV_TOKEN }}
50+
3851
- name: Show testthat output
3952
if: always()
4053
run: |
4154
## --------------------------------------------------------------------
42-
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
55+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
4356
shell: bash
4457

4558
- name: Upload test results
4659
if: failure()
47-
uses: actions/upload-artifact@v3
60+
uses: actions/upload-artifact@v4
4861
with:
4962
name: coverage-test-failures
5063
path: ${{ runner.temp }}/package

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# dbplyr (development version)
22

3+
* Fix for failing snapshot tests (@edward-burn, #1567).
4+
35
* Tightened argument checks for SQL translations. These changes should
46
result in more informative errors in cases where code already failed, possibly
57
silently; if you see errors with code that used to run correctly, please report

tests/testthat/_snaps/pillar.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
Output
99
[1] "# Source: SQL [3 x 1]"
1010
Code
11-
# Number of rows still can't be shown
12-
x <- memdb_frame(a = 1:11) %>% filter(a > 0)
11+
# Number of rows still can't be shown if above 20
12+
x <- memdb_frame(a = 1:21) %>% filter(a > 0)
1313
setup <- pillar::tbl_format_setup(x)
1414
tbl_format_header(x, setup)[[1]]
1515
Output

tests/testthat/_snaps/tbl-sql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Code
44
mf2
55
Output
6-
# Source: SQL [3 x 2]
6+
# Source: SQL [?? x 2]
77
# Database: sqlite ?.?.? [:memory:]
88
x y
99
<int> <int>

tests/testthat/test-backend-postgres.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ test_that("casts `y` column for local df", {
335335

336336
out <- tibble(
337337
id = bit64::as.integer64(1:2),
338-
val = bit64::as.integer64(10L, 20L),
338+
val = bit64::as.integer64(c(10L, 20L)),
339339
arr = structure(c("{1,2}", "{1,2,3}"), class = "pq__int4")
340340
)
341341
expect_equal(

tests/testthat/test-pillar.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ test_that("custom header", {
55
setup <- pillar::tbl_format_setup(x)
66
tbl_format_header(x, setup)[[1]]
77

8-
"Number of rows still can't be shown"
9-
x <- memdb_frame(a = 1:11) %>% filter(a > 0)
8+
"Number of rows still can't be shown if above 20"
9+
x <- memdb_frame(a = 1:21) %>% filter(a > 0)
1010
setup <- pillar::tbl_format_setup(x)
1111
tbl_format_header(x, setup)[[1]]
1212
})

0 commit comments

Comments
 (0)