🧪 Improve texture ingestion tests#61
Conversation
…e ingestion via RemixAPIClient and invalid_arguments error block\n📊 Coverage: Tested API request fails, file missing after success, and expected/fallback suffixes\n✨ Result: ingest_texture function is now fully covered with unit tests Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
This PR expands the RemixAPIClient.ingest_texture() unit tests and adds an early invalid-argument check in remix_api.py. It fits into the codebase by strengthening the Remix API integration layer and improving confidence in the texture push/ingestion workflow that core.py depends on.
Changes:
- Add new
ingest_texture()tests covering invalid args, request failures, output-path parsing, and missing output files. - Update the test-side mocked
requestsexceptions so retry handling matches production behavior. - Add an early guard in
RemixAPIClient.ingest_texture()for missingpbr_type/texture_file_path.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
tests/test_remix_api.py |
Adds texture-ingestion test coverage and adjusts the mocked requests exception hierarchy. |
remix_api.py |
Adds early argument validation to ingest_texture(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| def ingest_texture(self, pbr_type, texture_file_path, project_output_dir_abs): | ||
|
|
||
| if not texture_file_path or not pbr_type: |
| def ingest_texture(self, pbr_type, texture_file_path, project_output_dir_abs): | ||
|
|
||
| if not texture_file_path or not pbr_type: | ||
| return False, "Invalid arguments to ingest_texture" |
| self.assertIsNotNone(res) | ||
| self.assertIsNone(err) | ||
| self.assertTrue(res.endswith("test.a.rtex.dds")) |
| self.assertIsNotNone(res) | ||
| self.assertIsNone(err) | ||
| self.assertTrue(res.endswith("test.x.rtex.dds")) |
| def ingest_texture(self, pbr_type, texture_file_path, project_output_dir_abs): | ||
|
|
||
| if not texture_file_path or not pbr_type: | ||
| return False, "Invalid arguments to ingest_texture" | ||
|
|
||
| self._log_info(f"Ingesting {pbr_type}: {self.safe_basename(texture_file_path)}") | ||
|
|
||
| if not os.path.isfile(texture_file_path): |
| ok, err = client.ingest_texture(None, "", "/out") | ||
| self.assertFalse(ok) | ||
| self.assertEqual(err, "Invalid arguments to ingest_texture") | ||
|
|
🎯 What: Missing tests for texture ingestion via RemixAPIClient, and implemented a fix for invalid argument errors (
if not texture_file_path or not pbr_typeblock was missing iningest_texture).📊 Coverage:
ingest_texture✨ Result:
ingest_texturefunction logic is fully tested, adding critical validation to thetests/test_remix_api.pyunit testing suite, resulting in higher confidence during refactors and deployments.PR created automatically by Jules for task 961368186393042931 started by @skurtyyskirts