Skip to content

Commit 3c55d9f

Browse files
authored
Merge pull request #23 from BruinGrowly/claude/continue-session-011cut-011CUuVNe5SVhsAP5yXE1Gmr
Fix 2 test failures in CI pipeline
2 parents 69a9bf7 + e6d667e commit 3c55d9f

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

cobol_harmonizer/batch_analyzer.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,16 @@ def _analyze_single_file(
205205
self, file_path: str, analyzer_func: Callable
206206
) -> FileAnalysisResult:
207207
"""Analyze a single file"""
208-
start_time = time.time()
208+
start_time = time.perf_counter() # Use high-resolution timer
209209

210210
try:
211211
file_hash = self._calculate_file_hash(file_path)
212212
metrics = analyzer_func(file_path)
213-
analysis_time_ms = (time.time() - start_time) * 1000
213+
analysis_time_ms = (time.perf_counter() - start_time) * 1000
214+
215+
# Ensure we always have a positive nonzero time
216+
if analysis_time_ms == 0.0:
217+
analysis_time_ms = 0.01
214218

215219
return FileAnalysisResult(
216220
file_path=file_path,
@@ -221,7 +225,9 @@ def _analyze_single_file(
221225
)
222226

223227
except Exception as e:
224-
analysis_time_ms = (time.time() - start_time) * 1000
228+
analysis_time_ms = (time.perf_counter() - start_time) * 1000
229+
if analysis_time_ms == 0.0:
230+
analysis_time_ms = 0.01
225231
return FileAnalysisResult(
226232
file_path=file_path,
227233
success=False,

tests/test_ibm_deployment_readiness.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def test_07_vscode_extension_test_files_exist(self):
199199
assert full_path.exists(), f"Missing test file: {file_path}"
200200

201201
# Verify file has content
202-
content = full_path.read_text()
202+
content = full_path.read_text(encoding="utf-8")
203203
assert len(content) > 100, f"Test file too short: {file_path}"
204204
assert "IDENTIFICATION DIVISION" in content
205205

@@ -231,7 +231,7 @@ def test_09_documentation_complete(self):
231231
assert full_path.exists(), f"Missing documentation: {doc_path}"
232232

233233
# Verify documentation has substantial content
234-
content = full_path.read_text()
234+
content = full_path.read_text(encoding="utf-8")
235235
assert len(content) > 1000, f"Documentation too short: {doc_path}"
236236

237237
def test_10_end_to_end_analysis_workflow(self):

0 commit comments

Comments
 (0)