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

chore(robot-server): Add a script to recursively download HTTP resources and screen them for errors #17273

Open
wants to merge 2 commits into
base: edge
Choose a base branch
from

Conversation

SyntaxColoring
Copy link
Contributor

Overview

This adds a script to recursively hit a bunch of robot-server endpoints (all the runs, then all those runs' commands, etc.), report any errors, and optionally save the response bodies to the local filesystem for inspection.

Example terminal output.

Example output directory full of response bodies.

The immediate motivation for this was to double-check my resolution of RQA-3853. But maybe it's generally good to have around?

This is basically the same idea as our persistence compatibility tests. One difference is that those tests run in Pytest, against snapshots that we've checked into the Git repo, whereas this is a script that a human can run against actual robots. Another difference is that those tests currently only check basic facts about the resources ("how many runs", "how many commands"), whereas this can return the resources' actual JSON contents. I think we could refactor their implementations to share a lot of the logic, if we want. This also gets us pretty close to including actual JSON contents in the pytest snapshots, if we want.

Test Plan and Hands on Testing

  • Try it out.

Review requests

  • Is this worth the maintenance? Will we use this?
  • Are we okay with this script's duplication with test_compatibility.py for the forseeable future, or do we want to fix it before merging this?
  • Any opinions on whether we should get the test_compatibility.py snapshots to compare actual JSON contents, instead of just basic facts like "how many runs" and "how many commands"?

Risk assessment

No risk.

@SyntaxColoring SyntaxColoring requested review from a team as code owners January 14, 2025 22:55
run_dev ?= uvicorn "robot_server.app:app" --host $(dev_host) --port $(dev_port) --ws wsproto --lifespan on --reload
run_dev ?= uvicorn "robot_server.app:app" --host $(dev_host) --port $(dev_port) --ws wsproto --lifespan on --reload --reload-dir robot_server
Copy link
Contributor Author

@SyntaxColoring SyntaxColoring Jan 14, 2025

Choose a reason for hiding this comment

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

make dev was hot-reloading the server any time I saved the script file, which was unnecessary, and caused confusing errors when testing the script against the make dev localhost server. This excludes the scripts/ directory from hot reloading to prevent that.

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.

1 participant