Skip to content

chore: split gitea_test.go into focused files#2826

Open
KMI1011 wants to merge 1 commit into
tektoncd:mainfrom
KMI1011:refactor/2097-break-gitea-test/SRVKP-12616
Open

chore: split gitea_test.go into focused files#2826
KMI1011 wants to merge 1 commit into
tektoncd:mainfrom
KMI1011:refactor/2097-break-gitea-test/SRVKP-12616

Conversation

@KMI1011

@KMI1011 KMI1011 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

rh-pre-commit.version: 2.4.0
rh-pre-commit.check-secrets: ENABLED

📝 Description of the Change

Refactor gitea_test.go by splitting the 1,511-line file into smaller, concern-focused files: status_test.go (creation/formatting) and repository_test.go (file retrieval, commit info, URL parsing).

🔗 Linked GitHub Issue

Fixes #2829

🧪 Testing Strategy

  • Unit tests
  • Integration tests
  • End-to-end tests
  • Manual testing
  • Not Applicable

🤖 AI Assistance

AI assistance can be used for various tasks, such as code generation,
documentation, or testing.

Please indicate whether you have used AI assistance
for this PR and provide details if applicable.

  • I have not used any AI assistance for this PR.
  • I have used AI assistance for this PR.

Important

Slop will be simply rejected, if you are using AI assistance you need to make sure you
understand the code generated and that it meets the project's standards. you
need at least know how to run the code and deploy it (if needed). See
startpaac to make it easy
to deploy and test your code changes.

If the majority of the code in this PR was generated by an AI, please add a Co-authored-by trailer to your commit message.
For example:

Co-authored-by: Claude noreply@anthropic.com

✅ Submitter Checklist

  • 📝 My commit messages are clear, informative, and follow the project's How to write a git commit message guide. The Gitlint linter ensures in CI it's properly validated
  • ✨ I have ensured my commit message prefix (e.g., fix:, feat:) matches the "Type of Change" I selected above.
  • ♽ I have run make test and make lint locally to check for and fix any
    issues. For an efficient workflow, I have considered installing
    pre-commit and running pre-commit install to
    automate these checks.
  • 📖 I have added or updated documentation for any user-facing changes.
  • 🧪 I have added sufficient unit tests for my code changes.
  • 🎁 I have added end-to-end tests where feasible. See README for more details.
  • 🔎 I have addressed any CI test flakiness or provided a clear reason to bypass it.
  • If adding a provider feature, I have filled in the following and updated the provider documentation:
    • GitHub App
    • GitHub Webhook
    • Gitea/Forgejo
    • GitLab
    • Bitbucket Cloud
    • Bitbucket Data Center

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

Copy link
Copy Markdown

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 refactors the Gitea provider tests by splitting the monolithic gitea_test.go file into smaller, logically grouped test files: repository_test.go and status_test.go. This change improves the maintainability and readability of the test suite. No review comments were provided, and there is no additional feedback.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@KMI1011

KMI1011 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

/ptal @zakisk

@theakshaypant theakshaypant left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @KMI1011 for picking this up!
While this is super helpful, the original (linked) issue was for splitting the e2e test file which is located here.

Nevertheless, this is great and will be reviewed in accordance to what it offers.

@KMI1011

KMI1011 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Sorry about that @theakshaypant . I had missed missed your reply to Andrew, thank you for the input!

@chmouel

chmouel commented Jul 2, 2026

Copy link
Copy Markdown
Member

Thanks, can you go over the checklist and make sure you follow them? for example you need proper commit message and proper PR description (and your pr and commit title has a typo)

@theakshaypant theakshaypant left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The original issue has been broken down into sub-issues to make the desired outcome less confusing. Please update the commit/PR to link to the appropriate task.

@KMI1011 KMI1011 changed the title refractor: split gitea_test.go into focused files chore: split gitea_test.go into focused files q Jul 3, 2026
@KMI1011 KMI1011 changed the title chore: split gitea_test.go into focused files q chore: split gitea_test.go into focused files Jul 3, 2026
rh-pre-commit.version: 2.4.0
rh-pre-commit.check-secrets: ENABLED
@zakisk zakisk force-pushed the refactor/2097-break-gitea-test/SRVKP-12616 branch from 30feadf to 37c2712 Compare July 8, 2026 11:51
@theakshaypant

Copy link
Copy Markdown
Member

/ok-to-test

@theakshaypant theakshaypant left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @KMI1011! LGTM

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.62%. Comparing base (2a84139) to head (37c2712).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2826   +/-   ##
=======================================
  Coverage   61.62%   61.62%           
=======================================
  Files         213      213           
  Lines       17512    17512           
=======================================
  Hits        10792    10792           
  Misses       5901     5901           
  Partials      819      819           
Flag Coverage Δ
unit-tests 61.62% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Break gitea unit tests into smaller files

4 participants