Skip to content

[65] Fix issue of new solver integration#66

Merged
nirlipo merged 3 commits intoplanimation:developfrom
chillray:develop
May 30, 2024
Merged

[65] Fix issue of new solver integration#66
nirlipo merged 3 commits intoplanimation:developfrom
chillray:develop

Conversation

@chillray
Copy link
Copy Markdown
Contributor

  • Fix Plan_generator to retrieve plan from the new solver

Resolves #65

 - Fix Plan_generator to retrieve plan from the new solver

Resolves planimation#65
Lin064
Lin064 previously approved these changes Apr 16, 2024
Copy link
Copy Markdown

@Lin064 Lin064 left a comment

Choose a reason for hiding this comment

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

Reviewer: Zhicheng Lin

Author: Jian Zhang

Review Date: 15/04/2024

Commit Summary: Refactor get_plan function for improved error handling and retry

Understanding the Code
Purpose: Refactor the retry and error handling in get_plan method.
Implementation: Raise specific error and message.

Code Quality
Clarity: The code is understandable.
Reliability: This solution solves the compatible problem of request library in Python 3.6.

Approval Status
Status: Approved

nirlipo
nirlipo previously approved these changes Apr 17, 2024
Copy link
Copy Markdown
Contributor

@nirlipo nirlipo left a comment

Choose a reason for hiding this comment

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

Great! Thanks for pushing the code.

nirlipo
nirlipo previously approved these changes Apr 17, 2024
Copy link
Copy Markdown
Contributor

@nirlipo nirlipo left a comment

Choose a reason for hiding this comment

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

Let's see if it builds now :)

@nirlipo
Copy link
Copy Markdown
Contributor

nirlipo commented Apr 17, 2024

@chillray, there's another issue with the build failing on 2 tests:
https://github.com/planimation/backend/actions/runs/8716935568/job/23912948792?pr=66

======================================================================
ERROR: test_planimation_process (server.unit_test.test_cases.TestStringMethods)
Test case for testing the whole process of planimation
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/backend/backend/server/unit_test/test_cases.py", line 74, in test_planimation_process
    stages = get_stages(plan, problem_dic, problem_content, predicates_list)
  File "/home/runner/work/backend/backend/server/app/vfg/parser/Predicates_generator.py", line 60, in get_stages
    action_effect_list = get_action_effect_list(actionlist)
  File "/home/runner/work/backend/backend/server/app/vfg/parser/Predicates_generator.py", line [14](https://github.com/planimation/backend/actions/runs/8716935568/job/23912948792?pr=66#step:6:15)0, in get_action_effect_list
    effect_element = action['action']
TypeError: string indices must be integers

======================================================================
ERROR: test_predicates_generator (server.unit_test.test_cases.TestStringMethods)
Test case for testing the predicates generator function
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/backend/backend/server/unit_test/test_cases.py", line 232, in test_predicates_generator
    simple_stages = get_stages(simple_plan, simple_problem_dic, simple_problem_content, simple_predicates_list)
  File "/home/runner/work/backend/backend/server/app/vfg/parser/Predicates_generator.py", line 60, in get_stages
    action_effect_list = get_action_effect_list(actionlist)
  File "/home/runner/work/backend/backend/server/app/vfg/parser/Predicates_generator.py", line 140, in get_action_effect_list
    effect_element = action['action']
TypeError: string indices must be integers

----------------------------------------------------------------------
Ran 8 tests in 5.6[24](https://github.com/planimation/backend/actions/runs/8716935568/job/23912948792?pr=66#step:6:25)s

FAILED (errors=2)

@Lin064
Copy link
Copy Markdown

Lin064 commented Apr 17, 2024

@chillray, there's another issue with the build failing on 2 tests: https://github.com/planimation/backend/actions/runs/8716935568/job/23912948792?pr=66

======================================================================
ERROR: test_planimation_process (server.unit_test.test_cases.TestStringMethods)
Test case for testing the whole process of planimation
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/backend/backend/server/unit_test/test_cases.py", line 74, in test_planimation_process
    stages = get_stages(plan, problem_dic, problem_content, predicates_list)
  File "/home/runner/work/backend/backend/server/app/vfg/parser/Predicates_generator.py", line 60, in get_stages
    action_effect_list = get_action_effect_list(actionlist)
  File "/home/runner/work/backend/backend/server/app/vfg/parser/Predicates_generator.py", line [14](https://github.com/planimation/backend/actions/runs/8716935568/job/23912948792?pr=66#step:6:15)0, in get_action_effect_list
    effect_element = action['action']
TypeError: string indices must be integers

======================================================================
ERROR: test_predicates_generator (server.unit_test.test_cases.TestStringMethods)
Test case for testing the predicates generator function
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/backend/backend/server/unit_test/test_cases.py", line 232, in test_predicates_generator
    simple_stages = get_stages(simple_plan, simple_problem_dic, simple_problem_content, simple_predicates_list)
  File "/home/runner/work/backend/backend/server/app/vfg/parser/Predicates_generator.py", line 60, in get_stages
    action_effect_list = get_action_effect_list(actionlist)
  File "/home/runner/work/backend/backend/server/app/vfg/parser/Predicates_generator.py", line 140, in get_action_effect_list
    effect_element = action['action']
TypeError: string indices must be integers

----------------------------------------------------------------------
Ran 8 tests in 5.6[24](https://github.com/planimation/backend/actions/runs/8716935568/job/23912948792?pr=66#step:6:25)s

FAILED (errors=2)

@chillray It seems like We cannot extract ['result']['plan'] to outside ,because the test case will call the function directly.

@nirlipo
Copy link
Copy Markdown
Contributor

nirlipo commented Apr 17, 2024

What was there a reason to extract ['result']['plan'] ? If it wasn't adding any functionality, can you update it and test that the code passes the tests in your local machine? you can do so following this documentation: https://github.com/planimation/backend/tree/develop/server/unit_test

Thanks!

@chillray
Copy link
Copy Markdown
Contributor Author

chillray commented Apr 25, 2024

@nirlipo Just updated the unit test for new solver, all tests should pass now :), sorry for the overlook before pull request

@nirlipo
Copy link
Copy Markdown
Contributor

nirlipo commented May 30, 2024

Great! working fine now. Thanks

@nirlipo nirlipo merged commit 61c95b3 into planimation:develop May 30, 2024
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.

[Bug]: Integrated with the new Planning as a Service solver

3 participants