-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #209 from 3pillarlabs/develop
- Loading branch information
Showing
24 changed files
with
835 additions
and
360 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
layout: post | ||
title: "Update Number of Threads per AWS Instance" | ||
date: 2020-05-17 19:30:00 +0530 | ||
categories: jekyll update | ||
--- | ||
|
||
The latest release of **Hailstorm** added the following feature: | ||
|
||
- It is now possible to update the number of threads per agent (EC2 instance) in an AWS cluster. | ||
Earlier, the entire cluster needed to be disabled, and a new cluster needed to be created. This | ||
features saves effort and time when cluster properties need to be changed during a load test. |
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 |
---|---|---|
|
@@ -3,6 +3,6 @@ | |
# Version | ||
module Hailstorm | ||
module Api | ||
VERSION = '1.0.14' | ||
VERSION = '1.0.15' | ||
end | ||
end |
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,7 @@ | ||
const devConf = require('./wdio.conf'); | ||
devConf.config.baseUrl = 'http://localhost:8080'; | ||
devConf.config.specs = ['./features/amazon_cloud_load_generation.feature'] | ||
devConf.config.cucumberOpts.failFast = true; | ||
devConf.config.logLevel = 'info'; | ||
// devConf.config.cucumberOpts.tagExpression = '@focus'; | ||
exports.config = devConf.config; |
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
145 changes: 145 additions & 0 deletions
145
hailstorm-web-client/src/ClusterConfiguration/AWSForm.test.tsx
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,145 @@ | ||
import React from 'react'; | ||
import { AmazonCluster, Cluster, Project } from '../domain'; | ||
import { AWSForm } from './AWSForm'; | ||
import { AWSInstanceChoiceOption, AWSRegionList } from './domain'; | ||
import { AWSEC2PricingService } from '../services/AWSEC2PricingService'; | ||
import { fireEvent, render, wait } from '@testing-library/react'; | ||
import { AWSRegionService } from '../services/AWSRegionService'; | ||
import { mount } from 'enzyme'; | ||
import { ClusterService } from '../services/ClusterService'; | ||
|
||
describe('<AWSForm />', () => { | ||
const activeProject: Project = { | ||
id: 1, | ||
code: 'a', | ||
title: 'A', | ||
autoStop: true, | ||
running: false, | ||
jmeter: { | ||
files: [ | ||
{ id: 10, name: 'a.jmx', properties: new Map([["foo", "10"]]) }, | ||
{ id: 11, name: 'a.csv', dataFile: true } | ||
] | ||
}, | ||
clusters: [] | ||
}; | ||
|
||
const dispatch = jest.fn(); | ||
|
||
function createComponent() { | ||
return ( | ||
<AWSForm | ||
{...{activeProject, dispatch}} | ||
/> | ||
) | ||
} | ||
|
||
let fetchPricing: Promise<AWSInstanceChoiceOption[]>; | ||
let fetchRegions: Promise<AWSRegionList>; | ||
|
||
beforeEach(() => { | ||
fetchPricing = Promise.resolve([ | ||
new AWSInstanceChoiceOption({ | ||
instanceType: 'm3a.small', numInstances: 1, maxThreadsByInstance: 500, hourlyCostByInstance: 0.092 | ||
}) | ||
]); | ||
|
||
jest.spyOn(AWSEC2PricingService.prototype, 'list').mockReturnValue(fetchPricing); | ||
}); | ||
|
||
beforeEach(() => { | ||
fetchRegions = Promise.resolve<AWSRegionList>({ | ||
regions: [ | ||
{ | ||
code: 'North America', | ||
title: 'North America', | ||
regions: [ | ||
{ code: 'us-east-1', title: 'Ohio, US East' } | ||
] | ||
} | ||
], | ||
|
||
defaultRegion: { code: 'us-east-1', title: 'Ohio, US East' } | ||
}); | ||
|
||
jest.spyOn(AWSRegionService.prototype, 'list').mockReturnValue(fetchRegions); | ||
}); | ||
|
||
it('should show form fields', async () => { | ||
const utils = render(createComponent()); | ||
await fetchPricing; | ||
await utils.findByTestId('AWS Access Key'); | ||
await utils.findByTestId('AWS Secret Key'); | ||
await utils.findByTestId('VPC Subnet'); | ||
await utils.findByTestId('Max. Users / Instance'); | ||
}); | ||
|
||
|
||
it('should show control for instance specifications', async () => { | ||
const component = mount(createComponent()); | ||
await fetchRegions; | ||
await fetchPricing; | ||
component.update(); | ||
expect(component).toContainExactlyOneMatchingElement('AWSInstanceChoice'); | ||
}); | ||
|
||
it('should show estimated cost based on defaults', async () => { | ||
const {findByText} = render(createComponent()); | ||
await fetchRegions; | ||
await fetchPricing; | ||
const message = await findByText(/Cluster Cost/i); | ||
expect(message).toBeDefined(); | ||
}); | ||
|
||
it('should show control for AWS region', () => { | ||
const component = mount(createComponent()); | ||
expect(component).toContainExactlyOneMatchingElement('AWSRegionChoice'); | ||
}); | ||
|
||
|
||
it('should validate cluster inputs', async () => { | ||
const {findByText, findByTestId, findAllByText} = render(createComponent()); | ||
await fetchRegions; | ||
await fetchPricing; | ||
await findByText(/Cluster Cost/i); | ||
const form = await findByTestId('AWSForm'); | ||
fireEvent.submit(form); | ||
expect(dispatch).not.toBeCalled(); | ||
const messages = await findAllByText(/blank/i); | ||
expect(messages.length).toEqual(2); | ||
}); | ||
|
||
it('should save the cluster', async () => { | ||
const savedCluster: AmazonCluster = { | ||
id: 23, | ||
code: 'singing-penguin-23', | ||
title: '', | ||
type: 'AWS', | ||
accessKey: 'A', | ||
secretKey: 'S', | ||
region: 'us-east-1', | ||
instanceType: 'm3a.small', | ||
maxThreadsByInstance: 500 | ||
}; | ||
|
||
const createdCluster = Promise.resolve<Cluster>(savedCluster); | ||
const createSpy = jest.spyOn(ClusterService.prototype, 'create').mockReturnValue(createdCluster); | ||
const {findByTestId, findByText} = render(createComponent()); | ||
await fetchRegions; | ||
await fetchPricing; | ||
await findByText(/Cluster Cost/i); | ||
const accessKey = await findByTestId('AWS Access Key'); | ||
const secretKey = await findByTestId('AWS Secret Key'); | ||
fireEvent.change(accessKey, {target: {value: savedCluster.accessKey}}); | ||
fireEvent.change(secretKey, {target: {value: savedCluster.secretKey}}); | ||
const save = await findByText(/save/i); | ||
fireEvent.click(save); | ||
await createdCluster; | ||
await wait(); | ||
|
||
expect(createSpy).toBeCalled(); | ||
expect(dispatch).toBeCalled(); | ||
const action = dispatch.mock.calls[0][0] as {payload: Cluster}; | ||
expect(action.payload).toEqual(savedCluster); | ||
}); | ||
}); |
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.