Skip to content

[camera_android_camerax] Update AGENTS.md to improve video recording integration tests - #12301

Open
camsim99 wants to merge 2 commits into
flutter:mainfrom
camsim99:camx_agents_vidnote
Open

[camera_android_camerax] Update AGENTS.md to improve video recording integration tests#12301
camsim99 wants to merge 2 commits into
flutter:mainfrom
camsim99:camx_agents_vidnote

Conversation

@camsim99

@camsim99 camsim99 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Adds note to AGENTS.md to hint to agents that if they add integration tests for video recording, they should add a delay between starting/stopping recordings to ensure the camera has enough time to initialized and get a valid recording.

Inspired by an agent running into this while creating #12145 (see #12145 (comment))

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jul 28, 2026
@camsim99 camsim99 changed the title [camera_android_camerax] Update `G [camera_android_camerax] Update AGENTS.md to improve video recording integration tests Jul 28, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the AGENTS.md file in packages/camera/camera_android_camerax to add a guideline requiring a delay during video recording integration tests to prevent flakiness. There are no review comments, and there is no feedback to provide.

@reidbaker reidbaker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

FYI #12297 will add the ability to unit test agents.md

- Maintain high test coverage using [dart-add-unit-test](.agents/skills/dart-add-unit-test/SKILL.md)
and [dart-collect-coverage](.agents/skills/dart-collect-coverage/SKILL.md).
- Avoid duplicating constant strings; reuse existing ones from adjacent code.
- **Video Recording Integration Tests**: You MUST insert a delay (e.g., `await Future<void>.delayed(const Duration(seconds: 4));`) after starting a video recording and before stopping it. Without this delay, the test will flake or fail because the Android device/emulator needs time to initialize the encoder and capture frames before finalizing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

non blocking nits. I think this should break out into a TESTING.md that documents our testing best practices and rules and tips like this.

- Maintain high test coverage using [dart-add-unit-test](.agents/skills/dart-add-unit-test/SKILL.md)
and [dart-collect-coverage](.agents/skills/dart-collect-coverage/SKILL.md).
- Avoid duplicating constant strings; reuse existing ones from adjacent code.
- **Video Recording Integration Tests**: You MUST insert a delay (e.g., `await Future<void>.delayed(const Duration(seconds: 4));`) after starting a video recording and before stopping it. Without this delay, the test will flake or fail because the Android device/emulator needs time to initialize the encoder and capture frames before finalizing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we link to a test that does this correctly?

@camsim99
camsim99 requested a review from reidbaker July 28, 2026 18:35
@camsim99 camsim99 added override: no versioning needed Override the check requiring version bumps for most changes override: no changelog needed Override the check requiring CHANGELOG updates for most changes labels Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD override: no changelog needed Override the check requiring CHANGELOG updates for most changes override: no versioning needed Override the check requiring version bumps for most changes p: camera

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants