-
Notifications
You must be signed in to change notification settings - Fork 83
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
Deployment record improvements #827
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,6 +69,25 @@ test_that("can read/write metadata", { | |
expect_equal(out$meta2, "two") | ||
}) | ||
|
||
test_that("can read/write version", { | ||
dir <- local_temp_app() | ||
|
||
addTestDeployment(dir, version = "999") | ||
out <- deployments(dir, excludeOrphaned = FALSE) | ||
expect_equal(out$version, "999") | ||
}) | ||
|
||
test_that("can read/write missing version", { | ||
# also tests we can read files written by previous versions of package | ||
dir <- local_temp_app() | ||
|
||
path <- addTestDeployment(dir, version = NA) | ||
out <- deployments(dir, excludeOrphaned = FALSE) | ||
|
||
expect_false("version" %in% rownames(read.dcf(path))) | ||
expect_equal(out$version, NA) | ||
}) | ||
|
||
test_that("can read/write env vars", { | ||
app <- local_temp_app() | ||
addTestDeployment(app, "test1", envVars = c("TEST1", "TEST2")) | ||
|
@@ -78,12 +97,21 @@ test_that("can read/write env vars", { | |
expect_equal(deps$envVars, list(c("TEST1", "TEST2"), character())) | ||
}) | ||
|
||
test_that("can read env vars when none set", { | ||
test_that("can read/write empty env vars", { | ||
# also tests we can read files written by previous versions of package | ||
app <- local_temp_app() | ||
addTestDeployment(app, "test1", envVars = NA_character_) | ||
|
||
# With empty character vector | ||
path <- addTestDeployment(app, "test1", envVars = character()) | ||
deps <- deployments(app, excludeOrphaned = FALSE) | ||
expect_equal(deps$envVars, list(NA_character_)) | ||
expect_false("envVars" %in% rownames(read.dcf(path))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aronatkins this is where we test what happens when we deliberately create a deployment without There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. I missed that this test was confirming the processing of an "old" DCF. Would you mind adding a comment / renaming the test to remind us that this is testing DCF compatibility upon upgrade? |
||
expect_equal(deps$envVars, list(character())) | ||
|
||
# Or with empty string | ||
path <- addTestDeployment(app, "test1", envVars = "") | ||
deps <- deployments(app, excludeOrphaned = FALSE) | ||
expect_false("envVars" %in% rownames(read.dcf(path))) | ||
expect_equal(deps$envVars, list(character())) | ||
}) | ||
|
||
test_that("can read/write env vars", { | ||
|
@@ -108,7 +136,7 @@ test_that("saveDeployment appends to global history", { | |
appName = "my-app", | ||
appTitle = "", | ||
appId = 10, | ||
envVars = NULL, | ||
envVars = "abc", # ensure there's an envVars column in output | ||
account = "foo", | ||
username = "foo", | ||
server = "bar" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do we test reading a DCF file that lacks the
envVars
andversion
fields?We should test reading single files with/without these fields as well as a collection of files where some of them lack these fields.