OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

Revert ssh box implemetation, fix multi-line command issues and add unit tests

Open xingyaoww opened this issue 1 year ago • 1 comments

This PR is an updated version of https://github.com/OpenDevin/OpenDevin/pull/1432. The previous one had too many issues with rebase and merging with main, so I'd think just restart a clean one.

  • Revert SSHBox implementation change in https://github.com/OpenDevin/OpenDevin/pull/1417, which does not pass all the unit tests (it causes failure for CodeActAgent when source ~/.bashrc.
  • Add docs and instructions for unit tests.

NOTE: we need to run unit tests for test_sandbox.py separately. test_sandbox.py needs to import OpenDevin modules in the fixture. Running it together with another file will cause it to re-use the imported module and loaded config from other modules, hence causing errors.

xingyaoww avatar Apr 30 '24 04:04 xingyaoww

@li-boxuan @rbren i figured out a way to mock the config :) - now it should be ready for review.

xingyaoww avatar Apr 30 '24 09:04 xingyaoww

@rbren i just tried locally for echo=False and remove all the strip.. and it is kinda tricky to get it right easily. Let's starts a separate issue to track this!

xingyaoww avatar Apr 30 '24 16:04 xingyaoww

@xingyaoww This PR introduces tests/unit/test_sandbox.py, this conflicts with #1088 and #1463.

From my perspective, the tests seem to go beyond the scope of unit testing. Unit tests are typically designed to be isolated and fast, primarily testing the functionality of individual components in isolation. The need to pull a Docker image and the involvement of configuration settings for a sandbox environment suggests a level of integration that aligns more closely with integration testing.

My point is, is it better to move this test to the integration testing folder so that the unit tests do not actually need to pull a Docker image?

Umpire2018 avatar May 02 '24 10:05 Umpire2018

@Umpire2018 Good point! Let's move it to the integration test then!

xingyaoww avatar May 02 '24 11:05 xingyaoww