Skip to content

Commit

Permalink
Brought over scripting changes to the yamlparser from common
Browse files Browse the repository at this point in the history
  • Loading branch information
tkmcmaster committed Sep 14, 2023
1 parent 15675e2 commit 7248094
Show file tree
Hide file tree
Showing 8 changed files with 390 additions and 37 deletions.
1 change: 1 addition & 0 deletions common/test/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ export function mockSqs (): AwsStub<SQSServiceInputTypes, SQSServiceOutputTypes,
export function resetMockSqs (): void {
if (_mockedSqsInstance !== undefined) {
_mockedSqsInstance.reset();
_mockedSqsInstance.restore();
sqsConfig.sqsClient = undefined as any;
_mockedSqsInstance = undefined;
}
Expand Down
25 changes: 25 additions & 0 deletions common/test/scripting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
load_pattern:
- !linear
from: 1%
to: 100%
over: 1m
- !linear
from: 100%
to: 100%
over: 1m
config:
client:
# request_timeout: { secs: 10, nanos: 0 }
# request_timeout: 10s
headers:
TestTime: ${x:epoch("ms")}
Accept: application/json
FS-User-Agent-Chain: PPAAS-Agent-Performance Test
User-Agent: FS-QA-SystemTest PPAAS Agent Performance Test
general:
bucket_size: 1m
log_provider_stats: true
endpoints:
- method: GET
url: http://127.0.0.1:8080/healthcheck
peak_load: 30hpm
32 changes: 32 additions & 0 deletions common/test/scriptingheadersall.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
load_pattern:
- !linear
from: 1%
to: 100%
over: 1m
- !linear
from: 100%
to: 100%
over: 1m
config:
client:
headers:
TestTime: ${x:epoch("ms")}
Accept: application/json
FS-User-Agent-Chain: PPAAS-Agent-Performance Test
User-Agent: FS-QA-SystemTest PPAAS Agent Performance Test
general:
bucket_size: 1m
log_provider_stats: true
providers:
startProvider: !response
endProvider: !response
endpoints:
- method: GET
url: http://127.0.0.1:8080/healthcheck
peak_load: 30hpm
provides:
startProvider:
query:
select: response.headers_all
where: response.status < 500
send: if_not_full
46 changes: 46 additions & 0 deletions common/test/scriptingnopeakload.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
load_pattern:
- !linear
from: 1%
to: 100%
over: 1m
- !linear
from: 100%
to: 100%
over: 1m
config:
client:
headers:
TestTime: ${x:epoch("ms")}
Accept: application/json
FS-User-Agent-Chain: PPAAS-Agent-Performance Test
User-Agent: FS-QA-SystemTest PPAAS Agent Performance Test
general:
bucket_size: 1m
log_provider_stats: true
providers:
startProvider: !response
endProvider: !response
endpoints:
- method: GET
url: http://127.0.0.1:8080/healthcheck
provides:
startProvider:
query:
select: response.body
where: response.status == 200
send: block
- method: GET
url: http://127.0.0.1:8080/healthcheck
headers:
StartProvider: ${p:startProvider}
peak_load: 30hpm
provides:
endProvider:
query:
select: response.body
where: response.status == 200
send: if_not_full
- method: GET
url: http://127.0.0.1:8080/healthcheck
headers:
EndProvider: ${p:endProvider}
31 changes: 31 additions & 0 deletions common/test/scriptingwithenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
vars:
rampTime: 1m
loadTime: 1m
serviceUrlAgent: ${e:SERVICE_URL_AGENT}
test: '${x:parseInt(${e:TEST})}'
load_pattern:
- !linear
from: 1%
to: 100%
over: ${v:rampTime}
- !linear
from: 100%
to: 100%
over: ${v:loadTime}
config:
client:
# request_timeout: { secs: 10, nanos: 0 }
# request_timeout: 10s
headers:
TestTime: ${x:epoch("ms")}
Accept: application/json
FS-User-Agent-Chain: PPAAS-Agent-Performance Test
User-Agent: FS-QA-SystemTest PPAAS Agent Performance Test
test: ${v:test}
general:
bucket_size: 1m
log_provider_stats: true
endpoints:
- method: GET
url: http://${v:serviceUrlAgent}/healthcheck
peak_load: 30hpm
59 changes: 59 additions & 0 deletions common/test/scriptingwithfiles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
vars:
rampTime: 1m
loadTime: 1m
logDir: ${e:SPLUNK_PATH}
load_pattern:
- !linear
from: 1%
to: 100%
over: ${v:rampTime}
- !linear
from: 100%
to: 100%
over: ${v:loadTime}
config:
client:
# request_timeout: { secs: 10, nanos: 0 }
# request_timeout: 10s
headers:
TestTime: ${x:epoch("ms")}
Accept: application/json
FS-User-Agent-Chain: PPAAS-Agent-Performance Test
User-Agent: FS-QA-SystemTest PPAAS Agent Performance Test
general:
bucket_size: 1m
log_provider_stats: true
loggers:
remote_logger:
query:
select:
timestamp: epoch("ms")
request: request["start-line"]
method: request.method
url: request.url
response: response["start-line"]
status: response.status
where: response.status >= 400
limit: 1000
to: !file '${v:logDir}/http-err-${x:epoch("ms")}.json'
pretty: false
local_logger:
query:
select: '`${request["start-line"]},${response["start-line"]},${request.method},${response.status}`'
where: response.status >= 400
limit: 1000
to: !file 'errors.csv'
pretty: false
providers:
sessionId: !response
# buffer: 100
auto_return: force
file: !file
path: 's3test.txt'
repeat: true
format: line
random: true
endpoints:
- method: GET
url: http://127.0.0.1:8080/healthcheck
peak_load: 30hpm
30 changes: 30 additions & 0 deletions common/test/scriptingwithvars.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
vars:
rampTime: 1m
loadTime: 1m
totalTime: 2m
serviceUrlAgent: 127.0.0.1:8080
load_pattern:
- !linear
from: 1%
to: 100%
over: ${v:rampTime}
- !linear
from: 100%
to: 100%
over: ${v:loadTime}
config:
client:
# request_timeout: { secs: 10, nanos: 0 }
# request_timeout: 10s
headers:
TestTime: ${x:epoch("ms")}
Accept: application/json
FS-User-Agent-Chain: PPAAS-Agent-Performance Test
User-Agent: FS-QA-SystemTest PPAAS Agent Performance Test
general:
bucket_size: 1m
log_provider_stats: true
endpoints:
- method: GET
url: http://${v:serviceUrlAgent}/healthcheck
peak_load: 30hpm
Loading

0 comments on commit 7248094

Please sign in to comment.