소스 검색

ci: use .txt files instead of .log file for better preview

Fu Hanxi 3 년 전
부모
커밋
7bb4aea90e

+ 8 - 8
.gitlab/ci/host-test.yml

@@ -93,13 +93,13 @@ test_reproducible_build:
     when: always
     paths:
       - ${FUZZER_TEST_DIR}/out/crashes
-      - ${FUZZER_TEST_DIR}/fuzz_output.log
+      - ${FUZZER_TEST_DIR}/fuzz_output.txt
     expire_in: 1 week
   script:
     - export AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 && export AFL_SKIP_CPUFREQ=1
     - cd ${FUZZER_TEST_DIR}
     # run AFL fuzzer for one hour
-    - ( ( make ${FUZZER_PARAMS} fuzz | tee fuzz_output.log | grep -v '\(Fuzzing test case\|Entering queue cycle\)' ) || pkill sleep ) &
+    - ( ( make ${FUZZER_PARAMS} fuzz | tee fuzz_output.txt | grep -v '\(Fuzzing test case\|Entering queue cycle\)' ) || pkill sleep ) &
     - ( sleep 3600 || mkdir -p out/crashes/env_failed ) && pkill afl-fuz
     # check no crashes found
     - test -z "$(ls out/crashes/)" || exit 1
@@ -386,8 +386,8 @@ test_hello_world_linux_compatible_example:
     - cd ${IDF_PATH}/tools/test_apps/linux_compatible/hello_world_linux_compatible
     - idf.py --preview set-target linux
     - idf.py build
-    - timeout 15 build/hello_world.elf | tee test.log
-    - grep "Hello world!" test.log
+    - timeout 15 build/hello_world.elf | tee test.txt
+    - grep "Hello world!" test.txt
 
 test_esp_timer_cxx:
   extends: .host_test_template
@@ -443,16 +443,16 @@ test_partition_api_host:
   script:
     - cd ${IDF_PATH}/components/spi_flash/host_test/partition_api_test
     - idf.py build
-    - timeout 5 ./build/partition_api_test.elf | tee test.log
-    - grep " 0 Failures" test.log
+    - timeout 5 ./build/partition_api_test.elf | tee test.txt
+    - grep " 0 Failures" test.txt
 
 test_spiffs_host:
   extends: .host_test_template
   script:
     - cd ${IDF_PATH}/components/spiffs/host_test
     - idf.py build
-    - timeout 5 ./build/host_test_spiffs.elf | tee test.log
-    - grep " 0 Failures" test.log
+    - timeout 5 ./build/host_test_spiffs.elf | tee test.txt
+    - grep " 0 Failures" test.txt
 
 test_gen_soc_caps_kconfig:
   extends: .host_test_template

+ 1 - 0
pytest.ini

@@ -10,6 +10,7 @@ addopts =
   --tb short
   --strict-markers
   --skip-check-coredump y
+  --logfile-extension ".txt"
 
 # ignore DeprecationWarning
 filterwarnings =

+ 1 - 1
tools/ci/python_packages/tiny_test_fw/Env.py

@@ -107,7 +107,7 @@ class Env(object):
                     dut_config = dict()
                 dut_config.update(dut_init_args)
                 dut = dut_class(dut_name, port,
-                                os.path.join(self.log_path, dut_name + '.log'),
+                                os.path.join(self.log_path, dut_name + '.txt'),
                                 app_inst,
                                 **dut_config)
                 self.allocated_duts[dut_name] = {'port': port, 'dut': dut}

+ 1 - 1
tools/ci/python_packages/tiny_test_fw/Utility/__init__.py

@@ -30,7 +30,7 @@ _COLOR_CODES = {
 
 def _get_log_file_name():
     if Env.Env.CURRENT_LOG_FOLDER:
-        file_name = os.path.join(Env.Env.CURRENT_LOG_FOLDER, 'console.log')
+        file_name = os.path.join(Env.Env.CURRENT_LOG_FOLDER, 'console.txt')
     else:
         raise OSError('env log folder does not exist, will not save to log file')
     return file_name

+ 2 - 2
tools/test_apps/system/gdb/pytest_gdb.py

@@ -27,14 +27,14 @@ def test_idf_gdb(dut: Dut) -> None:
     # Don't need to have output from UART any more
     dut.serial.stop_redirect_thread()
 
-    with open(os.path.join(dut.logdir, 'ocd.log'), 'w') as ocd_log:
+    with open(os.path.join(dut.logdir, 'ocd.txt'), 'w') as ocd_log:
         ocd = subprocess.Popen(f'openocd {get_openocd_arguments(dut.target)}', stdout=ocd_log, stderr=ocd_log, shell=True)
 
         try:
             gdb_env = os.environ.copy()
             gdb_env['ESP_IDF_GDB_TESTING'] = '1'
 
-            with open(os.path.join(dut.logdir, 'gdb.log'), 'w') as gdb_log, \
+            with open(os.path.join(dut.logdir, 'gdb.txt'), 'w') as gdb_log, \
                  pexpect.spawn(f'idf.py -B {dut.app.binary_path} gdb --batch',
                                env=gdb_env,
                                timeout=60,

+ 3 - 3
tools/test_apps/system/gdb_loadable_elf/app_test.py

@@ -44,11 +44,11 @@ def test_app_loadable_elf(env, extra_data):
     idf_path = app.get_sdk_path()
     proj_path = os.path.join(idf_path, rel_project_path)
     elf_path = os.path.join(app.binary_path, 'gdb_loadable_elf.elf')
-    esp_log_path = os.path.join(proj_path, 'esp.log')
+    esp_log_path = os.path.join(proj_path, 'esp.txt')
 
     with SerialThread(esp_log_path):
-        openocd_log = os.path.join(proj_path, 'openocd.log')
-        gdb_log = os.path.join(proj_path, 'gdb.log')
+        openocd_log = os.path.join(proj_path, 'openocd.txt')
+        gdb_log = os.path.join(proj_path, 'gdb.txt')
         gdb_init = os.path.join(proj_path, 'gdbinit_' + target)
         gdb_dir = os.path.join(proj_path, 'main')
 

+ 1 - 1
tools/test_apps/system/monitor_ide_integration/pytest_monitor_ide_integration.py

@@ -77,7 +77,7 @@ def test_monitor_ide_integration(config: str, dut: Dut) -> None:
     monitor_cmd = ' '.join([sys.executable, monitor_py, os.path.join(dut.app.binary_path, 'panic.elf'),
                             '--port', str(dut.serial.port),
                             '--ws', f'ws://{WebSocketServer.HOST}:{WebSocketServer.PORT}'])
-    monitor_log_path = os.path.join(dut.logdir, 'monitor.log')
+    monitor_log_path = os.path.join(dut.logdir, 'monitor.txt')
 
     with open(monitor_log_path, 'w') as log, WebSocketServer(), pexpect.spawn(monitor_cmd,
                                                                               logfile=log,