Skip to content

chore(looker): make looker integration tests less error prone#2730

Open
drstrangelooker wants to merge 3 commits intomainfrom
looker-integration-tests
Open

chore(looker): make looker integration tests less error prone#2730
drstrangelooker wants to merge 3 commits intomainfrom
looker-integration-tests

Conversation

@drstrangelooker
Copy link
Contributor

@drstrangelooker drstrangelooker commented Mar 12, 2026

Description

make looker integration tests less error prone by adding a random 8 char string to the names of objects created and deleted.

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 #

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 enhances the robustness of Looker integration tests by introducing unique identifiers for test-created resources. By appending a random string to object names, the tests can run more reliably without interference from previously created or concurrently existing resources, thereby reducing flakiness and improving test stability. Additionally, several Go module dependencies were updated to ensure the project uses the latest stable versions.

Highlights

  • Improved Looker Integration Test Reliability: Implemented a mechanism to make Looker integration tests less prone to errors by appending a random 8-character string to the names of objects created and deleted during tests. This prevents naming conflicts when tests run concurrently or in rapid succession.
  • Dependency Updates: Updated several Go module dependencies, including google.golang.org/genai and various indirect dependencies, to their latest versions.
Changelog
  • go.mod
    • Updated google.golang.org/genai from v1.48.0 to v1.49.0.
    • Updated github.com/BurntSushi/toml from v1.4.1 to v1.6.0.
    • Updated github.com/ebitengine/purego from v0.8.4 to v0.10.0.
    • Added new indirect dependencies: github.com/go-viper/mapstructure/v2, github.com/gofrs/flock, github.com/google/pprof, github.com/lib/pq, and github.com/onsi/gomega.
    • Updated github.com/power-devops/perfstat, github.com/shirou/gopsutil/v4, github.com/sirupsen/logrus, github.com/spf13/pflag, github.com/tklauser/go-sysconf, and github.com/tklauser/numcpus to newer versions.
    • Updated golang.org/x/mod, golang.org/x/sync, golang.org/x/telemetry, and golang.org/x/tools to newer versions.
  • tests/looker/looker_integration_test.go
    • Imported the crypto/rand package to generate random strings.
    • Introduced a randstr variable to hold an 8-character random string.
    • Modified calls to create_project_file, update_project_file, delete_project_file, create_project_directory, get_project_directories, and delete_project_directory to include the randstr in object names.
    • Updated testMakeLook and testMakeDashboard functions to accept and use the randstr in the titles of created Looker objects.
Ignored Files
  • Ignored by pattern: go.sum (1)
    • go.sum
Activity
  • The author reviewed the CONTRIBUTING.md.
  • The author opened an issue before writing the code.
  • The author ensured that tests and linter passed.
  • The author confirmed that code coverage did not decrease.
  • The author updated appropriate documentation (if necessary).
  • The author considered if this involved a breaking change.
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 aims to make the Looker integration tests more robust by using a random string to name test resources, preventing collisions. While the overall approach is sound, there is a critical issue in the implementation. The code attempts to use a non-existent function rand.Text() from the crypto/rand package, which will cause a compilation failure. I've provided a code suggestion to fix this by correctly generating a random hexadecimal string.

@drstrangelooker drstrangelooker force-pushed the looker-integration-tests branch from 458b5a2 to 17ea048 Compare March 12, 2026 20:29
@Yuan325 Yuan325 added the release candidate Use label to signal PR should be included in the next release. label Mar 12, 2026
@Yuan325 Yuan325 enabled auto-merge (squash) March 12, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release candidate Use label to signal PR should be included in the next release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants