Skip to content

Commit

Permalink
PoC: Tested with real symfony app
Browse files Browse the repository at this point in the history
  • Loading branch information
akondas committed Jan 20, 2021
1 parent 7ebd00d commit 7624c9d
Show file tree
Hide file tree
Showing 9 changed files with 2,966 additions and 2,634 deletions.
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
* text=auto

/tests export-ignore
/.codecov.yml export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php_cs.dist export-ignore
/buddy.yml export-ignore
/phpunit.xml.dist export-ignore
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
.phpunit.cache
/coverage
/clover.xml
/var
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# ChaosMonkeySymfonyBundle

Chaos Monkey for Symfony applications
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.4-8892BF.svg)](https://php.net/)

Chaos Monkey for Symfony applications. Try to attack your running Symfony App.

## Assaults

Expand All @@ -15,6 +17,22 @@ Chaos Monkey for Symfony applications
- Repository (not implemented)
- Service (not implemented)

## How to use

1. Install with composer:
```bash
composer require chaos-php/chaos-monkey-symfony-bundle
```
2. Add Symfony bundle (e.g. `config/bundles.php`):
```php
return [
//... other bundles
Chaos\Monkey\Symfony\ChaosMonkeyBundle::class => ['all' => true],
];
```
3. Add `chaos_monkey.yaml` configuration (copy from below) and enable assaults
4. Watch your app plunge into chaos 🙈🙊🙉 😈

## Configuration reference

```yml
Expand All @@ -31,13 +49,21 @@ chaos_monkey:
fill_fraction: 0.95 # percentage of memory filling
exception:
active: false
class: "\RuntimeException"
class: 'RuntimeException'
kill_app:
active: false
watchers: # currently watchers can be enabled/disabled only in container compile time
request: true
```

## Roadmap
- [ ] Query param activator
- [ ] Flex recipe
- [ ] Metrics (for example `chaos_monkey_request_count_assaulted`)
- [ ] Assault profiles - each profile can contain different assaults
- [ ] CustomWatcher (based on container tag)
- [ ] CustomAssault (not implemented)

## License

ChaosMonkeySymfonyBundle is released under the MIT Licence. See the bundled LICENSE file for details.
Expand Down
22 changes: 20 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
"name": "chaos-php/chaos-monkey-symfony-bundle",
"type": "library",
"description": "Chaos Monkey for Symfony applications",
"keywords": [
"php",
"symfony",
"chaos-monkey",
"chaos-engineering",
"chaos-tests",
"quality-assurance"
],
"license": "MIT",
"authors": [
{
Expand All @@ -10,12 +18,15 @@
}
],
"require": {
"symfony/framework-bundle": "^5.2",
"php": "^7.4 || ^8.0",
"akondas/php-runtime": "^0.1.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16",
"phpunit/phpunit": "^9.5",
"friendsofphp/php-cs-fixer": "^2.16"
"symfony/browser-kit": "^5.2",
"symfony/framework-bundle": "^5.2",
"symfony/stopwatch": "^5.2"
},
"autoload": {
"psr-4": {
Expand All @@ -28,11 +39,18 @@
}
},
"scripts": {
"build": [
"@check-cs",
"@phpunit"
],
"check-cs": [
"php-cs-fixer fix --dry-run --diff"
],
"fix-cs": [
"php-cs-fixer fix"
],
"phpunit": [
"phpunit"
]
}
}
Loading

0 comments on commit 7624c9d

Please sign in to comment.