Skip to content

cpp-test.yml builds tests but never runs them (no ctest), so failing tests pass CI #7

Open

Description

@konard

Summary

cpp-test.yml (at 06a7067) configures and builds the tests (cmake --build .) but never runs them. A failing assertion therefore still produces a green "Test cpp" run. The callers make it worse: linksplatform/Interfaces, for example, triggers it with pull_request: types: [edited], so commits pushed to a PR do not start it at all. Only edits to the PR title or body do.

Evidence

Minimal reproduction

  1. In any repo that calls linksplatform/Workflows/.github/workflows/cpp-test.yml@main, add a failing gtest assertion.
  2. Push it to a PR. The workflow does not start, because only edited is subscribed.
  3. Edit the PR title. The workflow runs and passes.

Workaround

linksplatform/Interfaces#151 replaced the call with a local workflow. The local workflow runs cpp/build-and-test.sh, which does the following:

  • conan install
  • cmake --preset
  • cmake --build
  • ctest --output-on-failure --no-tests=error

It also uses the default pull_request activity types.

Suggested fix

  • Add ctest --test-dir <build> --output-on-failure --no-tests=error after the build. --no-tests=error turns "no tests registered" into a failure as well. Projects must call enable_testing() and gtest_discover_tests().
  • Remove types: [edited] from the callers' templates.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions