Skip to content

[TEST]: Run pyOpenMS tests on Ubuntu - #8111

Merged
pjones merged 1 commit into
developfrom
pjones/pyopenms-tests
Jul 18, 2025
Merged

pjones merged 1 commit into
developfrom
pjones/pyopenms-tests

Conversation

@pjones

@pjones pjones commented Jul 9, 2025 •

Copy link
Copy Markdown
Contributor

Description

Run pyOpenMS tests on Ubuntu before merging PRs.

Fixes #8104.

CI run with the changes:

https://github.com/OpenMS/OpenMS/actions/runs/16197103504

Note: Windows tests are failing but that's from another PR.

Summary by CodeRabbit

  • Chores
    • Updated continuous integration workflow to always build pyOpenMS on Linux runners and ensure Python build dependencies are installed.
    • Improved error accumulation in the build process to provide more comprehensive error reporting across all relevant build targets.
    • Simplified test execution to run all tests consistently, regardless of pyOpenMS build settings.

@coderabbitai

coderabbitai Bot commented Jul 9, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

The changes update the CI workflow to always build pyOpenMS on Linux runners, install necessary Python dependencies, and adjust build logic in the CMake script to accumulate error counts across all build targets. The test logic was simplified to always run all tests regardless of PYOPENMS. The workflow now ensures pyOpenMS is consistently built and tested, and build errors are properly aggregated.

Changes

File(s) Change Summary
.github/workflows/openms_ci_matrix_full.yml Modified to always enable pyOpenMS build on Linux, install Python dependencies, and adjust CWL logic.
tools/ci/cibuild.cmake Refactored build logic to always perform base build, accumulate errors from all targets, and handle pyOpenMS and CWL builds separately.
tools/ci/citest.cmake Removed conditional test filtering based on PYOPENMS; now runs all tests unconditionally.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant Runner (Ubuntu)
    participant CMake Build Script

    GitHub Actions->>Runner (Ubuntu): Start workflow
    Runner (Ubuntu)->>Runner (Ubuntu): Set PYOPENMS=ON (if OS is ubuntu-*)
    Runner (Ubuntu)->>Runner (Ubuntu): Install Python deps (if PYOPENMS=ON)
    Runner (Ubuntu)->>CMake Build Script: Run base build
    Runner (Ubuntu)->>CMake Build Script: Run pyOpenMS build (if PYOPENMS=ON)
    Runner (Ubuntu)->>CMake Build Script: Run CWL generation (if enabled)
    CMake Build Script->>Runner (Ubuntu): Aggregate all build errors
    Runner (Ubuntu)->>CMake Build Script: Run all tests (parallel=3)
    Runner (Ubuntu)->>GitHub Actions: Report build/test results
Loading

Assessment against linked issues

