Skip to content

Commit 679fe42

Browse files
authored
Merge pull request #82 from Integrated-Testing-Environment/dev
Dev
2 parents b7d498b + b2c4611 commit 679fe42

20 files changed

+171
-39
lines changed

.circleci/config.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ jobs:
107107
- run:
108108
command: python ./test/unit_test/callback/callback_test.py
109109
name: callback_test
110-
110+
# create project
111+
- run:
112+
command: python ./test/unit_test/create_project_file/create_project_test.py
113+
name: create project
111114
# integrated_test
112115
# can't run this because circle ci bug
113116
#- run:
@@ -218,6 +221,10 @@ jobs:
218221
- run:
219222
command: python ./test/unit_test/callback/callback_test.py
220223
name: callback_test
224+
# create project
225+
- run:
226+
command: python ./test/unit_test/create_project_file/create_project_test.py
227+
name: create project
221228

222229
# integrated_test
223230
# can't run this because circle ci bug

.github/workflows/auto-control-github-actions_dev.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,7 @@ jobs:
7777
run: python ./test/unit_test/generate_report/html_report_test.py
7878
# call back test
7979
- name: call back test
80-
run: python ./test/unit_test/callback/callback_test.py
80+
run: python ./test/unit_test/callback/callback_test.py
81+
# create project
82+
- name: create project
83+
run: python ./test/unit_test/create_project_file/create_project_test.py

.github/workflows/auto-control-github-actions_stable.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,7 @@ jobs:
7777
run: python ./test/unit_test/generate_report/html_report_test.py
7878
# call back test
7979
- name: call back test
80-
run: python ./test/unit_test/callback/callback_test.py
80+
run: python ./test/unit_test/callback/callback_test.py
81+
# create project
82+
- name: create project
83+
run: python ./test/unit_test/create_project_file/create_project_test.py

dev.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
66

77
[project]
88
name = "je_auto_control_dev"
9-
version = "0.0.65"
9+
version = "0.0.66"
1010
authors = [
1111
{ name = "JE-Chen", email = "[email protected]" },
1212
]

je_auto_control/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
from je_auto_control.utils.executor.action_executor import execute_action
3333
from je_auto_control.utils.executor.action_executor import execute_files
3434
from je_auto_control.utils.executor.action_executor import executor
35-
from je_auto_control.utils.file_process.create_project_structure import \
36-
create_template_dir
35+
from je_auto_control.utils.project.create_project_structure import \
36+
create_project_dir
3737
# file process
3838
from je_auto_control.utils.file_process.get_dir_file_list import \
3939
get_dir_files_as_list
@@ -119,7 +119,7 @@
119119
"generate_html", "generate_html_report",
120120
"generate_json", "generate_json_report",
121121
"generate_xml", "generate_xml_report",
122-
"get_dir_files_as_list", "create_template_dir",
122+
"get_dir_files_as_list", "create_project_dir",
123123
"start_autocontrol_socket_server",
124124
"callback_executor", "package_manager",
125125
"get_special_table"

je_auto_control/utils/callback/callback_function_executor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# executor
77
from je_auto_control.utils.executor.action_executor import execute_action
88
from je_auto_control.utils.executor.action_executor import execute_files
9-
from je_auto_control.utils.file_process.create_project_structure import create_template_dir
9+
from je_auto_control.utils.project.create_project_structure import create_project_dir
1010
# file process
1111
from je_auto_control.utils.file_process.get_dir_file_list import get_dir_files_as_list
1212
# html report
@@ -101,7 +101,7 @@ def __init__(self):
101101
# execute
102102
"execute_action": execute_action,
103103
"execute_files": execute_files,
104-
"create_template_dir": create_template_dir,
104+
"create_template_dir": create_project_dir,
105105
"get_dir_files_as_list": get_dir_files_as_list,
106106
"pil_screenshot": pil_screenshot,
107107
"read_action_json": read_action_json,

je_auto_control/utils/executor/action_executor.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import sys
22
import time
33
import types
4+
import builtins
45
from inspect import getmembers, isbuiltin
56

67
from je_auto_control.utils.exception.exception_tags import action_is_null_error, add_command_exception_tag, \
@@ -80,9 +81,9 @@ def __init__(self):
8081
"add_package_to_executor": package_manager.add_package_to_executor,
8182
"add_package_to_callback_executor": package_manager.add_package_to_callback_executor
8283
}
83-
# get all time module builtin function and add to event dict
84-
for function in getmembers(time, isbuiltin):
85-
self.event_dict.update({str(function): function})
84+
# get all builtin function and add to event dict
85+
for function in getmembers(builtins, isbuiltin):
86+
self.event_dict.update({str(function[0]): function[1]})
8687

8788
def _execute_event(self, action: list):
8889
event = self.event_dict.get(action[0])

je_auto_control/utils/file_process/create_project_structure.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

je_auto_control/utils/generate_report/generate_html_report.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ def generate_html_report(html_name: str = "default_name"):
154154
:param html_name: save html file name
155155
"""
156156
new_html_string = generate_html()
157+
_lock.acquire()
157158
try:
158-
_lock.acquire()
159159
with open(html_name + ".html", "w+") as file_to_write:
160160
file_to_write.write(
161161
new_html_string

je_auto_control/utils/generate_report/generate_json_report.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@ def generate_json_report(json_file_name: str = "default_name"):
5555
"""
5656
lock = Lock()
5757
success_dict, failure_dict = generate_json()
58+
lock.acquire()
5859
try:
59-
lock.acquire()
6060
with open(json_file_name + "_success.json", "w+") as file_to_write:
6161
json.dump(dict(success_dict), file_to_write, indent=4)
6262
except Exception as error:
6363
print(repr(error), file=sys.stderr)
6464
finally:
6565
lock.release()
66+
lock.acquire()
6667
try:
67-
lock.acquire()
6868
with open(json_file_name + "_failure.json", "w+") as file_to_write:
6969
json.dump(dict(failure_dict), file_to_write, indent=4)
7070
except Exception as error:

0 commit comments

Comments
 (0)