Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Fix integration test (#7747)

Engel Nyst22cf5144cc9b
diff --git a/evaluation/integration_tests/tests/t04_git_staging.py b/evaluation/integration_tests/tests/t04_git_staging.py
index 5d9459ec4a..d15f6d1ba9 100644
--- a/evaluation/integration_tests/tests/t04_git_staging.py
+++ b/evaluation/integration_tests/tests/t04_git_staging.py
@@ -19,13 +19,13 @@ class Test(BaseIntegrationTest):
obs = runtime.run_action(action)
assert_and_raise(obs.exit_code == 0, f'Failed to run command: {obs.content}')
- # create README.md
+ # create file
action = CmdRunAction(command='echo \'print("hello world")\' > hello.py')
obs = runtime.run_action(action)
assert_and_raise(obs.exit_code == 0, f'Failed to run command: {obs.content}')
- # git add README.md
- action = CmdRunAction(command='git add hello.py')
+ # git add
+ action = CmdRunAction(command='git add hello.py .vscode/')
obs = runtime.run_action(action)
assert_and_raise(obs.exit_code == 0, f'Failed to run command: {obs.content}')
@@ -40,6 +40,15 @@ class Test(BaseIntegrationTest):
reason=f'Failed to cat /workspace/hello.py: {obs.content}.',
)
+ # check if the file /workspace/.vscode/settings.json exists
+ action = CmdRunAction(command='cat /workspace/.vscode/settings.json')
+ obs = runtime.run_action(action)
+ if obs.exit_code != 0:
+ return TestResult(
+ success=False,
+ reason=f'Failed to cat /workspace/.vscode/settings.json: {obs.content}.',
+ )
+
# check if the staging area is empty
action = CmdRunAction(command='git status')
obs = runtime.run_action(action)