Objective Addressed Explanation
Always build pyOpenMS on at least one platform per PR (#8104) ✅
Ensure pyOpenMS test failures are visible in CI/CD (#8104) ✅

Poem

A bunny in CI hops with glee,
Ensuring pyOpenMS builds on Ubuntu, you see!
Dependencies installed, errors tracked with care,
No failing test will now slip unaware.
With each PR, the rabbit leaps high—
Success in the matrix, beneath the open sky!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d324e9f and bbcb73e.

📒 Files selected for processing (3)
  • .github/workflows/openms_ci_matrix_full.yml (2 hunks)
  • tools/ci/cibuild.cmake (1 hunks)
  • tools/ci/citest.cmake (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • .github/workflows/openms_ci_matrix_full.yml
  • tools/ci/cibuild.cmake
  • tools/ci/citest.cmake
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: build-and-test (ubuntu-22.04, clang++, 15)
  • GitHub Check: build-and-test (macos-13, xcode, 14.2)
  • GitHub Check: build-and-test (macos-14, xcode, 15.0.1)
  • GitHub Check: build-and-test (windows-2022, cl.exe, 14.36)
  • GitHub Check: build-and-test (ubuntu-22.04, g++, 11)
  • GitHub Check: cppcheck-test

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@pjones
pjones force-pushed the pjones/pyopenms-tests branch 5 times, most recently from 3874512 to 4cdf90b Compare July 10, 2025 13:55
@pjones
pjones marked this pull request as ready for review July 10, 2025 16:13
@pjones
pjones requested a review from timosachsenberg July 10, 2025 16:14

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/openms_ci_matrix_full.yml (1)

461-464: Note: Be aware of increased CI resource usage.

While this change correctly enables pyOpenMS testing on Ubuntu, it will increase build time and resource consumption for all Ubuntu-based CI runs.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 390cad8 and 4cdf90b.

📒 Files selected for processing (3)
  • .github/workflows/openms_ci_matrix_full.yml (2 hunks)
  • tools/ci/cibuild.cmake (1 hunks)
  • tools/ci/citest.cmake (1 hunks)
🔇 Additional comments (4)
tools/ci/cibuild.cmake (1)

184-204: LGTM: Improved build error detection and accumulation.

The refactored build logic correctly implements unconditional base builds followed by targeted builds with proper error accumulation. This ensures all build failures are captured rather than potentially missing errors from skipped builds.

.github/workflows/openms_ci_matrix_full.yml (3)

387-390: LGTM: Enables pyOpenMS builds on all Ubuntu runners.

This change aligns with the PR objective to enable pyOpenMS testing on Ubuntu. The unconditional enablement ensures consistent testing coverage.


393-395: LGTM: Extended CWL generation condition is appropriate.

Adding the PYOPENMS=ON condition for CWL generation makes sense since pyOpenMS builds may need CWL descriptors.


402-404: LGTM: Conditional Python dependency installation.

Installing pyOpenMS build requirements only when needed is the correct approach.

Comment thread tools/ci/citest.cmake Outdated
Comment on lines 30 to 35
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 3 RETURN_VALUE _test_errors)

if("$ENV{PYOPENMS}" STREQUAL "ON")
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" INCLUDE "pyopenms" PARALLEL_LEVEL 3 RETURN_VALUE _test_errors)
else()
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 3 RETURN_VALUE _test_errors)
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" INCLUDE "pyopenms" PARALLEL_LEVEL 3 RETURN_VALUE _py_test_errors)
math(EXPR _test_errors "${_test_errors} + ${_py_test_errors}")
endif()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify test execution logic to avoid potential duplication.

The current logic runs all tests first, then runs pyOpenMS tests separately. This may result in pyOpenMS tests being executed twice if they're included in both runs. Consider whether the first test run should exclude pyOpenMS tests or if this duplication is intentional.


🏁 Script executed:

#!/bin/bash
# Description: Check if pyOpenMS tests are included in general test runs
# Expected: Clarify if tests matching "pyopenms" pattern are run twice

# Search for test definitions to understand the test structure
rg -A 5 -B 5 "pyopenms" --type cmake

# Look for any existing test exclusion patterns
ast-grep --pattern 'ctest_test($$$EXCLUDE$$$)'

Length of output: 30394


Exclude pyOpenMS tests from the general run to prevent duplication

When PYOPENMS=ON, the first ctest_test call runs all tests—so your subsequent “INCLUDE pyopenms” invocation reruns those same tests. To avoid duplicates, add an EXCLUDE "pyopenms" filter to the initial invocation when PYOPENMS is enabled.

– In tools/ci/citest.cmake (around lines 30–35):

- ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 3 RETURN_VALUE _test_errors)
+ if("$ENV{PYOPENMS}" STREQUAL "ON")
+   # run all tests except pyOpenMS-specific ones
+   ctest_test(
+     BUILD "${CTEST_BINARY_DIRECTORY}"
+     EXCLUDE "pyopenms"
+     PARALLEL_LEVEL 3
+     RETURN_VALUE _test_errors
+   )
+ else()
+   ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 3 RETURN_VALUE _test_errors)
+ endif()
 
 if("$ENV{PYOPENMS}" STREQUAL "ON")
   ctest_test(
     BUILD "${CTEST_BINARY_DIRECTORY}"
     INCLUDE "pyopenms"
     PARALLEL_LEVEL 3
     RETURN_VALUE _py_test_errors
   )
   math(EXPR _test_errors "${_test_errors} + ${_py_test_errors}")
 endif()

