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 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Test Coverage on Azure Pipeline CI (#348)
* Added build.sh * Fixed tests * Added pipeline yml * Fixed pipeline * Removed * Passing in args to script * Added container image * Fixed args * Fixed args * Fixed args * Removed last script * Added test management * Added job dependency * Moved package installation to build.sh * fixed * Added job dependency * Added RProfile site * Fixed REnvironment * Added Rprofile * Added ~/ * Fixing tests * fixed method name * Renaming samples & tests * renamed more tests * Fixed lint * Removed other tests * Fixed directory call for testthat * Added typo and remove sample * Fixed pipeline pointer
- Loading branch information
Showing
31 changed files
with
258 additions
and
147 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: $(Build.SourceBranch)$(Rev:.r) | ||
|
||
trigger: | ||
- master | ||
|
||
resources: | ||
containers: | ||
- container: linux | ||
image: ubuntu:16.04 | ||
|
||
jobs: | ||
- job: Build | ||
displayName: Build Job | ||
condition: succeeded() | ||
pool: | ||
vmImage: 'ubuntu-16.04' | ||
steps: | ||
- task: ShellScript@2 | ||
displayName: Build | ||
inputs: | ||
scriptPath: 'tests/test_scripts/build.sh' | ||
|
||
- script: | | ||
touch ~/.Rprofile | ||
echo "Sys.setenv(BATCH_ACCOUNT_NAME ='"$(BATCH_ACCOUNT_NAME)"');" >> ~/.Rprofile | ||
echo "Sys.setenv(BATCH_ACCOUNT_KEY ='"$(BATCH_ACCOUNT_KEY)"');" >> ~/.Rprofile | ||
echo "Sys.setenv(BATCH_ACCOUNT_URL ='"$(BATCH_ACCOUNT_URL)"');" >> ~/.Rprofile | ||
echo "Sys.setenv(STORAGE_ACCOUNT_NAME ='"$(STORAGE_ACCOUNT_NAME)"');" >> ~/.Rprofile | ||
echo "Sys.setenv(STORAGE_ACCOUNT_KEY ='"$(STORAGE_ACCOUNT_KEY)"');" >> ~/.Rprofile | ||
sudo R \ | ||
-e "getwd()" \ | ||
-e "devtools::install()" \ | ||
-e "devtools::build()" \ | ||
-e "doAzureParallel::generateCredentialsConfig('test_credentials.json', batchAccountName = Sys.getenv('BATCH_ACCOUNT_NAME'), batchAccountKey = Sys.getenv('BATCH_ACCOUNT_KEY'), batchAccountUrl = Sys.getenv('BATCH_ACCOUNT_URL'), storageAccountName = Sys.getenv('STORAGE_ACCOUNT_NAME'), storageAccountKey = Sys.getenv('STORAGE_ACCOUNT_KEY'))" | ||
condition: succeeded() | ||
displayName: Create R Profile Environment Setting | ||
- task: ShellScript@2 | ||
displayName: Run Unit Tests | ||
inputs: | ||
scriptPath: 'tests/testthat/unit_tests/unit_tests.sh' |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...conductor/package_management_cluster.json → ...nt/bioconductor/bioconductor_cluster.json
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,13 @@ | ||
#!/bin/bash | ||
sudo echo "deb http://cran.rstudio.com/bin/linux/ubuntu trusty/" | sudo tee -a /etc/apt/sources.list | ||
|
||
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9 | ||
gpg -a --export E084DAB9 | sudo apt-key add - | ||
|
||
sudo apt-get update | ||
sudo apt-get install -y r-base r-base-dev libcurl4-openssl-dev | ||
sudo apt-get install -y libssl-dev libxml2-dev libgdal-dev libproj-dev libgsl-dev | ||
|
||
sudo R \ | ||
-e "getwd();" \ | ||
-e "install.packages(c('devtools', 'remotes', 'testthat', 'roxygen2'));" |
This file was deleted.
Oops, something went wrong.
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,81 @@ | ||
context("Cluster Management Test") | ||
|
||
test_that("Create Cluster Test", { | ||
testthat::skip_on_travis() | ||
source("utility.R") | ||
|
||
settings <- getSettings() | ||
cluster <- | ||
doAzureParallel::makeCluster(settings$clusterConfig, wait = FALSE) | ||
|
||
cluster <- getCluster(cluster$poolId) | ||
clusterList <- getClusterList() | ||
filter <- list() | ||
filter$state <- c("active", "deleting") | ||
|
||
testthat::expect_true('test-pool' %in% clusterList$Id) | ||
}) | ||
|
||
test_that("Get Cluster Test", { | ||
testthat::skip_on_travis() | ||
source("utility.R") | ||
|
||
settings <- getSettings() | ||
|
||
cluster <- | ||
doAzureParallel::makeCluster(settings$clusterConfig, wait = FALSE) | ||
|
||
cluster <- getCluster(cluster$poolId) | ||
clusterList <- getClusterList() | ||
filter <- list() | ||
filter$state <- c("active", "deleting") | ||
|
||
testthat::expect_true('test-pool' %in% clusterList$Id) | ||
|
||
clusterList <- getClusterList(filter) | ||
|
||
for (i in 1:length(clusterList$State)) { | ||
testthat::expect_true(clusterList$State[i] == 'active' || | ||
clusterList$State[i] == 'deleting') | ||
} | ||
}) | ||
|
||
test_that("Autoscale Cluster Test", { | ||
testthat::skip_on_travis() | ||
source("utility.R") | ||
|
||
settings <- getSettings() | ||
|
||
cluster <- | ||
doAzureParallel::makeCluster(settings$clusterConfig, wait = FALSE) | ||
|
||
cluster <- getCluster(cluster$poolId) | ||
clusterList <- getClusterList() | ||
filter <- list() | ||
filter$state <- c("active", "deleting") | ||
|
||
testthat::expect_true('test-pool' %in% clusterList$Id) | ||
|
||
clusterList <- getClusterList(filter) | ||
|
||
for (i in 1:length(clusterList$State)) { | ||
testthat::expect_true(clusterList$State[i] == 'active' || | ||
clusterList$State[i] == 'deleting') | ||
} | ||
}) | ||
|
||
test_that("Delete Cluster Test", { | ||
testthat::skip_on_travis() | ||
source("utility.R") | ||
|
||
settings <- getSettings() | ||
|
||
cluster <- | ||
doAzureParallel::makeCluster(settings$clusterConfig, wait = FALSE) | ||
|
||
doAzureParallel::stopCluster(cluster) | ||
|
||
testthat::expect_true('test-pool' %in% clusterList$Id) | ||
|
||
clusterList <- getClusterList(filter) | ||
}) |
File renamed without changes.
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
27 changes: 23 additions & 4 deletions
27
tests/testthat/test-foreach-options.R → ...testthat/integration_tests/test-foreach.R
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.