Skip to content

feat(tools/looker): Enable Run Lookml Tests tool for Looker#2523

Open
Anthrino wants to merge 2 commits into
googleapis:mainfrom
Anthrino:looker-run-tests
Open

feat(tools/looker): Enable Run Lookml Tests tool for Looker#2523
Anthrino wants to merge 2 commits into
googleapis:mainfrom
Anthrino:looker-run-tests

Conversation

@Anthrino

Copy link
Copy Markdown
Contributor

Description

Adds a new MCP tool to run one or more LookML tests defined in a project for validation of changes via the toolbox.

Invokes the Run LookML Test Looker API (RunLookmlTest sdk method), which runs single or multiple tests by specifying the project_id, file_id, test & model parameters to narrow the scope as required.

PR Checklist

Thank you for opening a Pull Request! Before submitting your PR, there are a
few things you can do to make sure it goes smoothly:

  • Make sure you reviewed
    CONTRIBUTING.md
  • Make sure to open an issue as a
    bug/issue
    before writing your code! That way we can discuss the change, evaluate
    designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)
  • Make sure to add ! if this involve a breaking change

🛠️ Fixes #2448

@Anthrino Anthrino requested review from a team February 19, 2026 18:00
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @Anthrino, 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 Looker integration by introducing a new tool designed to execute LookML tests directly from the toolbox. This capability streamlines the validation process for LookML changes, empowering developers to efficiently verify the integrity and correctness of their Looker projects without needing to switch environments. The addition improves the overall efficiency and reliability of LookML development workflows.

Highlights

  • New Looker Tool Added: A new Looker tool named run_lookml_tests has been integrated into the toolbox, enabling direct execution of LookML tests.
  • LookML Test Execution: This tool allows users to run LookML tests within a specified project, with options to filter by file, test name, or model for targeted validation.
  • Looker API Integration: The functionality is implemented by leveraging the Looker API's RunLookmlTest method, ensuring robust and official interaction with Looker instances.
Changelog
  • cmd/root.go
    • Imported the new lookerrunlookmltests package to register the tool.
  • cmd/root_test.go
    • Updated the looker_tools test configuration to include the run_lookml_tests tool.
  • internal/prebuiltconfigs/tools/looker.yaml
    • Defined the run_lookml_tests tool, specifying its kind, source, description, required parameters (project_id), optional parameters (file_id, test, model), and the expected output structure.
    • Added run_lookml_tests to the looker_tools toolset.
  • internal/tools/looker/lookerrunlookmltests/lookerrunlookmltests.go
    • Implemented the core Go logic for the looker-run-lookml-tests tool, including configuration parsing, parameter handling, and invocation of the Looker SDK's RunLookmlTest method.
  • internal/tools/looker/lookerrunlookmltests/lookerrunlookmltests_test.go
    • Added unit tests to verify the correct parsing of the looker-run-lookml-tests tool configuration from YAML.
Activity
  • No specific activity (comments, reviews, etc.) has been recorded for this pull request yet.
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.

@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

The pull request successfully enables the Run Lookml Tests tool for Looker. The implementation follows the established patterns in the repository, including proper tool registration, configuration parsing, and SDK invocation. The addition of tests for configuration parsing ensures robustness. I have provided a few suggestions to improve error handling and code clarity in the tool's invocation logic.

Comment on lines +125 to +128
projectId, ok := mapParams["project_id"].(string)
if !ok {
return nil, fmt.Errorf("'project_id' must be a string, got %T", mapParams["project_id"])
}

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.

medium

While ParseParams should have already validated that project_id is present and correctly typed, this manual check is good for defensive programming. However, if project_id is missing from mapParams, mapParams["project_id"] will be nil, and %T will produce <nil>. The error message is clear enough, but you might want to explicitly check for nil if you want a more specific message.

Comment on lines +130 to +143
var fileId *string
if val, ok := mapParams["file_id"].(string); ok && val != "" {
fileId = &val
}

var test *string
if val, ok := mapParams["test"].(string); ok && val != "" {
test = &val
}

var model *string
if val, ok := mapParams["model"].(string); ok && val != "" {
model = &val
}

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.

medium

The logic for handling optional parameters is correct. However, since these parameters are defined as TypeString in Initialize, ParseParams ensures they are strings if present. You can simplify the extraction by using a helper or just checking for the zero value if you trust the upstream validation.

Suggested change
var fileId *string
if val, ok := mapParams["file_id"].(string); ok && val != "" {
fileId = &val
}
var test *string
if val, ok := mapParams["test"].(string); ok && val != "" {
test = &val
}
var model *string
if val, ok := mapParams["model"].(string); ok && val != "" {
model = &val
}
var fileId *string
if val, _ := mapParams["file_id"].(string); val != "" {
fileId = &val
}
var test *string
if val, _ := mapParams["test"].(string); val != "" {
test = &val
}
var model *string
if val, _ := mapParams["model"].(string); val != "" {
model = &val
}

@Yuan325 Yuan325 added the product: looker Looker label Mar 10, 2026
@Yuan325 Yuan325 requested a review from drstrangelooker March 10, 2026 18:30
@Yuan325 Yuan325 added the priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. label Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. product: looker Looker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(tools/looker): Enable Run Lookml Tests tool for Looker

2 participants