This ensures pyOpenMS tests only run once, in the dedicated INCLUDE step.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 3 RETURN_VALUE _test_errors)
if("$ENV{PYOPENMS}" STREQUAL "ON")
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" INCLUDE "pyopenms" PARALLEL_LEVEL 3 RETURN_VALUE _test_errors)
else()
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 3 RETURN_VALUE _test_errors)
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" INCLUDE "pyopenms" PARALLEL_LEVEL 3 RETURN_VALUE _py_test_errors)
math(EXPR _test_errors "${_test_errors} + ${_py_test_errors}")
endif()
# Run general tests, excluding pyOpenMS ones when PYOPENMS=ON
if("$ENV{PYOPENMS}" STREQUAL "ON")
# run all tests except pyOpenMS-specific ones
ctest_test(
BUILD "${CTEST_BINARY_DIRECTORY}"
EXCLUDE "pyopenms"
PARALLEL_LEVEL 3
RETURN_VALUE _test_errors
)
else()
ctest_test(
BUILD "${CTEST_BINARY_DIRECTORY}"
PARALLEL_LEVEL 3
RETURN_VALUE _test_errors
)
endif()
if("$ENV{PYOPENMS}" STREQUAL "ON")
# now run only the pyOpenMS tests
ctest_test(
BUILD "${CTEST_BINARY_DIRECTORY}"
INCLUDE "pyopenms"
PARALLEL_LEVEL 3
RETURN_VALUE _py_test_errors
)
math(EXPR _test_errors "${_test_errors} + ${_py_test_errors}")
endif()
🤖 Prompt for AI Agents
In tools/ci/citest.cmake around lines 30 to 35, the initial ctest_test call runs
all tests including pyOpenMS when PYOPENMS=ON, causing duplicate test runs.
Modify the first ctest_test command to add EXCLUDE "pyopenms" when the PYOPENMS
environment variable is ON, so pyOpenMS tests are excluded from the general run
and only run in the dedicated INCLUDE "pyopenms" step.

@jpfeuffer

Copy link
Copy Markdown
Contributor

I think AI is correct. You are running pyopenms tests twice now.

@pjones

pjones commented Jul 10, 2025

Copy link
Copy Markdown
Contributor Author

I think AI is correct. You are running pyopenms tests twice now.

According to the CI output the Python tests only run once.

@jpfeuffer

Copy link
Copy Markdown
Contributor

Yeah I'm not sure. Let's wait until it builds without errors on Ubuntu.

@pjones
pjones force-pushed the pjones/pyopenms-tests branch from 5004ee1 to f98c17a Compare July 11, 2025 05:51
@pjones

pjones commented Jul 11, 2025

Copy link
Copy Markdown
Contributor Author

The current build failures on Ubuntu are being caused by one of the following commits:

  • da340bb952 Feature nase staticmods (touched some Python stuff, so maybe this one?)
  • 390cad853c Ignore SpectrumAccessTransforming again

Before those commits this branch was building without any errors.

@poshul What do you think?

@jpfeuffer

Copy link
Copy Markdown
Contributor

It's probably the second (which means there is still something wrong with autowrap btw).
But we should somehow expose the errors for future runs. Can you try to add such a logging to this PR?

@jpfeuffer

Copy link
Copy Markdown
Contributor

Now you can see that the pyopenms tests are run twice on Ubuntu. Once in the full test run and once in the pyopenms test run.

@pjones
pjones force-pushed the pjones/pyopenms-tests branch from d8a8e0b to c990b11 Compare July 14, 2025 14:59
@pjones

pjones commented Jul 14, 2025 •

Copy link
Copy Markdown
Contributor Author

Now you can see that the pyopenms tests are run twice on Ubuntu. Once in the full test run and once in the pyopenms test run.

I see that now, thanks!

@pjones
pjones force-pushed the pjones/pyopenms-tests branch from c990b11 to d324e9f Compare July 15, 2025 06:55
@pjones
pjones force-pushed the pjones/pyopenms-tests branch from 03e00ae to bbcb73e Compare July 18, 2025 08:39
@pjones
pjones merged commit e29d837 into develop Jul 18, 2025
@pjones
pjones deleted the pjones/pyopenms-tests branch July 18, 2025 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pyopenms should be build on at least one platform per PR

3 participants