Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infer Git Data #1648

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Infer Git Data #1648

wants to merge 3 commits into from

Conversation

kalverra
Copy link
Collaborator

@kalverra kalverra commented Feb 20, 2025

Uses native go tools to infer git data instead of asking for it on the CLI


Below is a summarization created by an LLM (gpt-4-0125-preview). Be mindful of hallucinations and verify accuracy.

Why

The changes address the need for aggregating test results with enhanced git and GitHub data, improving the flexibility and accuracy of test report generation. They also cater to the testing framework's ability to handle deeply nested tests and refine the logic for running custom commands, ensuring a more comprehensive and reliable testing process.

What

  • tools/flakeguard/cmd/aggregate_results.go
    • Added import for github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard/git.
    • Replaced branch-name flag with current-branch and default-branch, and added base-branch to capture more detailed git branch information.
    • Included git and GitHub data (userGitData, gitData, userGitHubData, gitHubData) in the aggregation logic, enhancing the report's detail and accuracy.
    • Adjusted aggregate command flags to support new git data integration.
  • tools/flakeguard/git/git.go
    • Introduced new structs (Data, HubActionsData) and methods (InferData, InferGitHubData) for capturing and processing git and GitHub data.
    • Added import for dario.cat/mergo and github.com/rs/zerolog/log to facilitate merging user-provided data with inferred data and logging.
  • tools/flakeguard/git/git_test.go
    • Placeholder for future tests related to git data inference.
  • go.mod & go.sum
    • Updated dependencies to include dario.cat/mergo for merging structs and github.com/go-git/go-git/v5 for git operations.
  • tools/flakeguard/reports/data.go
    • Expanded TestReport struct to include DefaultBranchName and BaseBranchName, allowing storage of comprehensive git branch information.
  • tools/flakeguard/reports/io.go
    • Modified aggregation options and report saving logic to incorporate git and GitHub data.
  • tools/flakeguard/runner/example_test_package/example_tests_test.go
    • Added new test function TestDeeplyNestedSubTests to demonstrate handling of deeply nested subtests.
    • Removed t.Parallel() from certain subtests for clarity and consistency.
  • tools/flakeguard/runner/runner.go
    • Optimized command execution in runCmd function by directly passing command arguments, enhancing security and performance.
  • tools/flakeguard/runner/runner_test.go
    • Updated test cases to cover new logic and scenarios, including deeply nested subtests and enhanced git data handling.

@cl-sonarqube-production
Copy link

@kalverra kalverra marked this pull request as draft February 21, 2025 03:08
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.

1 participant