Repository navigation
[TEST]: Run pyOpenMS tests on Ubuntu - #8111
Conversation
WalkthroughThe 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 Changes
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
Assessment against linked issues
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
⏰ 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)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
3874512 to
4cdf90b
Compare
There was a problem hiding this comment.
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
📒 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=ONcondition 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.
| 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() |
There was a problem hiding this comment.
💡 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.
| 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.
|
I think AI is correct. You are running pyopenms tests twice now. |
According to the CI output the Python tests only run once. |
|
Yeah I'm not sure. Let's wait until it builds without errors on Ubuntu. |
5004ee1 to
f98c17a
Compare
|
The current build failures on Ubuntu are being caused by one of the following commits:
Before those commits this branch was building without any errors. @poshul What do you think? |
|
It's probably the second (which means there is still something wrong with autowrap btw). |
|
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. |
d8a8e0b to
c990b11
Compare
I see that now, thanks! |
c990b11 to
d324e9f
Compare
Related to #8104.
03e00ae to
bbcb73e
Compare
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