Merge branch 'develop' into hotfix/fix-ui-build-problems

This commit is contained in:
Shay Nehmad 2020-05-11 08:57:22 +03:00
commit bb54d4f4b3
2 changed files with 18 additions and 6 deletions

View File

@ -18,6 +18,17 @@ install:
- pip install coverage # for code coverage
- pip install -r monkey/infection_monkey/requirements.txt # for unit tests
# node + npm + eslint
- node --version
- npm --version
# Install NVM, see https://github.com/nvm-sh/nvm#installing-and-updating
- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
- nvm install node
- nvm use node
- npm i -g eslint
- node --version
- npm --version
before_script:
# Set the server config to `testing`. This is required for for the UTs to pass.
- python monkey/monkey_island/cc/set_server_config.py testing
@ -49,12 +60,9 @@ script:
# Check JS code. The npm install must happen AFTER the flake8 because the node_modules folder will cause a lot of errors.
- cd monkey_island/cc/ui
- npm i
- npm i -g eslint
- cd -
- cd monkey_island/cc/ui
- eslint ./src --quiet
- eslint ./src --quiet # Test for errors
- JS_WARNINGS_AMOUNT_UPPER_LIMIT=490
- eslint ./src --max-warnings $JS_WARNINGS_AMOUNT_UPPER_LIMIT
- eslint ./src --max-warnings $JS_WARNINGS_AMOUNT_UPPER_LIMIT # Test for max warnings
after_success:
# Upload code coverage results to codecov.io, see https://github.com/codecov/codecov-bash for more information

View File

@ -80,8 +80,12 @@ class InfectionMonkey(object):
self._default_tunnel = self._opts.tunnel
self._default_server = self._opts.server
if self._opts.depth:
if self._opts.depth is not None:
WormConfiguration._depth_from_commandline = True
WormConfiguration.depth = self._opts.depth
LOG.debug(f"Setting propagation depth from command line")
LOG.debug(f"Set propagation depth to {WormConfiguration.depth}")
self._keep_running = True
self._network = NetworkScanner()
self._dropper_path = sys.argv[0]