All functions now default to bucket_name = "lake" with "baf-fraud/" prepended to all layer prefixes, matching the contemporary lakehouse naming convention (one bucket per environment, project as prefix). Migration: copy baf-fraud/ data to lake/baf-fraud/ on analyticsvm, update BAF_BUCKET env var from "baf-fraud" to "lake". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
49 lines
1.6 KiB
R
49 lines
1.6 KiB
R
test_that("connect_baf() errors on missing BAF_ENDPOINT", {
|
|
withr::with_envvar(
|
|
c(BAF_ENDPOINT = "", BAF_KEY = "key", BAF_SECRET = "secret", BAF_BUCKET = "lake"),
|
|
expect_error(connect_baf("some/prefix"), "BAF_ENDPOINT")
|
|
)
|
|
})
|
|
|
|
test_that("connect_baf() errors on missing BAF_KEY", {
|
|
withr::with_envvar(
|
|
c(BAF_ENDPOINT = "minio:9000", BAF_KEY = "", BAF_SECRET = "secret", BAF_BUCKET = "lake"),
|
|
expect_error(connect_baf("some/prefix"), "BAF_KEY")
|
|
)
|
|
})
|
|
|
|
test_that("connect_baf() errors on missing BAF_SECRET", {
|
|
withr::with_envvar(
|
|
c(BAF_ENDPOINT = "minio:9000", BAF_KEY = "key", BAF_SECRET = "", BAF_BUCKET = "lake"),
|
|
expect_error(connect_baf("some/prefix"), "BAF_SECRET")
|
|
)
|
|
})
|
|
|
|
test_that("connect_baf() errors on missing BAF_BUCKET", {
|
|
withr::with_envvar(
|
|
c(BAF_ENDPOINT = "minio:9000", BAF_KEY = "key", BAF_SECRET = "secret", BAF_BUCKET = ""),
|
|
expect_error(connect_baf("some/prefix"), "BAF_BUCKET")
|
|
)
|
|
})
|
|
|
|
test_that("convert_to_parquet() errors on missing BAF_ENDPOINT", {
|
|
withr::with_envvar(
|
|
c(BAF_ENDPOINT = "", BAF_KEY = "key", BAF_SECRET = "secret"),
|
|
expect_error(convert_to_parquet("01_raw", "02_intermediate"), "BAF_ENDPOINT")
|
|
)
|
|
})
|
|
|
|
test_that("convert_to_parquet() errors on missing BAF_KEY", {
|
|
withr::with_envvar(
|
|
c(BAF_ENDPOINT = "minio:9000", BAF_KEY = "", BAF_SECRET = "secret"),
|
|
expect_error(convert_to_parquet("01_raw", "02_intermediate"), "BAF_KEY")
|
|
)
|
|
})
|
|
|
|
test_that("convert_to_parquet() errors on missing BAF_SECRET", {
|
|
withr::with_envvar(
|
|
c(BAF_ENDPOINT = "minio:9000", BAF_KEY = "key", BAF_SECRET = ""),
|
|
expect_error(convert_to_parquet("01_raw", "02_intermediate"), "BAF_SECRET")
|
|
)
|
|
})
|