-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
1 parent
6850ce8
commit c42ec44
Showing
14 changed files
with
136 additions
and
128 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
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,4 @@ | ||
require('./createResourceGroup'); | ||
require('./deployFunctions'); | ||
require('./deployResources'); | ||
require('./initializeResources'); |
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,5 +1,7 @@ | ||
'use strict'; | ||
|
||
const azureCli = require('./azureCli'); | ||
|
||
module.exports = { | ||
azureCli: require('./azureCli') | ||
}; | ||
azureCli, | ||
}; |
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,56 +1,67 @@ | ||
'use strict'; | ||
|
||
const azureCli = require('../azureCli'); | ||
const assert = require('assert'); | ||
|
||
const TEST_RESOURCE_GROUP_NAME = 'test-rg-serverless'; | ||
const TEST_RESOURCE_GROUP_LOCATION = 'West US'; | ||
const TEST_RESOURCE_GROUP_DEPLOYMENT = TEST_RESOURCE_GROUP_NAME + '-deployment'; | ||
const TEST_TEMPLATE_PATH = "fixtures/test-deploy.json"; | ||
const TEST_PARAMETERS_PATH = "fixtures/test-parameters.json"; | ||
|
||
const SUCCEEDED = "Succeeded"; | ||
|
||
describe('azureCli', () => { | ||
|
||
afterEach( (done) => { | ||
setTimeout(done, 10000); | ||
}); | ||
|
||
it('can create a resource group', (done) => { | ||
return azureCli.createResourceGroup(TEST_RESOURCE_GROUP_NAME, TEST_RESOURCE_GROUP_LOCATION).then( (result) => { | ||
assert.equal(result.name, TEST_RESOURCE_GROUP_NAME); | ||
assert.equal(result.properties.provisioningState, SUCCEEDED); | ||
|
||
assert.equal(result.location, "westus"); | ||
done(); | ||
}); | ||
}); | ||
|
||
it('can deploy a resource group', (done) => { | ||
return azureCli.deployResourceGroup(TEST_TEMPLATE_PATH, TEST_PARAMETERS_PATH, TEST_RESOURCE_GROUP_NAME, TEST_RESOURCE_GROUP_DEPLOYMENT).then( (result) => { | ||
assert.equal(result.name, TEST_RESOURCE_GROUP_NAME); | ||
assert.equal(result.properties.provisioningState, SUCCEEDED); | ||
|
||
done(); | ||
}); | ||
}); | ||
|
||
it('can show a resource group', (done) => { | ||
return azureCli.showResourceGroup(TEST_RESOURCE_GROUP_NAME).then( (result) => { | ||
assert.equal(result.name, TEST_RESOURCE_GROUP_NAME); | ||
assert.equal(result.resources.length, 1); | ||
|
||
done(); | ||
}); | ||
}); | ||
|
||
it('can delete resource group', (done) => { | ||
return azureCli.deleteResourceGroup(TEST_RESOURCE_GROUP_NAME).then( () => { | ||
azureCli.showResourceGroup(TEST_RESOURCE_GROUP_NAME).catch(() => { | ||
done(); | ||
}); | ||
}); | ||
}); | ||
|
||
}); | ||
// Below tests call out to the real Azure Cli - and will | ||
// create real resources. | ||
// ---------------------------------------------------------------------------------------------- | ||
|
||
// const azureCli = require('../azureCli'); | ||
// const assert = require('assert'); | ||
|
||
// const RESOURCE_GROUP_NAME = 'test-rg-serverless'; | ||
// const RESOURCE_GROUP_LOCATION = 'West US'; | ||
// const RESOURCE_GROUP_DEPLOYMENT = `${RESOURCE_GROUP_NAME}-deployment`; | ||
// const TEMPLATE_PATH = 'fixtures/test-deploy.json'; | ||
// const PARAMETERS_PATH = 'fixtures/test-parameters.json'; | ||
// const SUCCEEDED = 'Succeeded'; | ||
|
||
// describe('azureCli', () => { | ||
// afterEach( (done) => { | ||
// setTimeout(done, 10000); | ||
// }); | ||
|
||
|
||
// it('can create a resource group', (done) => { | ||
// return azureCli.createResourceGroup(RESOURCE_GROUP_NAME, RESOURCE_GROUP_LOCATION) | ||
// .then(result => { | ||
// assert.equal(result.name, RESOURCE_GROUP_NAME); | ||
// assert.equal(result.properties.provisioningState, SUCCEEDED); | ||
|
||
// assert.equal(result.location, 'westus'); | ||
// done(); | ||
// }); | ||
// }); | ||
|
||
// it('can deploy a resource group', (done) => { | ||
// const groupName = RESOURCE_GROUP_NAME; | ||
// const groupDeployment = RESOURCE_GROUP_DEPLOYMENT; | ||
// const params = PARAMETERS_PATH; | ||
// const template = TEMPLATE_PATH; | ||
// | ||
// return azureCli.deployResourceGroup(template, params, groupName, groupDeployment) | ||
// .then(result => { | ||
// assert.equal(result.name, RESOURCE_GROUP_NAME); | ||
// assert.equal(result.properties.provisioningState, SUCCEEDED); | ||
|
||
// done(); | ||
// }); | ||
// }); | ||
|
||
// it('can show a resource group', (done) => { | ||
// return azureCli.showResourceGroup(RESOURCE_GROUP_NAME) | ||
// .then(result => { | ||
// assert.equal(result.name, RESOURCE_GROUP_NAME); | ||
// assert.equal(result.resources.length, 1); | ||
|
||
// done(); | ||
// }); | ||
// }); | ||
|
||
// it('can delete resource group', (done) => { | ||
// return azureCli.deleteResourceGroup(TEST_RESOURCE_GROUP_NAME) | ||
// .then(() => { | ||
// azureCli.showResourceGroup(TEST_RESOURCE_GROUP_NAME).catch(() => { | ||
// done(); | ||
// }); | ||
// }); | ||
// }); | ||
// }); |
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 @@ | ||
require('./azureCli'); |
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