Skip to content

ci: Test if bash -x (from run-tmt.sh) causes TMT verbosity #4

ci: Test if bash -x (from run-tmt.sh) causes TMT verbosity

ci: Test if bash -x (from run-tmt.sh) causes TMT verbosity #4

Workflow file for this run

name: Debug TMT
permissions:
actions: read
on:
push:
branches: [main]
workflow_dispatch: {}
env:
CARGO_TERM_COLOR: always
LIBVIRT_DEFAULT_URI: "qemu:///session"
jobs:
debug-tmt:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- name: Bootc Ubuntu Setup
uses: ./.github/actions/bootc-ubuntu-setup
with:
libvirt: true
- name: Install tmt
run: pip install --user "tmt[provision-virtual]"
- name: Check environment and RUNNER_DEBUG
run: |
echo "=== Python version ==="
python3 --version
pip --version
echo "=== TMT version ==="
tmt --version
echo "=== Critical: Check RUNNER_DEBUG and ENABLE_RUNNER_TRACING ==="
echo "RUNNER_DEBUG=${RUNNER_DEBUG:-<not set>}"
echo "ENABLE_RUNNER_TRACING=${ENABLE_RUNNER_TRACING:-<not set>}"
echo "ACTIONS_STEP_DEBUG=${ACTIONS_STEP_DEBUG:-<not set>}"
echo "TMT_DEBUG=${TMT_DEBUG:-<not set>}"
echo "=== All environment variables (full list) ==="
env | sort
echo "=== Python logging configuration ==="
python3 -c "import logging; print(f'Root logger level: {logging.getLogger().level}')"
- name: Test TMT with bash -x (mimicking run-tmt.sh)
run: |
echo "=== Test 1: Run tmt WITHOUT bash -x ==="
bash -c 'tmt --help 2>&1 | head -5'
echo ""
echo "=== Test 2: Run tmt WITH bash -x (like run-tmt.sh) ==="
bash -x -c 'tmt --help 2>&1 | head -5'
echo ""
echo "=== Test 3: Check if bash -x affects tmt verbosity in actual test run ==="
cd /tmp
mkdir -p tmt-test
cd tmt-test
mkdir -p .fmf
echo 'version: 1' > .fmf/version
echo "--- Running WITHOUT bash -x ---"
bash -c 'tmt run discover --how fmf 2>&1 | head -30'
echo ""
echo "--- Running WITH bash -x (like run-tmt.sh does) ---"
bash -x -c 'tmt run discover --how fmf 2>&1 | head -30'
echo ""
echo "=== Test 4: Check actual tmt log level in code ==="
python3 << 'EOF'
import sys
sys.path.insert(0, '/home/runner/.local/lib/python3.13/site-packages')
# Check if tmt has any code that checks for bash trace mode
import tmt.cli
import tmt.log
import inspect
# Look for environment variable checks
cli_source = inspect.getsource(tmt.cli)
log_source = inspect.getsource(tmt.log)
print("Checking for environment variable usage in tmt.cli:")
for line_no, line in enumerate(cli_source.split('\n'), 1):
if 'environ' in line.lower() or 'getenv' in line.lower():
print(f" Line {line_no}: {line.strip()}")
print("\nChecking for environment variable usage in tmt.log:")
for line_no, line in enumerate(log_source.split('\n'), 1):
if 'environ' in line.lower() or 'getenv' in line.lower():
print(f" Line {line_no}: {line.strip()}")
EOF