-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#231 add test-suit for basic features
- Loading branch information
Thorsten Marx
committed
Sep 10, 2024
1 parent
92658bc
commit e0d7182
Showing
11 changed files
with
108 additions
and
23 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
File renamed without changes.
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,27 @@ | ||
import { check } from 'k6'; | ||
import http from 'k6/http'; | ||
|
||
export const options = { | ||
thresholds: { | ||
http_req_failed: ['rate<0.01'], // http errors should be less than 1% | ||
http_req_duration: ['p(95)<250'], // 95% of requests should be below 200ms | ||
}, | ||
}; | ||
|
||
export default function () { | ||
|
||
|
||
var res = http.get("http://localhost2:1010/extension/test2"); | ||
check(res, { | ||
'is status 200': (r) => r.status === 200, | ||
'verify content': (r) => | ||
r.body.includes('http extension via hook!'), | ||
}); | ||
res = http.get("http://localhost2:1010/hello-route"); | ||
check(res, { | ||
'is status 200': (r) => r.status === 200, | ||
'verify content': (r) => | ||
r.body.includes('route via hook!'), | ||
}); | ||
|
||
} |
File renamed without changes.
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,37 @@ | ||
import { check } from 'k6'; | ||
import http from 'k6/http'; | ||
|
||
export const options = { | ||
thresholds: { | ||
http_req_failed: ['rate<0.01'], // http errors should be less than 1% | ||
http_req_duration: ['p(95)<250'], // 95% of requests should be below 200ms | ||
}, | ||
}; | ||
|
||
export default function () { | ||
|
||
let res = http.get("http://localhost2:1010/example/route"); | ||
check(res, { | ||
'is status 200': (r) => r.status === 200, | ||
}); | ||
|
||
res = http.get("http://localhost2:1010/module/example-module/world"); | ||
check(res, { | ||
'is status 200': (r) => r.status === 200, | ||
'verify content': (r) => | ||
r.body.includes('Hello world!'), | ||
}); | ||
|
||
res = http.get("http://localhost2:1010/example/route"); | ||
check(res, { | ||
'is status 200': (r) => r.status === 200, | ||
'verify content': (r) => | ||
r.body.includes('example route\nHELlO: NO-NAME'), | ||
}); | ||
res = http.get("http://localhost2:1010/example/route?name=test-suite"); | ||
check(res, { | ||
'is status 200': (r) => r.status === 200, | ||
'verify content': (r) => | ||
r.body.includes('example route\nHELlO: test-suite'), | ||
}); | ||
} |
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,35 @@ | ||
import { check } from 'k6'; | ||
import http from 'k6/http'; | ||
|
||
export const options = { | ||
thresholds: { | ||
http_req_failed: ['rate<0.01'], // http errors should be less than 1% | ||
http_req_duration: ['p(95)<250'], // 95% of requests should be below 200ms | ||
}, | ||
}; | ||
|
||
export default function () { | ||
|
||
|
||
var res = http.get("http://localhost2:1010"); | ||
check(res, { | ||
'is status 200': (r) => r.status === 200, | ||
'template supplier via extension hook': (r) => | ||
r.body.includes('My name is CondationCMS'), | ||
}); | ||
res = http.get("http://localhost2:1010"); | ||
check(res, { | ||
'is status 200': (r) => r.status === 200, | ||
'template function via extension hook': (r) => | ||
r.body.includes('Hello CondationCMS'), | ||
}); | ||
|
||
res = http.get("http://localhost2:1010"); | ||
check(res, { | ||
'is status 200': (r) => r.status === 200, | ||
'template calling a shortcode': (r) => | ||
r.body.includes("Hello CondationCMS, I'm a TAG!"), | ||
}); | ||
|
||
|
||
} |