Kea2-python 0.1.0__py3-none-any.whl → 0.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of Kea2-python might be problematic. Click here for more details.

kea2/assets/monkeyq.jar CHANGED
Binary file
kea2/fastbotManager.py CHANGED
@@ -23,13 +23,14 @@ class FastbotManager:
23
23
  self.thread = None
24
24
 
25
25
 
26
- def _activateFastbot(self, options: "Options") -> threading.Thread:
26
+ def _activateFastbot(self) -> threading.Thread:
27
27
  """
28
28
  activate fastbot.
29
29
  :params: options: the running setting for fastbot
30
30
  :params: port: the listening port for script driver
31
31
  :return: the fastbot daemon thread
32
32
  """
33
+ options = self.options
33
34
  cur_dir = Path(__file__).parent
34
35
  push_file(
35
36
  Path.joinpath(cur_dir, "assets/monkeyq.jar"),
@@ -67,7 +68,7 @@ class FastbotManager:
67
68
  device=options.serial
68
69
  )
69
70
 
70
- t = self._startFastbotService(options)
71
+ t = self._startFastbotService()
71
72
  logger.info("Running Fastbot...")
72
73
 
73
74
  return t
@@ -134,7 +135,7 @@ class FastbotManager:
134
135
  return self.return_code
135
136
 
136
137
  def start(self):
137
- self.thread = self._startFastbotService()
138
+ self.thread = self._activateFastbot()
138
139
 
139
140
  def join(self):
140
141
  if self.thread:
kea2/keaUtils.py CHANGED
@@ -255,8 +255,8 @@ class KeaTestRunner(TextTestRunner):
255
255
  global LOGFILE, RESFILE
256
256
  LOGFILE = output_dir / Path(LOGFILE)
257
257
  RESFILE = output_dir / Path(RESFILE)
258
- logger.debug(f"Log file: {LOGFILE}")
259
- logger.debug(f"Result file: {RESFILE}")
258
+ logger.info(f"Log file: {LOGFILE}")
259
+ logger.info(f"Result file: {RESFILE}")
260
260
 
261
261
  def run(self, test):
262
262
 
@@ -293,9 +293,10 @@ class KeaTestRunner(TextTestRunner):
293
293
  message=r"Please use assert\w+ instead.",
294
294
  )
295
295
 
296
- log_watcher = LogWatcher(LOGFILE)
297
296
  fb = FastbotManager(self.options, LOGFILE)
298
297
  fb.start()
298
+
299
+ log_watcher = LogWatcher(LOGFILE)
299
300
 
300
301
  if self.options.agent == "u2":
301
302
  # initialize the result.json file
kea2/logWatcher.py CHANGED
@@ -2,6 +2,10 @@ import re
2
2
  import os
3
3
  import threading
4
4
  import time
5
+ from .utils import getLogger
6
+
7
+
8
+ logger = getLogger(__name__)
5
9
 
6
10
 
7
11
  PATTERN_EXCEPTION = re.compile(r"\[Fastbot\].+Internal\serror\n([\s\S]*)")
@@ -16,7 +20,7 @@ def thread_excepthook(args):
16
20
 
17
21
  class LogWatcher:
18
22
 
19
- def watcher(self, poll_interval=1):
23
+ def watcher(self, poll_interval=0.5):
20
24
  self.buffer = ""
21
25
  self.last_pos = 0
22
26
 
@@ -28,7 +32,6 @@ class LogWatcher:
28
32
  self.read_log()
29
33
 
30
34
  def read_log(self):
31
- time.sleep(0.02)
32
35
  with open(self.log_file, 'r', encoding='utf-8') as f:
33
36
  f.seek(self.last_pos)
34
37
  new_data = f.read()
@@ -60,15 +63,19 @@ class LogWatcher:
60
63
  , flush=True)
61
64
 
62
65
  def __init__(self, log_file):
66
+ logger.info(f"Watching log: {log_file}")
63
67
  self.log_file = log_file
64
68
  self.end_flag = False
65
69
 
66
70
  threading.excepthook = thread_excepthook
67
- t = threading.Thread(target=self.watcher, daemon=True)
68
- t.start()
71
+ self.t = threading.Thread(target=self.watcher, daemon=True)
72
+ self.t.start()
69
73
 
70
74
  def close(self):
75
+ logger.info("Close: LogWatcher")
71
76
  self.end_flag = True
77
+ if self.t:
78
+ self.t.join()
72
79
 
73
80
 
74
81
  if __name__ == "__main__":
kea2/utils.py CHANGED
@@ -47,14 +47,10 @@ d = Device
47
47
 
48
48
 
49
49
  def getProjectRoot():
50
- root = Path("/")
50
+ root = Path(Path.cwd().anchor)
51
51
  cur_dir = Path.absolute(Path(os.curdir))
52
52
  while not os.path.isdir(cur_dir / "configs"):
53
53
  if cur_dir == root:
54
54
  return None
55
55
  cur_dir = cur_dir.parent
56
56
  return cur_dir
57
-
58
-
59
-
60
-
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Kea2-python
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: A python library for supporting and customizing automated UI testing for mobile apps
5
5
  Author-email: Xixian Liang <xixian@stu.ecnu.edu.cn>
6
6
  Requires-Python: >=3.8
@@ -3,16 +3,16 @@ kea2/absDriver.py,sha256=X99d-OP77EIiDwTLvWVkgDUtqscoxmWeOb-EcaOPWGI,1294
3
3
  kea2/adbUtils.py,sha256=j6goAAzV1Ikmv26DZEE0Oi8S1PrejcV1Io3u_Xw4ws4,9910
4
4
  kea2/bug_report_generator.py,sha256=FFop6asItUvRmg23i85-cDutKwJGL6-WmVSNk-BQ2oQ,22712
