Commit 6879666a authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

[blinkpy] Assert directories exists in ApacheHTTP

This might save some debug time if the out/Dir is configured in a
non-compatible way. This applies particularly for the defaults
out/Debug and out/Release when -t is not provided.

Change-Id: I0f01811c87050f0bbff67208cd0016d9e0e7190e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2087673
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: default avatarRobert Ma <robertma@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747140}
parent 35daddd7
......@@ -71,6 +71,15 @@ class ApacheHTTP(server_base.ServerBase):
self._is_win = self._port_obj.host.platform.is_win()
assert self._filesystem.exists(test_dir), \
"'%s' does not exist." % test_dir
assert self._filesystem.exists(output_dir), \
"'%s' does not exist." % output_dir
assert self._filesystem.exists(inspector_sources_dir), \
"'%s' does not exist." % inspector_sources_dir
assert self._filesystem.exists(generated_sources_dir), \
"'%s' does not exist." % generated_sources_dir
start_cmd = [
executable,
'-f', '%s' % self._port_obj.path_to_apache_config_file(),
......
......@@ -51,8 +51,12 @@ class TestApacheHTTP(unittest.TestCase):
host.executive = MockExecutive(should_log=True)
test_port = test.TestPort(host)
host.filesystem.write_text_file(test_port.path_to_apache_config_file(), '')
output_dir = '/mock/output_dir'
host.filesystem.maybe_make_directory(output_dir)
host.filesystem.maybe_make_directory('/mock-checkout/out/Release/resources/inspector')
host.filesystem.maybe_make_directory('/mock-checkout/out/Release/gen')
server = ApacheHTTP(test_port, '/mock/output_dir', additional_dirs=[], number_of_servers=4)
server = ApacheHTTP(test_port, output_dir, additional_dirs=[], number_of_servers=4)
server._check_that_all_ports_are_available = lambda: True
server._is_server_running_on_all_ports = lambda: True
server._wait_for_action = fake_pid
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment