Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add integration test with dummy agent #1316

Merged
merged 14 commits into from Apr 30, 2024
Merged

Add integration test with dummy agent #1316

merged 14 commits into from Apr 30, 2024

Conversation

rbren
Copy link
Collaborator

@rbren rbren commented Apr 23, 2024

This will help with QA tasks--making sure the agent is able to read/write files, run commands, etc

@rbren rbren marked this pull request as ready for review April 23, 2024 21:43
@rbren rbren changed the title [WIP] Add e2e test with dummy agent Add e2e test with dummy agent Apr 23, 2024
@rbren rbren marked this pull request as draft April 23, 2024 21:44
@li-boxuan
Copy link
Collaborator

li-boxuan commented Apr 25, 2024

Two cents:

  1. Is it possible to move the DummyAgent to test package? If something is solely for testing purpose, it should ideally not reside in the main package. There might be a challenge to register the agent, though.
  2. I know why you think it's e2e testing but I feel like it's more like a special kind of unit testing.

@rbren rbren changed the title Add e2e test with dummy agent Add integration test with dummy agent Apr 25, 2024
@rbren
Copy link
Collaborator Author

rbren commented Apr 25, 2024

Yeah I was thinking e2e isn't quite right 😄 maybe integration?

I kind of want the DummyAgent to show up in the UI, at least for devs--it helps to quickly test all the UI features without having to set everything up, wait for the LLM, pay money, etc.

@rbren rbren marked this pull request as ready for review April 25, 2024 15:40
@li-boxuan
Copy link
Collaborator

li-boxuan commented Apr 25, 2024

Is it possible to add a new test to run this agent and put the test under test/integration/? That way, this agent doesn't need a dedicated GitHub Actions yaml file, and can be run with pytest.

from opendevin.llm.llm import LLM


def test_actions_with_dummy_agent():
Copy link
Collaborator

@li-boxuan li-boxuan Apr 27, 2024

Choose a reason for hiding this comment

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

I am sorry but maybe it's a bad idea to add this as a pytest test.

If we want to keep it this way, we need to:

  1. add an annotation here:
@pytest.mark.skipif(os.environ.get('AGENT') != 'DummyAgent', reason='Designed to test DummyAgent only')
  1. Add another annotation in test_agent.py that DummyAgent needs to be skipped:
@pytest.mark.skipif(os.environ.get('AGENT') == 'DummyAgent', reason='DummyAgent is special and cannot solve any real task')
  1. Add DummyAgent to run-integration-tests.yml, so that a dedicated job runner will run DummyAgent test. Right now, I didn't check but I suppose all test runners run this test, which is unnecessary.

@neubig
Copy link
Contributor

neubig commented Apr 29, 2024

Hi @rbren , I'm happy to take a look at this but:

  1. It seems some tests are failing or at least stalled?
  2. I also added a dummy agent in this PR:
    class DummyAgent(Agent):

Feel free to get rid of my dummy agent and replace it with yours, I don't think it should break any of the unit tests I created.

@rbren
Copy link
Collaborator Author

rbren commented Apr 30, 2024

@neubig I think we're good to go!

.github/workflows/dummy-agent-test.yml Outdated Show resolved Hide resolved
return exit_code, logs.decode('utf-8').strip()
logs_out = logs.decode('utf-8')
if logs_out.endswith('\n'):
logs_out = logs_out[:-1]
Copy link
Collaborator

Choose a reason for hiding this comment

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

if you are changing strip() to this, you'd probably wanna do this in other sandboxes too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TBH I want to redo all the log parsing in a separate PR--I don't think we should be stripping whitespace from log output. This is here because the tests don't run consistently otherwise ☹️

rbren and others added 2 commits April 30, 2024 12:40
@rbren rbren enabled auto-merge (squash) April 30, 2024 16:41
@rbren rbren merged commit 0cda5f6 into main Apr 30, 2024
21 of 22 checks passed
@rbren rbren deleted the rb/dummy-test branch April 30, 2024 16:52
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.

None yet

3 participants