Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit ecca8e2

Browse files
authored
Merge pull request #158 from ByteInternet/add-php56-to-hypernode-vagrant-runner
add php56 to hypernode-vagrant-runner
2 parents b109efc + 73f9242 commit ecca8e2

File tree

7 files changed

+38
-8
lines changed

7 files changed

+38
-8
lines changed

tools/hypernode-vagrant-runner/hypernode_vagrant_runner/commands.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,20 @@ def parse_start_runner_arguments():
7878
parser.add_argument(
7979
'--xenial',
8080
action='store_true',
81-
help='Start a Xenial Hypernode (PRE-ALPHA)'
81+
help='Start a Xenial Hypernode'
8282
)
8383
parser.add_argument(
8484
'--no-provision',
8585
action='store_true',
8686
help='Run "vagrant up" with the --no-provision flag'
8787
)
88-
return parse_arguments(parser)
88+
args = parse_arguments(parser)
89+
if not args.xenial and args.php == '5.6':
90+
parser.error(
91+
"Can't use the Precise Hypernode with PHP5.6. "
92+
"Add the --xenial flag to use the Xenial version"
93+
)
94+
return args
8995

9096

9197
def start_runner():

tools/hypernode-vagrant-runner/hypernode_vagrant_runner/runner/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def launch_runner(project_path=None, command_to_run=None,
9494
:param str ssh_user: The SSH user to use to run the hook as
9595
:param bool xdebug_enabled: Install xdebug in the vagrant
9696
:param bool skip_try_sudo: Skip try to sudo beforehand to fail early
97-
;param bool xenial: Start a Xenial image
97+
:param bool xenial: Start a Xenial image
9898
:param bool no_provision: Pass --no-provision to vagrant up
9999
:return None:
100100
"""

tools/hypernode-vagrant-runner/hypernode_vagrant_runner/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
]
66
HYPERNODE_VAGRANT_PHP_VERSIONS = [
77
'5.5',
8+
'5.6',
89
'7.0'
910
]
1011
HYPERNODE_VAGRANT_BOX_NAMES = {

tools/hypernode-vagrant-runner/hypernode_vagrant_runner/vagrant/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def hypernode_vagrant(directory=None,
4747
:param str php_version: The PHP version to use
4848
:param bool xdebug_enabled: Install xdebug in the vagrant
4949
:param bool skip_try_sudo: Skip try to sudo beforehand to fail early
50-
;param bool xenial: Start a Xenial image
50+
:param bool xenial: Start a Xenial image
5151
:param bool no_provision: Pass --no-provision to vagrant up
5252
:yield dict vagrant_ssh_config: Parsed vagrant ssh-config
5353
"""

tools/hypernode-vagrant-runner/hypernode_vagrant_runner/vagrant/set_up.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def write_hypernode_vagrant_configuration(
107107
:param str directory: The hypernode-vagrant checkout directory
108108
:param str php_version: The PHP version to use
109109
:param bool xdebug_enabled: Install xdebug in the vagrant
110-
;param bool xenial: Configure a Xenial image
110+
:param bool xenial: Start a Xenial image
111111
:return None:
112112
"""
113113
log.info("Writing configuration file to the hypernode-vagrant directory")
@@ -137,7 +137,7 @@ def start_hypernode_vagrant(directory,
137137
:param str directory: The directory in which to start the hypernode-vagrant
138138
:param str php_version: The PHP version to use
139139
:param bool xdebug_enabled: Install xdebug in the vagrant
140-
;param bool xenial: Start a Xenial image
140+
:param bool xenial: Start a Xenial image
141141
:param bool no_provision: Pass --no-provision to vagrant up
142142
:return None:
143143
"""
@@ -159,7 +159,7 @@ def create_hypernode_vagrant(directory=None,
159159
:param str php_version: The PHP version to use
160160
:param bool xdebug_enabled: Install xdebug in the vagrant
161161
:param bool skip_try_sudo: Skip try to sudo beforehand to fail early
162-
;param bool xenial: Start a Xenial image
162+
:param bool xenial: Start a Xenial image
163163
:param bool no_provision: Pass --no-provision to vagrant up
164164
:return str directory: Path to the hypernode-vagrant checkout
165165
None for a temp dir that will automatically be created

tools/hypernode-vagrant-runner/tests/unit/hypernode_vagrant_runner/commands/test_parse_start_runner_arguments.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,26 @@ def test_parse_start_runner_arguments_returns_parsed_arguments(self):
147147
ret = parse_start_runner_arguments()
148148

149149
self.assertEqual(ret, self.parse_arguments.return_value)
150+
151+
def test_parse_start_runner_arguments_errors_when_php56_and_precise(self):
152+
self.parse_arguments.return_value.php = '5.6'
153+
self.parse_arguments.return_value.xenial = False
154+
155+
parse_start_runner_arguments()
156+
157+
self.argument_parser.return_value.error.assert_called_once_with(ANY)
158+
159+
def test_parse_start_runner_arguments_does_not_error_when_php55_and_precise(self):
160+
self.parse_arguments.return_value.php = '5.5'
161+
self.parse_arguments.return_value.xenial = False
162+
163+
parse_start_runner_arguments()
164+
165+
self.assertFalse(self.argument_parser.return_value.error.called)
166+
167+
def test_parse_start_runner_arguments_does_not_error_if_php56_and_xenial(self):
168+
self.parse_arguments.return_value.php = '5.6'
169+
170+
parse_start_runner_arguments()
171+
172+
self.assertFalse(self.argument_parser.return_value.error.called)

tools/hypernode-vagrant-runner/tests/unit/hypernode_vagrant_runner/utils/test_run_local_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def test_run_local_command_does_not_write_to_stdout_in_case_of_nonzero_exit_in_p
8787
with self.assertRaises(CalledProcessError):
8888
run_local_command(['echo', '1'])
8989

90-
self.assertFalse(self.write_output_to_stdout.called)
90+
self.assertFalse(self.write_output_to_stdout.called)
9191

9292
def test_run_local_command_also_writes_stdout_to_stdout_in_case_of_nonzero_exit_in_python2(self):
9393
if not is_python_3():

0 commit comments

Comments
 (0)