5
5
  kea2/cli.py,sha256=YgWOe5JB0_WBTKyBShBEymhLIqj6K5gNR4Aaj6Pbtn0,2796
6
- kea2/fastbotManager.py,sha256=RQYs6kcDir-UmVoGecVYmygLjV4aa5hUCQ8FHp_zE_k,4524
7
- kea2/keaUtils.py,sha256=eaYFk7r-WEU9cxP6I6qd8JxSLEvsvmo8-aCOuMoKWkU,24534
6
+ kea2/fastbotManager.py,sha256=6U-mWZHqwMXXNbHGNLNjjsolqDaqZUMpRhCBKjepcTQ,4524
7
+ kea2/keaUtils.py,sha256=fXE0vpFik2YN5Ze_wQ-XY8IjaoA3P2C0PFXLfAFvZIU,24533
8
8
  kea2/kea_launcher.py,sha256=Kj49TBJ8aRRJQI24y3vwbBMyTenJpL1HAqgv4ETRT9E,4986
9
- kea2/logWatcher.py,sha256=RQp9b6yF24Vh6_dUgx-nrSjiz-mP4uXjyVz7_HfYQ28,2029
9
+ kea2/logWatcher.py,sha256=qpIsflbP37eX5b4EaWnrqyPbGP9lzQhRr3ainGFfZeI,2211
10
10
  kea2/resultSyncer.py,sha256=f3qfne8WQCo1AA3cwx9IZzLdenjjMWbEpAqPdvddAqk,1984
11
11
  kea2/u2Driver.py,sha256=1uViwhQAkBFu69XFR5i8dSgG8SL3v7wZ68-t0E0Xlpw,14876
12
- kea2/utils.py,sha256=bLS8SokdLffOnRrncDn6JBNrnYzAQ-pIOsE4uLirwbA,1374
12
+ kea2/utils.py,sha256=8b4y-_B7knKRN_HqpWZM900IdRiZXwmzQnduVVN0GxQ,1384
13
13
  kea2/assets/fastbot-thirdpart.jar,sha256=0SZ_OoZFWDGMnazgXKceHgKvXdUDoIa3Gb2bcifaikk,85664
14
14
  kea2/assets/framework.jar,sha256=rTluOJJKj2DFwh7ascXso1udYdWv00BxBwSQ3Vmv-fw,1149240
15
- kea2/assets/monkeyq.jar,sha256=AGdeTNMoT97R4XzC3rCwXHDUqVm6de-_tjIdlnlpNgQ,463106
15
+ kea2/assets/monkeyq.jar,sha256=gE_0JmE7S3Mw5s0KNDMxc3eVKZP669aOFa7r3c3pzKM,463069
16
16
  kea2/assets/quicktest.py,sha256=j-fIryvspXObaNm3kWzgM0LMFes4h7EXT5C9xUWGUVo,2887
17
17
  kea2/assets/fastbot_configs/abl.strings,sha256=Rn8_YEbVGOJqndIY_-kWnR5NaoFI-cuB-ij10Ddhl90,75
18
18
  kea2/assets/fastbot_configs/awl.strings,sha256=-j4980GoWQxGOM9ijAwXPQmziCwFBZJFmuiv2tOEaYI,101
@@ -27,9 +27,9 @@ kea2/assets/fastbot_libs/armeabi-v7a/libfastbot_native.so,sha256=UV8bhaiPoPKdd3q
27
27
  kea2/assets/fastbot_libs/x86/libfastbot_native.so,sha256=k-aw1gEXRWMKZRNHIggKNuZy0wC1y2BnveJGEIO6rbo,2036856
28
28
  kea2/assets/fastbot_libs/x86_64/libfastbot_native.so,sha256=tiofhlf4uMQcU5WAvrdLgTBME0lb83hVUoGtTwxmE8A,2121416
29
29
  kea2/templates/bug_report_template.html,sha256=sQ0Uu8SPeOIiyX5vPPTZPVKxh9-9raAZcCjSRS8YFe0,40624
30
- kea2_python-0.1.0.dist-info/licenses/LICENSE,sha256=nM9PPjcsXVo5SzNsjRqWgA-gdJlwqZZcRDSC6Qf6bVE,2034
31
- kea2_python-0.1.0.dist-info/METADATA,sha256=io8HvvN6aGxT5r-hqf5CmVvfEf1Utdd65UCeJ7_QItc,13232
32
- kea2_python-0.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
33
- kea2_python-0.1.0.dist-info/entry_points.txt,sha256=mFX06TyxXiUAJQ6JZn8QHzfn8n5R8_KJ5W-pTm_fRCA,39
34
- kea2_python-0.1.0.dist-info/top_level.txt,sha256=TsgNH4PQoNOVhegpO7AcjutMVWp6Z4KDL1pBH9FnMmk,5
35
- kea2_python-0.1.0.dist-info/RECORD,,
30
+ kea2_python-0.1.1.dist-info/licenses/LICENSE,sha256=nM9PPjcsXVo5SzNsjRqWgA-gdJlwqZZcRDSC6Qf6bVE,2034
31
+ kea2_python-0.1.1.dist-info/METADATA,sha256=XFsmboCjYk4AwwBBeijCvT7iPAr-shBsx-COPqst1o0,13232
32
+ kea2_python-0.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
33
+ kea2_python-0.1.1.dist-info/entry_points.txt,sha256=mFX06TyxXiUAJQ6JZn8QHzfn8n5R8_KJ5W-pTm_fRCA,39
34
+ kea2_python-0.1.1.dist-info/top_level.txt,sha256=TsgNH4PQoNOVhegpO7AcjutMVWp6Z4KDL1pBH9FnMmk,5
35
+ kea2_python-0.1.1.dist-info/RECORD,,