This repository has been archived by the owner on Oct 31, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* dev: Wrap expectations in test_that() Fix issues with blobs #65 Fix errors in blob functions #65 First example azureCreateHDI function New ARM test script test-6-ARM.R
- Loading branch information
Showing
9 changed files
with
239 additions
and
191 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 |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
*.rxproj.user | ||
*.suo | ||
*.sln | ||
.Rproj.user |
Large diffs are not rendered by default.
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
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,11 @@ | ||
\dontrun{ | ||
library(AzureSMR) | ||
|
||
azureCreateHDI(asc, resourceGroup = resourceGroup_name, clustername = "azuresmr_hdi_test", | ||
storageAccount = "azuresmrhditestsa", | ||
adminUser = "hdiadmin", adminPassword = "Azuresmr_password1", | ||
sshUser = "sssUser_test1", sshPassword = "sshUser_password", | ||
kind = "rserver", | ||
debug = TRUE | ||
) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,103 @@ | ||
if (interactive()) library("testthat") | ||
|
||
settingsfile <- system.file("tests/testthat/config.json", package = "AzureSMR") | ||
config <- read.AzureSMR.config(settingsfile) | ||
|
||
# ------------------------------------------------------------------------ | ||
|
||
context("ARM") | ||
|
||
asc <- createAzureContext() | ||
with(config, | ||
setAzureContext(asc, tenantID = tenantID, clientID = clientID, authKey = authKey) | ||
) | ||
|
||
azureAuthenticate(asc, verbose = FALSE) | ||
|
||
timestamp <- format(Sys.time(), format = "%y%m%d%H%M") | ||
resourceGroup_name <- paste0("AzureSMtest_", timestamp) | ||
|
||
test_that("Can create resource group", { | ||
skip_if_missing_config(settingsfile) | ||
|
||
res <- azureCreateResourceGroup(asc, location = "centralus", resourceGroup = resourceGroup_name) | ||
expect_true(res) | ||
|
||
wait_for_azure( | ||
resourceGroup_name %in% azureListRG(asc)$resourceGroup | ||
) | ||
expect_true(resourceGroup_name %in% azureListRG(asc)$resourceGroup) | ||
}) | ||
|
||
|
||
paramJSON1 <- '"parameters": {"storageAccountType": {"value": "Standard_GRS"}}' | ||
|
||
templateJSON1 <- ' | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"storageAccountType": { | ||
"type": "string", | ||
"defaultValue": "Standard_LRS", | ||
"allowedValues": [ | ||
"Standard_LRS", | ||
"Standard_GRS", | ||
"Standard_ZRS", | ||
"Premium_LRS" | ||
], | ||
"metadata": {"description": "Storage Account type"} | ||
} | ||
}, | ||
"variables": {"storageAccountName": "[uniquestring(resourceGroup().id)]"}, | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.Storage/storageAccounts", | ||
"name": "[uniquestring(resourceGroup().id)]", | ||
"apiVersion": "2016-01-01", | ||
"location": "[resourceGroup().location]", | ||
"sku": {"name": "Standard_GRS"}, | ||
"kind": "Storage", | ||
"properties": {} | ||
} | ||
], | ||
"outputs": {"storageAccountName": {"type": "string","value": "[uniquestring(resourceGroup().id)]"}} | ||
} | ||
' | ||
|
||
paramJSON2 <- ' | ||
"parameters" : { | ||
"vmssName": {"value": "azuresmrvmss"}, | ||
"instanceCount": {"value": 2}, | ||
"adminUsername": {"value": "ubuntu"}, | ||
"adminPassword": {"value": "Password123"} | ||
}' | ||
|
||
context(" - deploy 1") | ||
test_that("Can create resource from json", { | ||
res <- azureDeployTemplate(asc, deplname = "Deploy1", | ||
templateJSON = templateJSON1, | ||
paramJSON = paramJSON1, | ||
resourceGroup = resourceGroup_name, | ||
verbose = FALSE) | ||
expect_true(res) | ||
}) | ||
|
||
|
||
context(" - deploy 2") | ||
test_that("Can create resource from URL", { | ||
tempURL = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/201-vmss-linux-jumpbox/azuredeploy.json" | ||
res <- azureDeployTemplate(asc, deplname = "Deploy2", | ||
templateURL = tempURL, | ||
paramJSON = paramJSON2, | ||
resourceGroup = resourceGroup_name, | ||
verbose = FALSE) | ||
expect_true(res) | ||
}) | ||
|
||
test_that("Can delete resource group", { | ||
skip_if_missing_config(settingsfile) | ||
|
||
azureDeleteResourceGroup(asc, resourceGroup = resourceGroup_name) | ||
|
||
}) |