robotframework-robotlog2db 1.4.1__tar.gz → 1.5.1__tar.gz

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.
Files changed (17) hide show
  1. {robotframework-robotlog2db-1.4.1 → robotframework-robotlog2db-1.5.1}/PKG-INFO +3 -1
  2. {robotframework-robotlog2db-1.4.1 → robotframework-robotlog2db-1.5.1}/README.rst +2 -0
  3. {robotframework-robotlog2db-1.4.1 → robotframework-robotlog2db-1.5.1}/RobotLog2DB/RobotLog2DB.pdf +0 -0
  4. {robotframework-robotlog2db-1.4.1 → robotframework-robotlog2db-1.5.1}/RobotLog2DB/robotlog2db.py +10 -6
  5. {robotframework-robotlog2db-1.4.1 → robotframework-robotlog2db-1.5.1}/RobotLog2DB/version.py +2 -2
  6. {robotframework-robotlog2db-1.4.1 → robotframework-robotlog2db-1.5.1}/robotframework_robotlog2db.egg-info/PKG-INFO +3 -1
  7. {robotframework-robotlog2db-1.4.1 → robotframework-robotlog2db-1.5.1}/robotframework_robotlog2db.egg-info/SOURCES.txt +0 -1
  8. {robotframework-robotlog2db-1.4.1 → robotframework-robotlog2db-1.5.1}/robotframework_robotlog2db.egg-info/requires.txt +1 -1
  9. robotframework-robotlog2db-1.4.1/RobotLog2DB/CDataBase.py +0 -1502
  10. {robotframework-robotlog2db-1.4.1 → robotframework-robotlog2db-1.5.1}/RobotLog2DB/__init__.py +0 -0
  11. {robotframework-robotlog2db-1.4.1 → robotframework-robotlog2db-1.5.1}/RobotLog2DB/__main__.py +0 -0
  12. {robotframework-robotlog2db-1.4.1 → robotframework-robotlog2db-1.5.1}/RobotLog2DB/xsd/robot.xsd +0 -0
  13. {robotframework-robotlog2db-1.4.1 → robotframework-robotlog2db-1.5.1}/robotframework_robotlog2db.egg-info/dependency_links.txt +0 -0
  14. {robotframework-robotlog2db-1.4.1 → robotframework-robotlog2db-1.5.1}/robotframework_robotlog2db.egg-info/entry_points.txt +0 -0
  15. {robotframework-robotlog2db-1.4.1 → robotframework-robotlog2db-1.5.1}/robotframework_robotlog2db.egg-info/top_level.txt +0 -0
  16. {robotframework-robotlog2db-1.4.1 → robotframework-robotlog2db-1.5.1}/setup.cfg +0 -0
  17. {robotframework-robotlog2db-1.4.1 → robotframework-robotlog2db-1.5.1}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: robotframework-robotlog2db
3
- Version: 1.4.1
3
+ Version: 1.5.1
4
4
  Summary: Imports robot result(s) to TestResultWebApp database
5
5
  Home-page: https://github.com/test-fullautomation/robotframework-robotlog2db
6
6
  Author: Tran Duy Ngoan
@@ -160,6 +160,8 @@ The usage should be showed as below:
160
160
  --variant VARIANT variant name to be set for this import.
161
161
  --versions VERSIONS metadata: Versions (Software;Hardware;Test) to be set for this import (semicolon separated).
162
162
  --config CONFIG configuration json file for component mapping information.
163
+ --interface {db,rest}
164
+ database access interface.
163
165
 
164
166
  The below command is simple usage with all required arguments to import
165
167
  Robot Framework results into TestResultWebApp\'s database:
@@ -133,6 +133,8 @@ The usage should be showed as below:
133
133
  --variant VARIANT variant name to be set for this import.
134
134
  --versions VERSIONS metadata: Versions (Software;Hardware;Test) to be set for this import (semicolon separated).
135
135
  --config CONFIG configuration json file for component mapping information.
136
+ --interface {db,rest}
137
+ database access interface.
136
138
 
137
139
 
138
140
  The below command is simple usage with all required arguments to import
@@ -52,13 +52,14 @@ import json
52
52
 
53
53
  from lxml import etree
