Skip to content

Conversation

@Sbozzolo
Copy link
Member

@Sbozzolo Sbozzolo commented Oct 22, 2025

This commit introduces a few improvements to the test framework:

Support for ctest

Tests can now be run with:

ctest -j $(nproc)

This will automatically take care of running all the tests, including the MPI tests (with two process) and the GPU tests (if applicable).

Tests run in this way are not run in parallel.

Note, OpenMP threads are not accounted here, so the total number of cores used is $(nproc) * NUM_OMP_THREADS

New test tag NoConcurrent and new fixture TempDirFixture

Since tests can now be run in parallel, we need to tag tests that cannot be run concurrently (e.g., because they used shared resources).

A common use case of NoConcurrent is for file-system operations. However, this is a better way to deal with this problem: ensuring isolation and clean up of tests. To help with this, I added a new fixture, TempDirFixture, that automatically creates and destroy testing directories.

script to compute coverage

measure-test-coverage is a new script that uses the ctest capabilities and lcov to distill coverage information and produce html reports.

measure-test-coverage can be used to:

  1. produce the coverage.info objects by running the tests
  2. merge different coverage.info objects
  3. produce the html report from the coverage.info files

When run locally, measure-test-coverage report will probably cover most of the use cases. The need to handle different coverage.info objects might become relevant in the future for CI (if test coverage information is split across different workers)

Coverage is now computed as part of CI:

With all the previous advancements, we can now compute coverage as part of CI and produce a report. The report can be downloaded from the job page on GitHub actions and is uploaded to gh-pages:

https://awslabs.github.io/palace/previews/PR538/coverage/

I also added a clickable link to the summary of the GitHub job:
image

@Sbozzolo Sbozzolo added test Related to testing ci Related to continuous integration (CI) and/or GitHub Actions labels Oct 22, 2025
@Sbozzolo Sbozzolo force-pushed the gbozzola/test_coverage branch 4 times, most recently from a122959 to aea4162 Compare October 23, 2025 17:53
} // namespace

TEST_CASE("2D libCEED Operators", "[libCEED][Serial][Parallel][GPU]")
TEST_CASE("2D libCEED Operators", "[libCEED][Serial][Parallel]")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the GPU tag because of #516 (ultimately, it is likely that these tests were never meant to be run on GPU as-is)

@Sbozzolo Sbozzolo force-pushed the gbozzola/test_coverage branch 7 times, most recently from a631499 to faa368e Compare October 23, 2025 21:42
This commit introduces a few improvements to the test framework:

* Support for `ctest`

Tests can now be run with:
```
ctest -j $(nproc)
```
This will automatically take care of running all the tests, including
the MPI tests (with two process) and the GPU tests (if applicable).

Tests run in this way are not run in parallel.

Note, OpenMP threads are not accounted here, so the total number of
cores used is $(nproc) * NUM_OMP_THREADS

* New test tag `NoConcurrent` and new fixture `TempDirFixture`

Since tests can now be run in parallel, we need to tag tests that cannot
be run concurrently (e.g., because they used shared resources).

A common use case of `NoConcurrent` is for file-system operations.
However, this is a better way to deal with this problem: ensuring
isolation and clean up of tests. To help with this, I added a new
fixture, `TempDirFixture`, that automatically creates and destroy
testing directories.

* script to compute coverage

`measure-test-coverage` is a new script that uses the ctest capabilities
and lcov to distill coverage information and produce html reports.

`measure-test-coverage` can be used to:
1. produce the coverage.info objects by running the tests
2. merge different coverage.info objects
3. produce the html report from the coverage.info files

When run locally, `measure-test-coverage report` will probably cover
most of the use cases. The need to handle different coverage.info
objects might become relevant in the future for CI (if test coverage
information is split across different workers)

* Coverage is now computed as part of CI:

With all the previous advancements, we can now compute coverage as part
of CI and produce a report. The report can be downloaded from the job
page on GitHub actions.
@Sbozzolo Sbozzolo force-pushed the gbozzola/test_coverage branch from faa368e to 7675acc Compare October 23, 2025 22:28

permissions:
contents: read
contents: write
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we push to gh-pages

@Sbozzolo Sbozzolo marked this pull request as ready for review October 23, 2025 22:32
@Sbozzolo Sbozzolo requested a review from phdum-a October 23, 2025 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Related to continuous integration (CI) and/or GitHub Actions test Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant