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

Failing unit tests dependent on HTTP requests #406

Open
SPDonaghy opened this issue Jun 16, 2024 · 0 comments
Open

Failing unit tests dependent on HTTP requests #406

SPDonaghy opened this issue Jun 16, 2024 · 0 comments
Assignees
Labels
bug Something isn't working path Pathfinding team tests

Comments

@SPDonaghy
Copy link
Contributor

SPDonaghy commented Jun 16, 2024

Description

local_pathfinding/test/test_global_path.py has a unit test for get_pos() which depends on the availability of a separate HTTP server to handle a GET request. It would be better to make all unit tests fully encapsulated and just mock http endpoints.

Testing the functionality of the actual http endpoints should be out of the scope of unit tests for individual files.

Expected Behavior

Unit tests pass without dependency on any other sailbot_workspace packages

Actual Behavior

Unit tests fail when the expected response is not received from the endpoint.
Running the test task on the main branch of sailbot_workspace should always pass.

The test task actually works now for the get_pos() function. I still want to modify the test to use a mocked http server rather than depending on the endpoint used by get_pos()

Relevant Code

test_global_path.py

Potential Solutions

Mock the http endpoint behavior.

Resources

@SPDonaghy SPDonaghy added the bug Something isn't working label Jun 16, 2024
@github-project-automation github-project-automation bot moved this to Backlog in SOFT Project Jun 16, 2024
@SPDonaghy SPDonaghy self-assigned this Jun 16, 2024
@SPDonaghy SPDonaghy added path Pathfinding team tests labels Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working path Pathfinding team tests
Projects
Status: Backlog
Development

No branches or pull requests

1 participant