Skip to content

Commit 7624c9d

Browse files
committedJan 20, 2021
PoC: Tested with real symfony app
1 parent 7ebd00d commit 7624c9d

File tree

9 files changed

+2966
-2634
lines changed

9 files changed

+2966
-2634
lines changed
 

‎.gitattributes

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
* text=auto
2+
3+
/tests export-ignore
4+
/.codecov.yml export-ignore
5+
/.gitattributes export-ignore
6+
/.gitignore export-ignore
7+
/.php_cs.dist export-ignore
8+
/buddy.yml export-ignore
9+
/phpunit.xml.dist export-ignore

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
.phpunit.cache
88
/coverage
99
/clover.xml
10+
/var

‎README.md

+28-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# ChaosMonkeySymfonyBundle
22

3-
Chaos Monkey for Symfony applications
3+
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.4-8892BF.svg)](https://php.net/)
4+
5+
Chaos Monkey for Symfony applications. Try to attack your running Symfony App.
46

57
## Assaults
68

@@ -15,6 +17,22 @@ Chaos Monkey for Symfony applications
1517
- Repository (not implemented)
1618
- Service (not implemented)
1719

20+
## How to use
21+
22+
1. Install with composer:
23+
```bash
24+
composer require chaos-php/chaos-monkey-symfony-bundle
25+
```
26+
2. Add Symfony bundle (e.g. `config/bundles.php`):
27+
```php
28+
return [
29+
//... other bundles
30+
Chaos\Monkey\Symfony\ChaosMonkeyBundle::class => ['all' => true],
31+
];
32+
```
33+
3. Add `chaos_monkey.yaml` configuration (copy from below) and enable assaults
34+
4. Watch your app plunge into chaos 🙈🙊🙉 😈
35+
1836
## Configuration reference
1937

2038
```yml
@@ -31,13 +49,21 @@ chaos_monkey:
3149
fill_fraction: 0.95 # percentage of memory filling
3250
exception:
3351
active: false
34-
class: "\RuntimeException"
52+
class: 'RuntimeException'
3553
kill_app:
3654
active: false
3755
watchers: # currently watchers can be enabled/disabled only in container compile time
3856
request: true
3957
```
4058

59+
## Roadmap
60+
- [ ] Query param activator
61+
- [ ] Flex recipe
62+
- [ ] Metrics (for example `chaos_monkey_request_count_assaulted`)
63+
- [ ] Assault profiles - each profile can contain different assaults
64+
- [ ] CustomWatcher (based on container tag)
65+
- [ ] CustomAssault (not implemented)
66+
4167
## License
4268

4369
ChaosMonkeySymfonyBundle is released under the MIT Licence. See the bundled LICENSE file for details.

‎composer.json

+20-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
"name": "chaos-php/chaos-monkey-symfony-bundle",
33
"type": "library",
44
"description": "Chaos Monkey for Symfony applications",
5+
"keywords": [
6+
"php",
7+
"symfony",
8+
"chaos-monkey",
9+
"chaos-engineering",
10+
"chaos-tests",
11+
"quality-assurance"
12+
],
513
"license": "MIT",
614
"authors": [
715
{
@@ -10,12 +18,15 @@
1018
}
1119
],
1220
"require": {
13-
"symfony/framework-bundle": "^5.2",
21+
"php": "^7.4 || ^8.0",
1422
"akondas/php-runtime": "^0.1.0"
1523
},
1624
"require-dev": {
25+
"friendsofphp/php-cs-fixer": "^2.16",
1726
"phpunit/phpunit": "^9.5",
18-
"friendsofphp/php-cs-fixer": "^2.16"
27+
"symfony/browser-kit": "^5.2",
28+
"symfony/framework-bundle": "^5.2",
29+
"symfony/stopwatch": "^5.2"
1930
},
2031
"autoload": {
2132
"psr-4": {
@@ -28,11 +39,18 @@
2839
}
2940
},
3041
"scripts": {
42+
"build": [
43+
"@check-cs",
44+
"@phpunit"
45+
],
3146
"check-cs": [
3247
"php-cs-fixer fix --dry-run --diff"
3348
],
3449
"fix-cs": [
3550
"php-cs-fixer fix"
51+
],
52+
"phpunit": [
53+
"phpunit"
3654
]
3755
}
3856
}

0 commit comments

Comments
 (0)
Please sign in to comment.