-
Notifications
You must be signed in to change notification settings - Fork 493
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(fargate): add aws fargate tests to cli repo (#2407)
* test(fargate): add simple bom test * test(fargate): add mixed hierarchy test * test(fargate): add ensure test * test(fargate): add ensure and expect failure test * test(fargate): add expect failure test * test(fargate): add kitchen sink test with multiple features * test(fargate): add lots of output test * test(fargate): add memory hog test * test(fargate): increase think time in memory-hog * test(fargate): increase test timeout due to aws tests being long * test(cli): create report abstraction and use in fargate tests * test(fargate): record fargate tests to cloud dashboard * test(fargate): rename fargate scenarios to improve debugging * test(fargate): increase deps for mixed-hierarchy test * test(fargate): use 51 workers as in original test
- Loading branch information
1 parent
84b6b14
commit 049205b
Showing
40 changed files
with
1,552 additions
and
17 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
18 changes: 18 additions & 0 deletions
18
...ages/artillery/test/cloud-e2e/fargate/fixtures/cli-exit-conditions/with-expect-ensure.yml
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,18 @@ | ||
config: | ||
target: "http://asciiart.artillery.io:8080" | ||
plugins: | ||
expect: {} | ||
ensure: | ||
p99: 10000 | ||
thresholds: | ||
- "http.response_time.p95": 1 | ||
phases: | ||
- duration: 5 | ||
arrivalRate: 1 | ||
scenarios: | ||
- name: expect-ensure-exit-condition-test | ||
flow: | ||
- get: | ||
url: "/" | ||
expect: | ||
- statusCode: 300 |
14 changes: 14 additions & 0 deletions
14
packages/artillery/test/cloud-e2e/fargate/fixtures/cli-exit-conditions/with-expect.yml
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,14 @@ | ||
config: | ||
target: "http://asciiart.artillery.io:8080" | ||
plugins: | ||
expect: {} | ||
phases: | ||
- duration: 5 | ||
arrivalRate: 1 | ||
scenarios: | ||
- name: expect-exit-condition-test | ||
flow: | ||
- get: | ||
url: "/" | ||
expect: | ||
- statusCode: 300 |
2 changes: 2 additions & 0 deletions
2
packages/artillery/test/cloud-e2e/fargate/fixtures/cli-kitchen-sink/kitchen-sink-env
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,2 @@ | ||
DOTENV1=/ | ||
DOTENV2=/dino |
22 changes: 22 additions & 0 deletions
22
packages/artillery/test/cloud-e2e/fargate/fixtures/cli-kitchen-sink/kitchen-sink.yml
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,22 @@ | ||
config: | ||
target: http://asciiart.artillery.io:8080 | ||
plugins: | ||
ensure: {} | ||
phases: | ||
- duration: 20 | ||
arrivalRate: 1 | ||
ensure: | ||
p99: 10000 | ||
thresholds: | ||
- "http.response_time.p99": 10000 | ||
scenarios: | ||
- name: load homepage | ||
flow: | ||
- get: | ||
url: "{{$processEnvironment.SECRET1}}" | ||
- get: | ||
url: "{{$processEnvironment.SECRET2}}" | ||
- get: | ||
url: "{{$processEnvironment.DOTENV1}}" | ||
- get: | ||
url: "{{$processEnvironment.DOTENV2}}" |
14 changes: 14 additions & 0 deletions
14
packages/artillery/test/cloud-e2e/fargate/fixtures/large-output/lots-of-output.yml
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,14 @@ | ||
config: | ||
target: http://asciiart.artillery.io:8080 | ||
phases: | ||
- arrivalRate: 1 | ||
duration: 60 | ||
defaults: | ||
headers: | ||
user-agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" | ||
processor: "./processor.js" | ||
scenarios: | ||
- flow: | ||
- get: | ||
url: "/" | ||
afterResponse: logOutput |
19 changes: 19 additions & 0 deletions
19
packages/artillery/test/cloud-e2e/fargate/fixtures/large-output/processor.js
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,19 @@ | ||
function logOutput(req, res, userContext, events, done) { | ||
for (let i = 0; i < 10; i++) { | ||
events.emit( | ||
'counter', | ||
`very.very.long.name.for.a.counter.metric.so.that.we.generate.a.lot.of.console.output.${Date.now()}${i}`, | ||
1 | ||
); | ||
events.emit( | ||
'histogram', | ||
`very.very.long.name.for.a.histogram.metric.so.that.we.generate.a.lot.of.console.output.${Date.now()}${i}`, | ||
100 | ||
); | ||
} | ||
return done(); | ||
} | ||
|
||
module.exports = { | ||
logOutput | ||
}; |
20 changes: 20 additions & 0 deletions
20
packages/artillery/test/cloud-e2e/fargate/fixtures/memory-hog/memory-hog.yml
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,20 @@ | ||
# 10 VUs, making 10 calls each to a function that allocates 100MB -> ~10GB total | ||
# This will fail with default configuration, which is: | ||
# - 4GB RAM given to workers on Fargate | ||
# - Node.js memory limit of 4GB | ||
|
||
config: | ||
target: http://asciiart.artillery.io:8080 | ||
phases: | ||
- arrivalRate: 1 | ||
duration: 10 | ||
processor: './processor.js' | ||
|
||
scenarios: | ||
- flow: | ||
- loop: | ||
- get: | ||
url: "/armadillo" | ||
beforeRequest: hogSomeRam | ||
- think: 1 | ||
count: 10 |
18 changes: 18 additions & 0 deletions
18
packages/artillery/test/cloud-e2e/fargate/fixtures/memory-hog/processor.js
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,18 @@ | ||
let data = []; | ||
|
||
console.log('NODE_OPTIONS:'); | ||
console.log(process.env.NODE_OPTIONS); | ||
|
||
function hogSomeRam(req, context, events, next) { | ||
// Allocate 100MB | ||
data.push(Buffer.alloc(1024 * 1024 * 100, 1)); | ||
|
||
console.log(new Date(), 'allocated more data'); | ||
console.log('RSS (MB):', process.memoryUsage().rss / 1024 / 1024); | ||
|
||
return next(); | ||
} | ||
|
||
module.exports = { | ||
hogSomeRam | ||
}; |
7 changes: 7 additions & 0 deletions
7
packages/artillery/test/cloud-e2e/fargate/fixtures/mixed-hierarchy/code/functions.js
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 bc = require('@babel/core'); | ||
const uuid = require('uuid'); | ||
const client = require('aws-sdk/clients/lambda'); | ||
|
||
module.exports = { | ||
setUrl: require('./set-url') | ||
}; |
2 changes: 2 additions & 0 deletions
2
packages/artillery/test/cloud-e2e/fargate/fixtures/mixed-hierarchy/code/lib/signer.js
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,2 @@ | ||
const meow = require('../meow'); | ||
module.exports = require('aws4'); |
2 changes: 2 additions & 0 deletions
2
packages/artillery/test/cloud-e2e/fargate/fixtures/mixed-hierarchy/code/meow.js
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,2 @@ | ||
const lodash = require('lodash'); | ||
module.export = 'meow'; |
9 changes: 9 additions & 0 deletions
9
packages/artillery/test/cloud-e2e/fargate/fixtures/mixed-hierarchy/code/set-url.js
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,9 @@ | ||
module.exports = setUrl; | ||
|
||
const AWS = require('aws-sdk'); | ||
const signer = require('./lib/signer'); | ||
|
||
function setUrl(req, res, ctx, ee, done) { | ||
req.url = '/'; | ||
return done(); | ||
} |
22 changes: 22 additions & 0 deletions
22
packages/artillery/test/cloud-e2e/fargate/fixtures/mixed-hierarchy/config/config.yml
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,22 @@ | ||
config: | ||
target: http://asciiart.artillery.io:8080 | ||
processor: "../code/functions.js" | ||
environments: | ||
main: | ||
phases: | ||
- duration: 20 | ||
arrivalRate: 1 | ||
payload: | ||
- path: "../data/variables.csv" # this is resolved relative to the main script for now, NOT this file | ||
fields: ["username", "email"] | ||
plugins: | ||
metrics-by-endpoint: {} | ||
stage: | ||
plugins: | ||
datadog: {} | ||
plugins: | ||
http-file-uploads: | ||
filePaths: | ||
- ../data/files | ||
publish-metrics: | ||
- type: statsd |
Binary file added
BIN
+3.13 MB
...t/cloud-e2e/fargate/fixtures/mixed-hierarchy/data/files/abigail-lynn-316133.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.58 MB
...e2e/fargate/fixtures/mixed-hierarchy/data/files/the-lord-of-the-lens-476134.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions
4
packages/artillery/test/cloud-e2e/fargate/fixtures/mixed-hierarchy/data/variables.csv
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 @@ | ||
bob,bob@example.com | ||
jane,jane@example.com | ||
aditya,aditya@example.com | ||
aadhya,aadhya@example.com |
Oops, something went wrong.