tiny-test-fw: move to tools/esp_python_packages:
make `tiny_test_fw` as a package and move to root path of idf python packages
This commit is contained in:
parent
f5e60524ac
commit
d621d0e88e
29 changed files with 37 additions and 43 deletions
|
@ -44,14 +44,13 @@ import re
|
|||
import json
|
||||
|
||||
import yaml
|
||||
|
||||
from Utility import (CaseConfig, SearchCases, GitlabCIJob, console_log)
|
||||
|
||||
try:
|
||||
from yaml import CLoader as Loader
|
||||
except ImportError:
|
||||
from yaml import Loader as Loader
|
||||
|
||||
from . import (CaseConfig, SearchCases, GitlabCIJob, console_log)
|
||||
|
||||
|
||||
class Group(object):
|
||||
|
|
@ -20,7 +20,7 @@ Template Config File::
|
|||
|
||||
TestConfig:
|
||||
app:
|
||||
path: Users/Test/TinyTestFW/IDF/IDFApp.py
|
||||
package: ttfw_idf
|
||||
class: Example
|
||||
dut:
|
||||
path:
|
||||
|
@ -38,22 +38,20 @@ Template Config File::
|
|||
extra_data: some extra data passed to case with kwarg extra_data
|
||||
overwrite: # overwrite test configs
|
||||
app:
|
||||
path: Users/Test/TinyTestFW/IDF/IDFApp.py
|
||||
package: ttfw_idf
|
||||
class: Example
|
||||
- name: xxx
|
||||
"""
|
||||
import importlib
|
||||
|
||||
import yaml
|
||||
|
||||
import TestCase
|
||||
|
||||
from Utility import load_source
|
||||
|
||||
try:
|
||||
from yaml import CLoader as Loader
|
||||
except ImportError:
|
||||
from yaml import Loader as Loader
|
||||
|
||||
from . import TestCase
|
||||
|
||||
|
||||
def _convert_to_lower_case_bytes(item):
|
||||
"""
|
||||
|
@ -172,8 +170,7 @@ class Parser(object):
|
|||
"""
|
||||
output = dict()
|
||||
for key in overwrite:
|
||||
path = overwrite[key]["path"]
|
||||
module = load_source(path)
|
||||
module = importlib.import_module(overwrite[key]["package"])
|
||||
output[key] = module.__getattribute__(overwrite[key]["class"])
|
||||
return output
|
||||
|
|
@ -17,7 +17,8 @@ import os
|
|||
import fnmatch
|
||||
import types
|
||||
import copy
|
||||
from Utility import load_source
|
||||
|
||||
from . import load_source
|
||||
|
||||
|
||||
class Search(object):
|
|
@ -26,8 +26,8 @@ import sys
|
|||
import argparse
|
||||
import threading
|
||||
|
||||
import TinyFW
|
||||
from Utility import SearchCases, CaseConfig
|
||||
from tiny_test_fw import TinyFW
|
||||
from tiny_test_fw.Utility import SearchCases, CaseConfig
|
||||
|
||||
|
||||
class Runner(threading.Thread):
|
0
tools/ci/python_packages/tiny_test_fw/docs/_static/.keep
vendored
Normal file
0
tools/ci/python_packages/tiny_test_fw/docs/_static/.keep
vendored
Normal file
|
@ -22,25 +22,29 @@ import sys
|
|||
import re
|
||||
import argparse
|
||||
|
||||
try:
|
||||
from Utility.CIAssignTest import AssignTest
|
||||
except ImportError:
|
||||
test_fw_path = os.getenv("TEST_FW_PATH")
|
||||
if test_fw_path:
|
||||
sys.path.insert(0, test_fw_path)
|
||||
from Utility.CIAssignTest import AssignTest
|
||||
|
||||
from Utility.CIAssignTest import Group
|
||||
import gitlab_api
|
||||
from tiny_test_fw.Utility import CIAssignTest
|
||||
|
||||
|
||||
class ExampleGroup(Group):
|
||||
class ExampleGroup(CIAssignTest.Group):
|
||||
SORT_KEYS = CI_JOB_MATCH_KEYS = ["env_tag", "chip"]
|
||||
|
||||
|
||||
class CIExampleAssignTest(AssignTest):
|
||||
class CIExampleAssignTest(CIAssignTest.AssignTest):
|
||||
CI_TEST_JOB_PATTERN = re.compile(r"^example_test_.+")
|
||||
|
||||
|
||||
class ArtifactFile(object):
|
||||
def __init__(self, project_id, job_name, artifact_file_path):
|
||||
self.gitlab_api = gitlab_api.Gitlab(project_id)
|
||||
|
||||
def process(self):
|
||||
pass
|
||||
|
||||
def output(self):
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("test_case",
|
|
@ -3,8 +3,6 @@ Command line tool to assign unit tests to CI test jobs.
|
|||
"""
|
||||
|
||||
import re
|
||||
import os
|
||||
import sys
|
||||
import argparse
|
||||
|
||||
import yaml
|
||||
|
@ -14,13 +12,7 @@ try:
|
|||
except ImportError:
|
||||
from yaml import Loader as Loader
|
||||
|
||||
try:
|
||||
from Utility import CIAssignTest
|
||||
except ImportError:
|
||||
test_fw_path = os.getenv("TEST_FW_PATH")
|
||||
if test_fw_path:
|
||||
sys.path.insert(0, test_fw_path)
|
||||
from Utility import CIAssignTest
|
||||
from tiny_test_fw.Utility import CIAssignTest
|
||||
|
||||
|
||||
class Group(CIAssignTest.Group):
|
||||
|
@ -119,7 +111,7 @@ class Group(CIAssignTest.Group):
|
|||
if target:
|
||||
overwrite = {
|
||||
"dut": {
|
||||
"path": "IDF/IDFDUT.py",
|
||||
"package": "ttfw_idf",
|
||||
"class": self.DUT_CLS_NAME[target],
|
||||
}
|
||||
}
|
|
@ -17,7 +17,7 @@ import subprocess
|
|||
|
||||
import os
|
||||
import json
|
||||
import App
|
||||
from tiny_test_fw import App
|
||||
|
||||
|
||||
class IDFApp(App.BaseApp):
|
|
@ -30,8 +30,7 @@ except ImportError:
|
|||
|
||||
from serial.tools import list_ports
|
||||
|
||||
import DUT
|
||||
import Utility
|
||||
from tiny_test_fw import DUT, Utility
|
||||
|
||||
try:
|
||||
import esptool
|
|
@ -14,10 +14,9 @@
|
|||
import os
|
||||
import re
|
||||
|
||||
import TinyFW
|
||||
import Utility
|
||||
from IDF.IDFApp import IDFApp, Example, UT
|
||||
from IDF.IDFDUT import IDFDUT
|
||||
from tiny_test_fw import TinyFW, Utility
|
||||
from IDFApp import IDFApp, Example, UT
|
||||
from IDFDUT import IDFDUT, ESP32DUT, ESP32S2DUT, ESP8266DUT
|
||||
|
||||
|
||||
def format_case_id(chip, case_name):
|
|
@ -51,3 +51,6 @@ else
|
|||
echo 'No /opt/pyenv/activate exists and no Python interpreter is found!'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# add esp-idf local package path to PYTHONPATH so it can be imported directly
|
||||
export PYTHONPATH="$IDF_PATH/tools:$IDF_PATH/tools/ci/python_packages:$PYTHONPATH"
|
||||
|
|
Loading…
Reference in a new issue