From: Utkarsh Tiwari Date: Wed, 28 Feb 2024 06:10:14 +0000 (+0530) Subject: [TCT][Tool][Non-ACR] Support options added in tool X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F33%2F306833%2F2;p=test%2Ftct%2Fnative%2Fapi.git [TCT][Tool][Non-ACR] Support options added in tool Change-Id: I7b0f954492ef377997bd689e749140c6bed873d5 Signed-off-by: Utkarsh Tiwari --- diff --git a/tool/TC_Assistant_Tool/data_TCT.json b/tool/TC_Assistant_Tool/data_TCT.json index 8a596a966..f589a3cc8 100644 --- a/tool/TC_Assistant_Tool/data_TCT.json +++ b/tool/TC_Assistant_Tool/data_TCT.json @@ -139,6 +139,48 @@ "responses": [ "Do you want to add Pre and Post condition APIs for the above APIs?\n(Yes or No)\n\n[ To navigate, please type 'Back' ]" ] + }, + { + "tag": "supportsys", + "patterns": ["Support", "I want support for issue"], + "responses": [ + "Please select among below options :\n\na. Build issue\nb. Install issue\nc. Environment setup\nd. Rootstrap installation\ne. Some other issue\n\n[ To navigate, please type 'Back' ]" + ] + }, + { + "tag": "envsetupsupport", + "patterns": ["I need help for environment setup", "I want support for setup issue"], + "responses": [ + "Environment Setup \n\na. Download and Install TizenStudio (Tizen Studio 3.7) from : https://developer.tizen.org/development/tizen-studio/download\nb. Install JAVA 8/9 using ITVOC\nc. One TizenStudio is installed,Launch Package Manager\n- In Package Manager make below changes :\n- Package Repository : http://107.110.2.162/packages\n- Distribution : tizen_studio_5.5\n [As we update/install rootstrap using package-manager on Linux machine]\nd. Check 5.5 emulator is launching and working fine or not.\n\n[ To navigate, please type 'Back' ]" + ] + }, + { + "tag": "rootstrapsupport", + "patterns": ["I need help for installing rootstrap", "I want support for rootstrap installation issue"], + "responses": [ + "Rootstrap installation guide/steps:\n\na. Download sdk-build repo code:\ngit clone ssh://[user-id]@review.tizen.org:29418/sdk/tools/sdk-build -b tizen ~/sdk-build\ngit checkout tizen\nexport PATH=~/sdk-build:$PATH'\n\nb. Install 'add-ons' (Only in case on tizeniot. Do not refer this point (b) for mobile, wearable )\nadd-ons download path: http://10.113.245.23/download/tct/template/tizeniot/\ncommand: ~/sdk-build/pkg-cli install-file -P -l ~/tizen-studio --force\n\nc. Install tizeniot rootstrap:\npath: https://bart.sec.samsung.net/artifactory/download-tizen-generic/snapshots/TIZEN/Tizen/Tizen-Unified/\ncommand: ~/sdk-build/pkg-cli install-file -P -l ~/tizen-studio --force\n\n[ To navigate, please type 'Back' ]" + ] + }, + { + "tag": "buildsupport", + "patterns": ["I need help regarding build issue", "I want support for build related issue"], + "responses": [ + "Please enter build error lines in the textbox below to analyze themin the form of LOG: BUILD_FAIL_LOGS\n\n[ To navigate, please type 'Back' ]" + ] + }, + { + "tag": "buildlogdebug", + "patterns": ["Build Logs:"], + "responses": [ + "Build fail may be due to many reasons like implicit declaration, keystore password error etc\n\n[ To navigate, please type 'Back' ]" + ] + }, + { + "tag": "installsupport", + "patterns": ["I need help regarding install isuue"], + "responses": [ + "Install fail may be due to many reasons like python version, TPK not present in workspace etc. Kindly follow the below steps to solve the issue :-\n\n- Check if python version is greater than 3.0, if not upgrade the version\n\n- Check if TPK is created inside workspace folder, if not try build again\n\n[ To navigate, please type 'Back' ]" + ] } ] } diff --git a/tool/TC_Assistant_Tool/log_debugger.py b/tool/TC_Assistant_Tool/log_debugger.py new file mode 100644 index 000000000..843e224b3 --- /dev/null +++ b/tool/TC_Assistant_Tool/log_debugger.py @@ -0,0 +1,54 @@ +import re + +TEST_PROFILE_ERROR = """TEST PROFILE ERROR + +Kindly follow below mentioned steps to solve this error -: + +1) Remove all certificates from '/tizen-studio-data/keystore/author' + sri@a:~/tizen-studio-data/keystore/author$ ls + author.p12 test1.p12 test.p12 + sri@a:~/tizen-studio-data/keystore/author$ sudo rm -rf *.* + +2) Create Certificate: + sri@a:~/tizen-studio-data/keystore/author$ sudo tizen certificate -a test -p test1234 + +3) Add certificate in profile + sri@a:~/tizen-studio-data/keystore/author$ sudo tizen security-profiles add -n test -a ~/tizen-studio-data/keystore/author/author.p12 -p test1234 + +4) Now, run your tpkbuild command. It should work. + If above solution does not work then copy 'tizen-studio-data' folder from some working Linux machine. But this is not recommended.""" + +KEYSTRORE_PASSWORD_ERROR = """KEYSTORE PASSWORD ERROR + +Kindly follow below mentioned steps to solve this error -: + +run below command first before tpkbuild command: + "sudo env | grep -i DBUS_SESSION_BUS_ADDRESS | sed 's/^[A-Z_]*=\(.*\)/\1/' > ~/tizen-studio/tools/certificate-encryptor/.secret" + +If accessing linux machine using putty then follow below steps: + +1) Extract the address of the dbus-session-bus from the arguments of dbus-daemon: + ps -ef | grep "dbus-daemon --fork --session --address" + +2) Set DBUS_SESSION_BUS_ADDRESS=
+[ Above step 1 and 2 are given at: https://developer.tizen.org/ko/community/tip-tech/how-manage-certificates-and-package-applications-different-ubuntu-setups?langredirect=1 ] + +3) From above link, follow step 1 and 2 under "Manage certificates through remote login" + +4) Create a file named ".secret" and place it in ~/tizen-studio/tools/certificate-encryptor + +5) Copy the value of DBUS_SESSION_BUS_ADDRESS in the .secret file and save.""" + +def build_log_debug(BUILD_LOG_TEXT): + if 'invalid type argument' in BUILD_LOG_TEXT: + fail_reason_capture = 'INVALID ARGUMENT ERROR' + + elif "java.io.IOException: Not found a specified profile: test" in BUILD_LOG_TEXT: + fail_reason_capture = TEST_PROFILE_ERROR + + elif "java.io.IOException: keystore password was incorrect" in BUILD_LOG_TEXT: + fail_reason_capture = KEYSTRORE_PASSWORD_ERROR + + else: + fail_reason_capture = "OOPS !! We couldn't find relevant solution for your error. Kindly refer to the guide for solution :)" + return fail_reason_capture \ No newline at end of file diff --git a/tool/TC_Assistant_Tool/modelweight.pth b/tool/TC_Assistant_Tool/modelweight.pth index 23f4b5ea9..d9e59ec60 100755 Binary files a/tool/TC_Assistant_Tool/modelweight.pth and b/tool/TC_Assistant_Tool/modelweight.pth differ diff --git a/tool/TC_Assistant_Tool/newdata.csv b/tool/TC_Assistant_Tool/newdata.csv index b778526c1..1184916d7 100755 --- a/tool/TC_Assistant_Tool/newdata.csv +++ b/tool/TC_Assistant_Tool/newdata.csv @@ -121,3 +121,18 @@ 119,Pre:yaca,prepostinfo 120,PRE:yaca,prepostinfo 121,Module name:yaca,modulename +122,Support,supportsys +123,I want support for issue,supportsys +124,Environment Setup,envsetupsupport +125,Need help for environment setup,envsetupsupport +126,Installing rootstrap,rootstrapsupport +127,Need help for installing rootstrap,rootstrapsupport +128,Build Issue,buildsupport +129,I want support for build related issue,buildsupport +130,Logs:,buildlogdebug +131,log:,buildlogdebug +132,Install issue,installsupport +133,I want help regarding install issue,installsupport +134,Need support,supportsys +135,Support Assistant,supportsys +136,i need to add a new module,newmodule diff --git a/tool/TC_Assistant_Tool/tct_assistance.py b/tool/TC_Assistant_Tool/tct_assistance.py index 76f4e771d..1dd1b9e46 100644 --- a/tool/TC_Assistant_Tool/tct_assistance.py +++ b/tool/TC_Assistant_Tool/tct_assistance.py @@ -31,6 +31,7 @@ from enum_finder import * from CMakeFileUpdate import * from new_module_addition import * from header_file_location import * +from log_debugger import * import numpy as np import pandas as pd import re @@ -292,6 +293,8 @@ def get_response(message): intent="prepostinfo" else: intent = get_prediction(message) + # print("message ", message) + # print("intent ", intent) log_info_save(logger, "Intent", intent) except: log_create(logger, "Error occurred in get_prediction function") @@ -330,6 +333,29 @@ def get_response(message): return "exit" get_response(msg) + elif previous_intent == "supportsys" and (message == "back" or message == "Back"): + msg = "support" + previous_intent = "goback" + get_response(msg) + + elif message == 'a' or message == 'b' or message == 'c' or message == 'd' or message == 'e' or message == '' or message == "exit" or message == "EXIT" or message == "Exit": + # if previous_intent == "entry": + previous_intent = "supportsys" + if message == 'a': + msg = "Build Issue" + if message == 'b': + msg = "Install Issue" + if message == 'c': + msg = "Environment Setup" + if message == 'd': + msg = "Installing rootstrap" + if message == 'e': + msg = "greetings" + if message == 'exit' or message == 'EXIT' or message == 'Exit': + return "exit" + get_response(msg) + + elif message.lower() == 'yes' or message.lower() =='no': #in case when module name typed wrong and suggestion is provided if previous_intent == 'modulename': @@ -920,7 +946,7 @@ def get_response(message): else: result = "Build parameters values are not correct" + "\n" + "Please try again.." - if intent == "launchtctmgr": + elif intent == "launchtctmgr": # print("inside launchtctmgr intent") bar("Installing...") execute_params = get_build_parameters(execute_tc_params_text) @@ -933,6 +959,15 @@ def get_response(message): print(output_execute) + elif intent == "buildlogdebug": + build_log = message + print("BUILD LOG ", build_log) + print("^^^^^^^^^^^^^^^^^^^^^^^^") + print(build_log_debug(build_log)) + build_fail_reason = build_log_debug(build_log) + result = build_fail_reason + "\n\n [ To navigate, please type 'Back' ]" + + elif intent == "goback": # print("checking new module value from goback", new_module) # print("Going back\n") @@ -950,6 +985,13 @@ def get_response(message): ind = ind + 1 result = result + "\n\n" + "If you wish to EXIT, Please type Exit" + except KeyboardInterrupt: + print('Interrupted') + exit.__str__() + try: + sys.exit(130) + except SystemExit: + os._exit(130) except: log_create(logger, "Error occurred in get_prediction function") return "Invalid Input. Please try writing again" @@ -973,6 +1015,10 @@ def copy_text(res): def _on_mousewheel(event): base.yview_scroll(int(-1*(event.delta/120)), "units") +def quit(event): + print("you pressed control c") + base.quit() + def center(win): """ centers a tkinter window @@ -1102,7 +1148,7 @@ def helpText(): def on_closing(): # get yes/no answers msg = CTkMessagebox(title="Exit?", message="Do you want to close the program?", - icon="question", option_1="No", option_2="Yes", option_3="") + icon="question", option_1="No", option_2="Yes", option_3="",option_focus=2) response = msg.get() if response=="Yes": @@ -1123,7 +1169,7 @@ center(base) ChatLog = Text(base, bd=0, relief=FLAT, bg='#d3d3d3', highlightthickness=0, font="Arial",wrap=WORD) ChatLog.pack(fill=BOTH, expand=True) -welcomeText = "Hey, Welcome to TC Assistance System. Tell me how would you like to proceed? \n > You can add a new UTC in existing module [Type: 'existing']\n > You can add UTC in new module [Type: 'new']\n" +welcomeText = "Hey, Welcome to TC Assistance System. Tell me how would you like to proceed? \n > You can add a new UTC in existing module\n > You can add UTC in new module\n > Support Assistant\n" log_info_save(logger, "Assitant", welcomeText) @@ -1162,4 +1208,5 @@ base.protocol("WM_DELETE_WINDOW", on_closing) base.bind_all("", _on_mousewheel) EntryBox.bind("", select_all) EntryBox.bind("", select_all) +base.bind('', quit) base.mainloop() diff --git a/tool/TC_Assistant_Tool/trainedmodel.py b/tool/TC_Assistant_Tool/trainedmodel.py index c2cddf8b0..838eeffc1 100755 --- a/tool/TC_Assistant_Tool/trainedmodel.py +++ b/tool/TC_Assistant_Tool/trainedmodel.py @@ -111,7 +111,7 @@ try: self.relu = nn.ReLU() self.fc1 = nn.Linear(768, 512) self.fc2 = nn.Linear(512, 256) - self.fc3 = nn.Linear(256, 15) + self.fc3 = nn.Linear(256, 21) self.softmax = nn.LogSoftmax(dim=1) def forward(self, sent_id, mask):