54
54
  from robot.api import ExecutionResult
55
- from RobotLog2DB.CDataBase import CDataBase
55
+ from TestResultDBAccess import DBAccessFactory
56
56
  from RobotLog2DB.version import VERSION, VERSION_DATE
57
57
 
58
58
  DRESULT_MAPPING = {
59
59
  "PASS": "Passed",
60
60
  "FAIL": "Failed",
61
- "UNKNOWN": "Unknown"
61
+ "UNKNOWN": "Unknown",
62
+ "SKIP": "Unknown"
62
63
  }
63
64
 
64
65
  DEFAULT_METADATA = {
@@ -688,6 +689,7 @@ Avalable arguments in command line:
688
689
  help='metadata: Versions (Software;Hardware;Test) to be set for this import (semicolon separated).')
689
690
  cmdParser.add_argument('--config', type=str,
690
691
  help='configuration json file for component mapping information.')
692
+ cmdParser.add_argument('--interface', choices=['db', 'rest'], default='db', help='database access interface.')
691
693
 
692
694
  return cmdParser.parse_args()
693
695
 
@@ -1023,13 +1025,15 @@ Process test case data and create new test case record.
1023
1025
  try:
1024
1026
  _tbl_case_result_main = DRESULT_MAPPING[test.status]
1025
1027
  except Exception:
1026
- Logger.log_error(f"Invalid Robotframework result state '{test.status}' of test '{_tbl_case_name}'.")
1027
- return
1028
+ # Robotframework result's validation is done before
1029
+ # Set further status as unknown
1030
+ _tbl_case_result_main = DRESULT_MAPPING['UNKNOWN']
1031
+
1028
1032
  _tbl_case_result_state = "complete"
1029
1033
  _tbl_case_result_return = 11
1030
1034
  _tbl_case_counter_resets = 0
1031
1035
  try:
1032
- _tbl_case_lastlog = base64.b64encode(test.message.encode())
1036
+ _tbl_case_lastlog = str(base64.b64encode(test.message.encode()), encoding="utf-8")
1033
1037
  except:
1034
1038
  _tbl_case_lastlog = None
1035
1039
  _tbl_test_result_id = test_result_id
@@ -1229,7 +1233,7 @@ Flow to import Robot results to database:
1229
1233
  fatal_error=True)
1230
1234
 
1231
1235
  # 3. Connect to database
1232
- db=CDataBase()
1236
+ db = DBAccessFactory().create(args.interface)
1233
1237
  try:
1234
1238
  db.connect(args.server,
1235
1239
  args.user,
@@ -18,5 +18,5 @@
18
18
  #
19
19
  # Version and date of RobotLog2DB
20
20
  #
21
- VERSION = "1.4.1"
22
- VERSION_DATE = "15.03.2024"
21
+ VERSION = "1.5.1"
22
+ VERSION_DATE = "14.06.2024"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: robotframework-robotlog2db
3
- Version: 1.4.1
3
+ Version: 1.5.1
4
4
  Summary: Imports robot result(s) to TestResultWebApp database
5
5
  Home-page: https://github.com/test-fullautomation/robotframework-robotlog2db
6
6
  Author: Tran Duy Ngoan
@@ -160,6 +160,8 @@ The usage should be showed as below:
160
160
  --variant VARIANT variant name to be set for this import.
161
161
  --versions VERSIONS metadata: Versions (Software;Hardware;Test) to be set for this import (semicolon separated).
162
162
  --config CONFIG configuration json file for component mapping information.
163
+ --interface {db,rest}
164
+ database access interface.
163
165
 
164
166
  The below command is simple usage with all required arguments to import
165
167
  Robot Framework results into TestResultWebApp\'s database:
@@ -1,6 +1,5 @@
1
1
  README.rst
2
2
  setup.py
3
- RobotLog2DB/CDataBase.py
4
3
  RobotLog2DB/RobotLog2DB.pdf
5
4
  RobotLog2DB/__init__.py
6
5
  RobotLog2DB/__main__.py
@@ -1,4 +1,4 @@
1
1
  colorama
2
- mysqlclient
3
2
  robotframework
4
3
  lxml
4
+ TestResultDBAccess