|
50 | 50 | python3 -c "import logging; print(f'Root logger level: {logging.getLogger().level}')" |
51 | 51 |
|
52 | 52 | - name: Reproduce actual CI TMT run and check verbosity levels |
53 | | - run: | |
54 | | - set -exuo pipefail |
55 | | -
|
56 | | - cd /var/tmp |
57 | | - mkdir -p tmt-repro |
58 | | - cd tmt-repro |
59 | | -
|
60 | | - # Create a minimal FMF tree |
61 | | - mkdir -p .fmf |
62 | | - cat > .fmf/version <<'FMFEOF' |
63 | | -1 |
64 | | -FMFEOF |
65 | | - |
66 | | - # Create minimal plan |
67 | | - mkdir -p tmt |
68 | | - cat > tmt/test.fmf <<'FMFEOF' |
69 | | -summary: Minimal test |
70 | | -test: echo "hello world" |
71 | | -FMFEOF |
72 | | - |
73 | | - echo "=== Test 1: Default tmt run (with set -x from this script) ===" |
74 | | - tmt run discover --how fmf 2>&1 | head -50 || true |
75 | | - |
76 | | - echo "" |
77 | | - echo "=== Test 2: Check if TMT detects it's in CI and enables debug ===" |
78 | | - python3 << 'EOF' |
79 | | -import sys, os |
80 | | -sys.path.insert(0, '/home/runner/.local/lib/python3.13/site-packages') |
81 | | - |
82 | | -# Import TMT and check if it has CI detection logic |
83 | | -import tmt.log |
84 | | -import tmt.cli |
85 | | -import inspect |
86 | | - |
87 | | -# Get the Logger class source |
88 | | -logger_cls_source = inspect.getsource(tmt.log.Logger) |
89 | | -print("Searching tmt.log.Logger for CI detection or auto-debug logic:") |
90 | | -for line_no, line in enumerate(logger_cls_source.split('\n'), 1): |
91 | | - if any(keyword in line.lower() for keyword in ['ci', 'github', 'actions', 'debug', 'level']): |
92 | | - print(f" Line {line_no}: {line.rstrip()}") |
93 | | - |
94 | | -print("\n\n=== Check TMT_DEBUG environment variable ===") |
95 | | -print(f"TMT_DEBUG={os.environ.get('TMT_DEBUG', '<not set>')}") |
96 | | - |
97 | | -print("\n=== Let's manually check what default log level TMT uses ===") |
98 | | -# Try to instantiate TMT's logger and see what level it uses |
99 | | -import logging |
100 | | - |
101 | | -# Before importing tmt.cli, check current logger levels |
102 | | -print(f"Root logger level: {logging.getLogger().level}") |
103 | | -print(f"Root logger effective level: {logging.getLogger().getEffectiveLevel()}") |
104 | | - |
105 | | -# Import and check tmt logger |
106 | | -tmt_logger = logging.getLogger('tmt') |
107 | | -print(f"TMT logger level: {tmt_logger.level}") |
108 | | -print(f"TMT logger effective level: {tmt_logger.getEffectiveLevel()}") |
109 | | -print(f"TMT logger handlers: {tmt_logger.handlers}") |
110 | | - |
111 | | -# Check if handlers have different levels |
112 | | -for handler in tmt_logger.handlers: |
113 | | - print(f" Handler {handler}: level={handler.level}") |
114 | | -EOF |
| 53 | + run: bash .github/scripts/debug-tmt.sh |
0 commit comments