This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Get job result locally * Get job result locally * preserve task sequence in getjobresult * keep task result sequence * keep task result in sequence and as a flat list * fix lintr error * fix typo in error message * delete cluster after test is done * add retry to getJobResultLocal, resolve xml2 issue * fix typo, lintr and missing variable
- Loading branch information
Showing
4 changed files
with
150 additions
and
39 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
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Run this test for users to make sure the local result merge feature | ||
# of doAzureParallel are still working | ||
context("merge job result locally test") | ||
test_that("merge job result locally test", { | ||
testthat::skip("merge job result locally test") | ||
testthat::skip_on_travis() | ||
credentialsFileName <- "credentials.json" | ||
clusterFileName <- "cluster.json" | ||
|
||
doAzureParallel::generateCredentialsConfig(credentialsFileName) | ||
doAzureParallel::generateClusterConfig(clusterFileName) | ||
|
||
doAzureParallel::setCredentials(credentialsFileName) | ||
cluster <- doAzureParallel::makeCluster(clusterFileName) | ||
doAzureParallel::registerDoAzureParallel(cluster) | ||
|
||
setChunkSize(2) | ||
'%dopar%' <- foreach::'%dopar%' | ||
jobId <- | ||
foreach::foreach( | ||
i = 1:11, | ||
.errorhandling = "pass", | ||
.options.azure = list( | ||
enableCloudCombine = FALSE, | ||
wait = FALSE | ||
) | ||
) %dopar% { | ||
i | ||
} | ||
|
||
res <- getJobResult(jobId) | ||
|
||
testthat::expect_equal(length(res), | ||
10) | ||
|
||
for (i in 1:10) { | ||
testthat::expect_equal(res[[i]], | ||
i) | ||
} | ||
|
||
stopCluster(cluster) | ||
}) |