Skip to content

fix(tests): simplify testing#1343

Merged
leshy merged 1 commit intodevfrom
paul/fix/testing-docs-2
Feb 24, 2026
Merged

fix(tests): simplify testing#1343
leshy merged 1 commit intodevfrom
paul/fix/testing-docs-2

Conversation

@paul-nechifor
Copy link
Contributor

@paul-nechifor paul-nechifor commented Feb 22, 2026

Problem

Our testing setup is quite complicated.

Closes DIM-559

Solution

  • Remove all marks except: tool, slow (replacement for heavy/integration/e2e), and mujoco.
  • Have a single testing job which runs all pytest tests.
  • Fix broken neverending and module tests.
  • Add custom skipif markers like skipif_in_ci, skipif_no_openai to lessen duplication.
  • Fix the remaining tests which didn't close threads.
  • Update the docs.

Breaking Changes

None

How to Test

Run the commands from https://github.com/dimensionalOS/dimos/blob/paul/fix/testing-docs-2/docs/development/testing.md .

Contributor License Agreement

  • I have read and approved the CLA.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 22, 2026

Greptile Summary

This PR refactors the test infrastructure by consolidating 13 pytest markers down to 3 (tool, slow, mujoco), removing deprecated/unused markers like heavy, integration, e2e, ros, lcm, gpu, cuda, module, neverending, vis, and exclude.

Key changes:

  • Simplified pytest configuration in pyproject.toml with unified slow marker for all tests taking >1 second
  • Replaced CUDA detection logic with environment-based skipif_* markers (skipif_in_ci, skipif_no_openai, skipif_no_alibaba)
  • Consolidated CI workflow from 5 separate test jobs (run-tests, run-heavy-tests, run-lcm-tests, run-integration-tests, run-ros-tests) into 2 jobs with simplified filters
  • Updated 40+ test files to use new marker system
  • Removed obsolete test stubs and tests marked as neverending, exclude, or lcm-only
  • Improved test_stream.py with event-based synchronization instead of time.sleep() and proper cleanup
  • Updated documentation to reflect new simplified testing approach

The refactor makes the test suite more maintainable by reducing complexity and providing clearer categorization between fast/slow tests.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk - it's a well-executed test infrastructure refactor
  • The changes are systematic and consistent across all files, replacing deprecated markers with a simpler system. The refactor improves test organization, removes dead code, and makes the CI pipeline more efficient by consolidating jobs. All changes follow clear patterns and improve code quality without touching production logic.
  • No files require special attention - all changes follow consistent patterns

Important Files Changed

Filename Overview
pyproject.toml Simplified pytest markers from 13 down to 3 (tool, slow, mujoco) and updated test filter to match
dimos/conftest.py Replaced CUDA detection logic with configurable skipif_* markers for CI, OpenAI, and Alibaba API keys
docs/development/testing.md Updated documentation to reflect new simplified marker system (slow instead of integration, heavy, e2e, etc.)
.github/workflows/docker.yml Consolidated 5 separate test jobs into a single job running all non-tool/mujoco tests with duration reporting
dimos/core/test_stream.py Changed @pytest.mark.module to @pytest.mark.slow, added proper cleanup calls and event-based synchronization instead of sleep
dimos/msgs/nav_msgs/test_OccupancyGrid.py Removed 104-line @pytest.mark.lcm test function for LCM broadcasting
dimos/perception/detection/test_moduleDB.py Removed entire 59-line test_moduledb_basic function that was marked with @pytest.mark.neverending

Last reviewed commit: 3e10cd5

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

33 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@paul-nechifor paul-nechifor marked this pull request as draft February 22, 2026 06:40
@paul-nechifor paul-nechifor force-pushed the paul/fix/testing-docs-2 branch 5 times, most recently from 8ac5305 to f5f6f03 Compare February 24, 2026 06:06
@paul-nechifor paul-nechifor marked this pull request as ready for review February 24, 2026 06:06
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

48 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@paul-nechifor paul-nechifor changed the title fix(tests): fix fix(tests): simplify testing Feb 24, 2026
@paul-nechifor paul-nechifor force-pushed the paul/fix/testing-docs-2 branch from 3e10cd5 to 70d79b5 Compare February 24, 2026 06:36
Copy link
Member

@jeff-hykin jeff-hykin left a comment

Choose a reason for hiding this comment

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

I love the color red when it comes to PR's. My only questions are:

  • is cuda still fine? (E.g. non cuda systems just don't add the cuda flag, that's why we don't need a has_cuda check)
  • I'm a bit unsure of our policy for .stop /close/shutdown/unsub. It feels like there should be a consistent naming system. Like stop is always stop-all or some similar rule.

nav.stop()
nav.stop_rpc_client()
robot.stop_rpc_client()
dimos.close_all()
Copy link
Member

Choose a reason for hiding this comment

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

Is this typical/recommended over dimos.shutdown?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, dimos.close_all does a few other things, but we won't be using Dask for long as I'm removing it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we can have whatever our forking coordinator is - conform to Resource so stop() recursively goes through active modules/processes?


@rpc
def stop(self) -> None:
def unsub_all(self) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

Seems kinda nice for stop to be a universal method that includes stuff like unsub_all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. But this test module defined stop whilst not actually calling super().stop() and then calling dimos.close_all(). It felt easier at the time to just rename but I should probably fix it the right way. 😅

@paul-nechifor
Copy link
Contributor Author

* is cuda still fine? (E.g. non cuda systems just don't add the cuda flag, that's why we don't need a has_cuda check)

There are no CUDA tests left. The Image CUDA stuff was removed a while ago. And the Metric3D thing was removed recently. It might make sense to add it again later, but not needed anymore now.


ci-complete:
needs: [check-changes, ros, python, ros-python, dev, ros-dev, run-tests, run-heavy-tests, run-lcm-tests, run-integration-tests, run-ros-tests, run-mypy]
needs: [check-changes, ros, python, ros-python, dev, ros-dev, run-ros-tests, run-mypy]
Copy link
Contributor

Choose a reason for hiding this comment

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

just to know what the plan was with ros/non ros parallel tests - I planned to treat ros build as a separate OS, since it does heavy intervention into the OS itslef, and wanted to make sure that unguarded ros imports don't crash non-ros machines, so potentially we want to re-introduce

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It makes sense to test that, but maybe not on every PR? Maybe we can have a periodic runner which runs all the tests on a variety of environments like Ubuntu 22.04/24.04, with ROS/without ROS, MacOS, etc.

leshy
leshy previously approved these changes Feb 24, 2026
Copy link
Contributor

@leshy leshy left a comment

Choose a reason for hiding this comment

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

This is so amazing, thanks Paul

@leshy
Copy link
Contributor

leshy commented Feb 24, 2026

Paul is codebase Jesus, suffering for our sins

@leshy leshy merged commit 3b15cde into dev Feb 24, 2026
12 checks passed
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.

3 participants