Skip to content

Commit

Permalink
Angular2 webdriver test updates (vitessio#2038)
Browse files Browse the repository at this point in the history
Angular2 webdriver test updates
  • Loading branch information
thompsonja authored Sep 14, 2016
1 parent d550824 commit 30b6d1a
Show file tree
Hide file tree
Showing 23 changed files with 649 additions and 290 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ MAKEFLAGS = -s

.PHONY: all build build_web test clean unit_test unit_test_cover unit_test_race integration_test proto proto_banner site_test site_integration_test docker_bootstrap docker_test docker_unit_test java_test php_test reshard_tests

all: build build_web test
all: build test

# Set a custom value for -p, the number of packages to be built/tested in parallel.
# This is currently only used by our Travis CI test configuration.
Expand Down
9 changes: 7 additions & 2 deletions py/vttest/local_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def __init__(self,
init_data_options,
web_dir=None,
default_schema_dir=None,
extra_my_cnf=None):
extra_my_cnf=None,
web_dir2=None):
"""Initializes an object of this class.
Args:
Expand All @@ -38,6 +39,8 @@ def __init__(self,
default_schema_dir: a directory to use if no keyspace is found in the
schema_dir directory.
extra_my_cnf: additional cnf file to use for the EXTRA_MY_CNF var.
web_dir2: see the documentation for the corresponding command line
flag in run_local_database.py
"""

self.topology = topology
Expand All @@ -47,6 +50,7 @@ def __init__(self,
self.web_dir = web_dir
self.default_schema_dir = default_schema_dir
self.extra_my_cnf = extra_my_cnf
self.web_dir2 = web_dir2

def setup(self):
"""Create a MySQL instance and all Vitess processes."""
Expand All @@ -66,7 +70,8 @@ def setup(self):

vt_processes.start_vt_processes(self.directory, self.topology,
self.mysql_db, self.schema_dir,
web_dir=self.web_dir)
web_dir=self.web_dir,
web_dir2=self.web_dir2)

def teardown(self):
"""Kill all Vitess processes and wait for them to end.
Expand Down
4 changes: 4 additions & 0 deletions py/vttest/run_local_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def main(cmdline_options):
cmdline_options.mysql_only,
init_data_opts,
web_dir=cmdline_options.web_dir,
web_dir2=cmdline_options.web_dir2,
default_schema_dir=cmdline_options.default_schema_dir,
extra_my_cnf=os.path.join(
os.environ['VTTOP'], 'config/mycnf/vtcombo.cnf')) as local_db:
Expand Down Expand Up @@ -161,6 +162,9 @@ def main(cmdline_options):
parser.add_option(
'-w', '--web_dir',
help='location of the vtctld web server files.')
parser.add_option(
'--web_dir2',
help='location of the vtctld2 web server files.')
parser.add_option(
'-v', '--verbose', action='store_true',
help='Display extra error messages.')
Expand Down
9 changes: 6 additions & 3 deletions py/vttest/vt_processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class VtcomboProcess(VtProcess):
]

def __init__(self, directory, topology, mysql_db, schema_dir, charset,
web_dir=None):
web_dir=None, web_dir2=None):
VtProcess.__init__(self, 'vtcombo-%s' % os.environ['USER'], directory,
environment.vtcombo_binary, port_name='vtcombo')
self.extraparams = [
Expand All @@ -143,6 +143,8 @@ def __init__(self, directory, topology, mysql_db, schema_dir, charset,
self.extraparams.extend(['-schema_dir', schema_dir])
if web_dir:
self.extraparams.extend(['-web_dir', web_dir])
if web_dir2:
self.extraparams.extend(['-web_dir2', web_dir2])
if mysql_db.unix_socket():
self.extraparams.extend(
['-db-config-app-unixsocket', mysql_db.unix_socket(),
Expand All @@ -159,7 +161,7 @@ def __init__(self, directory, topology, mysql_db, schema_dir, charset,


def start_vt_processes(directory, topology, mysql_db, schema_dir,
charset='utf8', web_dir=None):
charset='utf8', web_dir=None, web_dir2=None):
"""Start the vt processes.
Args:
Expand All @@ -169,13 +171,14 @@ def start_vt_processes(directory, topology, mysql_db, schema_dir,
schema_dir: the directory that contains the schema / vschema.
charset: the character set for the database connections.
web_dir: contains the web app for vtctld side of vtcombo.
web_dir2: contains the web app for vtctld side of vtcombo.
"""
global vtcombo_process

logging.info('start_vt_processes(directory=%s,vtcombo_binary=%s)',
directory, environment.vtcombo_binary)
vtcombo_process = VtcomboProcess(directory, topology, mysql_db, schema_dir,
charset, web_dir=web_dir)
charset, web_dir=web_dir, web_dir2=web_dir2)
vtcombo_process.wait_start()


Expand Down
17 changes: 3 additions & 14 deletions test/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
"Args": [],
"Command": [],
"Manual": false,
"Shard": 4,
"Shard": 0,
"RetryMax": 0,
"Tags": [
"webdriver"
Expand All @@ -360,19 +360,8 @@
"File": "vtctld2_web_test.py",
"Args": [],
"Command": [],
"Manual": true,
"Shard": 4,
"RetryMax": 0,
"Tags": [
"webdriver"
]
},
"vtctld2_web_status": {
"File": "vtctld2_web_status_test.py",
"Args": [],
"Command": [],
"Manual": true,
"Shard": 4,
"Manual": false,
"Shard": 0,
"RetryMax": 0,
"Tags": [
"webdriver"
Expand Down
238 changes: 0 additions & 238 deletions test/vtctld2_web_status_test.py

This file was deleted.

Loading

0 comments on commit 30b6d1a

Please sign in to comment.