Skip to content

Commit c13b506

Browse files
committed
refactor test script to streamline processes_coverage mode and update CI configuration for coverage run
1 parent 6c33cd8 commit c13b506

File tree

2 files changed

+12
-31
lines changed

2 files changed

+12
-31
lines changed

.github/workflows/ubuntu.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,9 @@ jobs:
323323
PPC_NUM_PROC: 1
324324
PPC_ASAN_RUN: 1
325325
clang-build-codecov:
326-
needs:
327-
- gcc-test-extended
328-
- clang-test-extended
326+
# needs:
327+
# - gcc-test-extended
328+
# - clang-test-extended
329329
runs-on: ubuntu-24.04
330330
container:
331331
image: ghcr.io/learning-process/ppc-ubuntu:latest
@@ -356,6 +356,12 @@ jobs:
356356
run: >
357357
python3 scripts/run_tests.py --running-type processes_coverage
358358
--additional-mpi-args "--oversubscribe" --llvm-version 20
359+
env:
360+
LLVM_PROFILE_FILE: coverage-%p-%m.profraw
361+
PPC_NUM_THREADS: 2
362+
PPC_NUM_PROC: 2
363+
OMPI_ALLOW_RUN_AS_ROOT: 1
364+
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
359365
- name: Upload coverage reports to Codecov
360366
uses: codecov/[email protected]
361367
with:

scripts/run_tests.py

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,8 @@ def _execute(args_dict, env):
319319
elif args_dict["running_type"] == "processes":
320320
runner.run_processes(args_dict["additional_mpi_args"])
321321
elif args_dict["running_type"] == "processes_coverage":
322-
# Run processes tests
322+
# Run both threads and processes tests, then generate coverage
323+
runner.run_threads()
323324
runner.run_processes(args_dict["additional_mpi_args"])
324325
# Generate coverage report
325326
runner.generate_coverage(args_dict.get("llvm_version", "20"))
@@ -333,33 +334,7 @@ def _execute(args_dict, env):
333334
args_dict = init_cmd_args()
334335
counts = args_dict.get("counts")
335336

336-
if args_dict["running_type"] == "processes_coverage":
337-
# For coverage, set environment variables for profiling
338-
env_copy = os.environ.copy()
339-
env_copy["LLVM_PROFILE_FILE"] = "coverage-%p-%m.profraw"
340-
env_copy["PPC_NUM_PROC"] = "2"
341-
env_copy["PPC_NUM_THREADS"] = "2"
342-
env_copy["OMPI_ALLOW_RUN_AS_ROOT"] = "1"
343-
env_copy["OMPI_ALLOW_RUN_AS_ROOT_CONFIRM"] = "1"
344-
345-
# Run threads tests with different counts
346-
print("Running thread tests with coverage...")
347-
threads_args = args_dict.copy()
348-
threads_args["running_type"] = "threads"
349-
for count in [1, 2, 3, 4]:
350-
env_threads = env_copy.copy()
351-
env_threads["PPC_NUM_THREADS"] = str(count)
352-
env_threads["PPC_NUM_PROC"] = "1"
353-
print(f"Executing with threads count: {count}")
354-
try:
355-
_execute(threads_args, env_threads)
356-
except Exception as e:
357-
print(f"Warning: Thread tests with count {count} failed: {e}")
358-
359-
# Now run the process coverage tests
360-
print("\nRunning process tests with coverage...")
361-
_execute(args_dict, env_copy)
362-
elif counts:
337+
if counts:
363338
for count in counts:
364339
env_copy = os.environ.copy()
365340

0 commit comments

Comments
 (0)