This repository was archived by the owner on Apr 23, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[run]
22source = src.cli_code
3- include =
4- */src/cli_code/tools/test_runner.py
5- */src/cli_code/models/gemini.py
63omit =
74 */.rules/*
85 */.venv/*
Original file line number Diff line number Diff line change @@ -87,19 +87,19 @@ jobs:
8787 run : |
8888 # Set CI variables
8989 export CI_TEST_TIMEOUT=120
90- export CI_EXIT_ON_TEST_FAILURE=0
90+ export CI_EXIT_ON_TEST_FAILURE=1
9191
9292 # Run directly without using bash to make error handling clearer
9393 bash -ex ./scripts/run_coverage_ci.sh || echo "Coverage generation had errors but we'll continue"
9494
95- # Generate dummy coverage if needed
96- if [ ! -f "coverage.xml" ]; then
97- echo "Creating placeholder coverage.xml file"
98- echo '<?xml version="1.0" ?><coverage version="7.3.2" timestamp="1713166921" lines-valid="100" lines-covered="85" line-rate="0.85" branches-valid="0" branches-covered="0" branch-rate="0" complexity="0"><sources><source>/Users/runner/work/cli-code/cli-code/src</source></sources><packages><package name="cli_code" line-rate="0.85" branch-rate="0" complexity="0"><classes><class name="__init__.py" filename="cli_code/__init__.py" complexity="0" line-rate="0.85" branch-rate="0"></class></classes></package></packages></coverage>' > coverage.xml
95+ # Extract actual coverage percentage from XML file
96+ if [ -f "coverage.xml" ]; then
97+ COVERAGE=$(python -c "import xml.etree.ElementTree as ET; tree = ET.parse('coverage.xml'); root = tree.getroot(); line_rate = float(root.attrib['line-rate'])*100; print('{:.2f}%'.format(line_rate))")
98+ echo "percentage=$COVERAGE" >> $GITHUB_OUTPUT
99+ else
100+ echo "Warning: No coverage.xml file was generated"
101+ echo "percentage=0.00%" >> $GITHUB_OUTPUT
99102 fi
100-
101- # Set a fixed coverage percentage for PR comment
102- echo "percentage=85.00%" >> $GITHUB_OUTPUT
103103
104104 - name : Comment PR with code coverage
105105 if : github.event_name == 'pull_request'
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ echo "Starting coverage generation for CI..."
1010mkdir -p coverage_html
1111
1212# Set environment variables for CI
13- export CI_EXIT_ON_TEST_FAILURE=0 # Don't exit on test failures in CI
13+ export CI_EXIT_ON_TEST_FAILURE=1 # Exit on test failures to ensure code quality
1414export CI_TEST_TIMEOUT=60 # Default timeout
1515
1616# Special handling for GitHub Actions environment
You can’t perform that action at this time.
0 commit comments