Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1672)

Side by Side Diff: components/test/data/password_manager/automated_tests/run_tests.py

Issue 1134843005: [Password manager tests automation] Fix automated tests runner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # -*- coding: utf-8 -*- 1 # -*- coding: utf-8 -*-
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Encapsulates running tests defined in tests.py. 6 """Encapsulates running tests defined in tests.py.
7 7
8 Running this script requires passing --config-path with a path to a config file 8 Running this script requires passing --config-path with a path to a config file
9 of the following structure: 9 of the following structure:
10 10
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 try: 122 try:
123 with stopit.ThreadingTimeout(100) as timeout: 123 with stopit.ThreadingTimeout(100) as timeout:
124 logger.log(SCRIPT_DEBUG, 124 logger.log(SCRIPT_DEBUG,
125 "Run test with parameters: %s %s %s %s %s %s", 125 "Run test with parameters: %s %s %s %s %s %s",
126 config.chrome_path, config.chromedriver_path, 126 config.chrome_path, config.chromedriver_path,
127 profile_path, config.passwords_path, 127 profile_path, config.passwords_path,
128 website, test_case) 128 website, test_case)
129 result = tests.RunTest(config.chrome_path, config.chromedriver_path, 129 result = tests.RunTest(config.chrome_path, config.chromedriver_path,
130 profile_path, config.passwords_path, 130 profile_path, config.passwords_path,
131 website, test_case)[0] 131 website, test_case)[0]
132 if timeout != timeout.EXECUTED: 132 if timeout.state != timeout.EXECUTED:
133 result = (website, test_case, False, "Timeout") 133 result = (website, test_case, False,
134 "Got %d as timeout state (see stopit.ThreadingTimeout for"
135 "the meaning of the number)" % timeout.state)
134 _, _, success, _ = result 136 _, _, success, _ = result
135 if success: 137 if success:
136 return result 138 return result
137 except Exception as e: 139 except Exception as e:
138 result = (website, test_case, False, e) 140 result = (website, test_case, False, e)
139 return result 141 return result
140 142
141 143
142 def RunTests(config_path): 144 def RunTests(config_path):
143 """Runs automated tests. 145 """Runs automated tests.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 def main(): 177 def main():
176 parser = argparse.ArgumentParser() 178 parser = argparse.ArgumentParser()
177 parser.add_argument("config_path", metavar="N", 179 parser.add_argument("config_path", metavar="N",
178 help="Path to the config.ini file.") 180 help="Path to the config.ini file.")
179 args = parser.parse_args() 181 args = parser.parse_args()
180 RunTests(args.config_path) 182 RunTests(args.config_path)
181 183
182 184
183 if __name__ == "__main__": 185 if __name__ == "__main__":
184 main() 186 main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698