Skip to content

Conversation

@kaibolay
Copy link
Contributor

Description

Add functionality to import and export test cases as YAML files.

Scenarios Tested

Example:

- displayName: Setup
  id: setup
  steps:
    - goal: Log in
      hint: Any username and password will work
- displayName: Smoke test
  id: smoke_test
  prerequisiteTestCaseId: setup
  steps:
    - goal: Go through the onboarding flow
      hint: Tap the next button until you reach the home screen
      successCriteria: The main app home page is visible
    - goal: Open the settings page
      hint: The settings button is in the top right corner
      successCriteria: The settings page is visible

Sample Commands

$ firebase appdistribution:testcases:export --app 1:123456789:android:d1e2a3d4b5e6e7f8 /tmp/test-cases.yaml
$ editor /tmp/test-cases.yaml
$ firebase appdistribution:testcases:import --app 1:123456789:android:d1e2a3d4b5e6e7f8 /tmp/test-cases.yaml

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @kaibolay, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the Firebase App Distribution CLI by enabling the export and import of test cases using YAML files. This new capability allows developers to version control, share, and programmatically manage their app testing workflows, providing greater flexibility and integration with existing development practices.

Highlights

  • YAML Export/Import Functionality: Introduced new CLI commands (firebase appdistribution:testcases:export and firebase appdistribution:testcases:import) to manage App Distribution test cases via YAML files, enabling version control and easier sharing.
  • API Client Extensions: Added listTestCases, createTestCase, and batchUpsertTestCases methods to the AppDistributionClient for interacting with the backend API for test case management.
  • YAML Serialization Logic: Implemented toYaml and fromYaml helper functions in src/appdistribution/yaml_helper.ts to convert TestCase objects to and from YAML format, including robust validation for required and unexpected properties.
  • New Data Types: Defined new TypeScript interfaces (TestCase, AiStep, AiInstructions, ListTestCasesResponse, BatchUpdateTestCasesRequest, BatchUpdateTestCasesResponse) to support the structured representation of test cases and their API interactions.
  • Comprehensive Testing: Added unit tests for the new client methods and YAML helper functions to ensure correct functionality, data integrity, and error handling during test case operations.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

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

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 adds functionality to import and export App Distribution test cases as YAML files. The changes include new client methods for interacting with the test case API, a YAML helper for data conversion, and new CLI commands for import/export. The implementation is solid, with good test coverage for the new logic. I have a couple of suggestions to improve error handling consistency and robustness in the YAML parsing logic.

@kaibolay kaibolay requested a review from lfkellogg October 28, 2025 23:00
@kaibolay
Copy link
Contributor Author

/gemini review

Copy link
Contributor

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

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 introduces functionality to import and export App Distribution test cases as YAML files. The changes include new commands, updates to the App Distribution client for test case APIs, new types, and a YAML helper for serialization/deserialization. The implementation is well-structured and includes corresponding tests.

My review focuses on improving robustness, ensuring test correctness, and promoting consistent error handling. I've identified a bug in a test case related to string interpolation, suggested using Promise.allSettled for more resilient batch processing in the import command, and pointed out areas for improved error logging and minor code simplification.

Copy link
Contributor

@joehan joehan left a comment

Choose a reason for hiding this comment

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

LGTM with some small nits

@kaibolay kaibolay enabled auto-merge (squash) October 30, 2025 19:27
@kaibolay kaibolay merged commit 6e4cb38 into master Oct 30, 2025
50 checks passed
@kaibolay kaibolay deleted the kb/test-cases-yaml branch October 30, 2025 19:39
@github-project-automation github-project-automation bot moved this from Approved [PR] to Done in [Cloud] Extensions + Functions Oct 30, 2025
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.

4 participants