-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
354 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,3 @@ build/ | |
/application.yaml | ||
/application.properties | ||
.Rproj.user | ||
|
||
# R files | ||
.Rhistory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.env | ||
Rplots.pdf | ||
molgenis-service-armadillo.Rproj | ||
molgenis-service-armadillo.Rproj | ||
.RData | ||
.Rhistory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
verify_basic_auth = function(url, admin_pwd, dest, skip_tests){ | ||
test_name = "basic_auth" | ||
verify_basic_auth <- function(url, admin_pwd, dest, skip_tests) { | ||
test_name <- "basic_auth" | ||
if (do_skip_test(test_name, skip_tests)) { | ||
return() | ||
} | ||
|
||
if(admin_pwd != "") { | ||
cli_h2("Basic authentication") | ||
cli_alert_info("Logging in as admin user") | ||
armadillo.login_basic(url, "admin", admin_pwd) | ||
project <- generate_random_project_name(skip_tests) | ||
print(project) | ||
cli_alert_info(sprintf("Creating project [%s]", project)) | ||
armadillo.create_project(project) | ||
nonrep <- arrow::read_parquet(paste0(dest, "core/nonrep.parquet")) | ||
cli_alert_info(sprintf("Uploading file to [%s]", project)) | ||
armadillo.upload_table(project, "2_1-core-1_0", nonrep) | ||
rm(nonrep) | ||
check_cohort_exists(project) | ||
table <- sprintf("%s/2_1-core-1_0/nonrep", project) | ||
if(table %in% armadillo.list_tables(project)){ | ||
cli_alert_success(paste0(table, " exists")) | ||
|
||
if (admin_pwd != "") { | ||
cli_h2("Basic authentication") | ||
cli_alert_info("Logging in as admin user") | ||
armadillo.login_basic(url, "admin", admin_pwd) | ||
project <- generate_random_project_name(skip_tests) | ||
print(project) | ||
cli_alert_info(sprintf("Creating project [%s]", project)) | ||
armadillo.create_project(project) | ||
nonrep <- arrow::read_parquet(paste0(dest, "core/nonrep.parquet")) | ||
cli_alert_info(sprintf("Uploading file to [%s]", project)) | ||
armadillo.upload_table(project, "2_1-core-1_0", nonrep) | ||
rm(nonrep) | ||
check_cohort_exists(project) | ||
table <- sprintf("%s/2_1-core-1_0/nonrep", project) | ||
if (table %in% armadillo.list_tables(project)) { | ||
cli_alert_success(paste0(table, " exists")) | ||
} else { | ||
exit_test(paste0(table, " doesn't exist")) | ||
} | ||
cli_alert_info(sprintf("Deleting [%s]", project)) | ||
armadillo.delete_project(project) | ||
} else { | ||
exit_test(paste0(table, " doesn't exist")) | ||
cli_alert_warning("Testing basic authentication skipped, admin password not available") | ||
} | ||
cli_alert_info(sprintf("Deleting [%s]", project)) | ||
armadillo.delete_project(project) | ||
} else { | ||
cli_alert_warning("Testing basic authentication skipped, admin password not available") | ||
} | ||
cli_alert_success(sprintf("%s passed!", test_name)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,17 @@ | ||
prepare_resources <- function(rda_dir, skip_tests) { | ||
test_name <- "prepare_resources" | ||
if (do_skip_test(test_name, skip_tests)) { | ||
return() | ||
} | ||
|
||
prepare_resources <- function(resource_path, url, skip_tests) { | ||
test_name <- "prepare-resources" | ||
if (any(skip_tests %in% test_name)) { | ||
return(cli_alert_info(sprintf("Test '%s' skipped", test_name))) | ||
} | ||
|
||
if (!file.exists(rda_dir)) { | ||
cli_alert_warning("Unable to locate gse66351_1.rda in testing directory, downloading.") | ||
download.file("https://github.com/isglobal-brge/brge_data_large/raw/master/data/gse66351_1.rda", rda_dir) | ||
if (!file.exists(resource_path)) { | ||
cli_alert_warning(sprintf("Unable to locate %s, downloading.", resource_path)) | ||
download.file(url, resource_path) | ||
} | ||
|
||
cli_alert_info("Checking if rda dir exists") | ||
if (rda_dir == "" || !file.exists(rda_dir)) { | ||
exit_test(sprintf("File [%s] doesn't exist", rda_dir)) | ||
if (resource_path == "" || !file.exists(resource_path)) { | ||
exit_test(sprintf("File [%s] doesn't exist", resource_path)) | ||
} | ||
cli_alert_success(sprintf("%s passed!", test_name)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.