Skip to content

fix: Increase log line count for tests#2445

Merged
zakisk merged 2 commits intotektoncd:mainfrom
chmouel:more-tests-madness
Feb 4, 2026
Merged

fix: Increase log line count for tests#2445
zakisk merged 2 commits intotektoncd:mainfrom
chmouel:more-tests-madness

Conversation

@chmouel
Copy link
Copy Markdown
Member

@chmouel chmouel commented Feb 3, 2026

This pull request introduces improvements to E2E test naming enforcement, updates CI workflow configuration, and increases log line checks in tests for better diagnostics. The changes ensure that E2E tests follow a strict naming convention for proper CI partitioning, update how secrets and variables are set in the CI workflow, and improve test reliability by allowing more log lines to be checked for expected output.

E2E Test Naming Enforcement:

  • Added a new script hack/check-e2e-test-naming.sh and integrated it into the lint target in the Makefile to enforce that all E2E test functions follow specific naming conventions. This helps ensure tests are correctly partitioned into CI jobs. [1] [2]
  • Renamed several test functions in test/invalid_event_test.go, test/repo_validation_test.go, and test/repository_webhook_test.go to use the TestOthers* prefix for compliance with the new naming convention. [1] [2] [3] [4] [5]
  • Updated the hack/gh-workflow-ci.sh script to include Others-prefixed tests in the github_second_controller job.

CI Workflow Configuration Updates:

  • Fixed and reordered environment variable assignments in .github/workflows/e2e.yaml to ensure secrets and variables are set correctly for Bitbucket and GitHub E2E tests. [1] [2]

👨🏻‍ Linked Jira

🔗 Linked GitHub Issue

Fixes #

🚀 Type of Change

  • 🐛 Bug fix (fix:)
  • ✨ New feature (feat:)
  • 💥 Breaking change (feat!:, fix!:)
  • 📚 Documentation update (docs:)
  • ⚙️ Chore (chore:)
  • 💅 Refactor (refactor:)
  • 🔧 Enhancement (enhance:)
  • 📦 Dependency update (deps:)

🧪 Testing Strategy

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

🤖 AI Assistance

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

If you have used AI assistance, please provide the following details:

Which LLM was used?

  • GitHub Copilot
  • ChatGPT (OpenAI)
  • Claude (Anthropic)
  • Cursor
  • Gemini (Google)
  • Other: ____________

Extent of AI Assistance:

  • Documentation and research only
  • Unit tests or E2E tests only
  • Code generation (parts of the code)
  • Full code generation (most of the PR)
  • PR description and comments
  • Commit message(s)

Important

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: Gemini gemini@google.com
Co-authored-by: ChatGPT noreply@chatgpt.com
Co-authored-by: Claude noreply@anthropic.com
Co-authored-by: Cursor noreply@cursor.com
Co-authored-by: Copilot Copilot@users.noreply.github.com

**💡You can use the script ./hack/add-llm-coauthor.sh to automatically add
these co-author trailers to your commits.

✅ 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

Increased the maximum number of log lines to check in various test
cases. This change was made to accommodate potentially longer log
outputs during test execution, preventing false negatives due to
insufficient log history being examined.

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
Introduced a new script, `hack/check-e2e-test-naming.sh`, to enforce a
naming convention for end-to-end tests. This script validates that test
function names start with specific prefixes (e.g., `TestGithub*`,
`TestGitlab*`) or include "Concurrency" to ensure they can be correctly
categorized and executed by CI jobs.

The Makefile was updated to include this new linting step, and the
GitHub Actions workflow configuration (`.github/workflows/e2e.yaml`) was
adjusted to correctly pass necessary secrets and variables for testing
against Bitbucket Cloud and GitHub. A minor adjustment was also made to
the `github_second_controller` test selection in
`hack/gh-workflow-ci.sh` to include "Others" tests.

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
Copilot AI review requested due to automatic review settings February 3, 2026 19:14
@pipelines-as-code
Copy link
Copy Markdown

🔍 PR Lint Feedback

Note: This automated check helps ensure your PR follows our contribution guidelines.

⚠️ Items that need attention:

🎫 Jira reference

Add a Jira reference in the description using one of the following formats:

  • https://issues.redhat.com/browse/SRVKP-<number>

If no SRVKP ticket exists yet, link a GitHub issue instead (e.g., Fixes #123).
Minor housekeeping PRs without Jira coverage can skip this after confirming with reviewers.


🤖 AI attribution

The following commits lack an explicit AI attribution footer:

  • 7b76886 fix: Increase log line count for tests
  • 3557f54 feat: check E2E test naming convention with linter

If no AI assistance was used for a commit, you can ignore this warning.
Otherwise add an Assisted-by: or Co-authored-by: footer referencing the AI used.


ℹ️ Next Steps

  • Review and address the items above
  • Push new commits to update this PR
  • This comment will be automatically updated when issues are resolved
🔧 Admin Tools (click to expand)

Automated Issue/Ticket Creation:

  • /issue-create - Generate a GitHub issue from this PR content using AI
  • /jira-create - Create a SRVKP Jira ticket from this PR content using AI

⚠️ Important: Always review and edit generated content before finalizing tickets/issues.
The AI-generated content should be used as a starting point and may need adjustments.

These commands are available to maintainers and will post the generated content as PR comments for review.

🤖 This feedback was generated automatically by the PR CI system

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @chmouel, 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 robustness and maintainability of the project's end-to-end testing suite. It improves the diagnostic capabilities of tests by expanding the log data available for analysis and introduces a structured approach to E2E test organization through a new naming convention and automated validation. These changes streamline the testing process and facilitate easier identification and resolution of issues.

Highlights

  • E2E Test Log Visibility: Increased the maximum number of log lines fetched for controller logs in various end-to-end tests from previous values (e.g., 20, 50, 100) to 1000. This change improves debugging capabilities by providing more extensive log context during test failures.
  • E2E Test Naming Convention Enforcement: Introduced a new linting rule and a corresponding shell script (hack/check-e2e-test-naming.sh) to validate that all E2E test functions adhere to a predefined naming convention. This ensures tests can be properly partitioned into CI jobs.
  • Test Renaming for Convention Compliance: Several E2E tests in test/invalid_event_test.go, test/repo_validation_test.go, and test/repository_webhook_test.go have been renamed to include the TestOthers prefix, aligning them with the newly enforced naming conventions.
  • CI Workflow Update for Test Categories: The CI workflow script (hack/gh-workflow-ci.sh) has been updated to correctly include tests prefixed with TestOthers in the github_second_controller job, ensuring these newly categorized tests are executed.
Changelog
  • Makefile
    • Added a new lint-e2e-naming target to check E2E test naming conventions.
    • Integrated lint-e2e-naming into the main lint command.
  • hack/check-e2e-test-naming.sh
    • Added a new script to validate E2E test function names, ensuring they follow TestGithub*, TestGitea*, TestGitlab*, TestBitbucket*, TestOthers* prefixes or contain Concurrency.
  • hack/gh-workflow-ci.sh
    • Modified the github_second_controller test group to include tests prefixed with TestOthers.
  • test/gitea_test.go
    • Increased maxLines parameter from 100 to 1000 in TestGiteaPullRequestPrivateRepository.
    • Increased maxLines parameter from 20 to 1000 in TestGiteaBadYamlValidation.
    • Increased maxLines parameter from 20 to 1000 in TestGiteaBadLinkOfTask.
    • Increased maxLines parameter from 20 to 1000 in TestGiteaPipelineRunWithSameName.
  • test/github_pullrequest_privaterepository_test.go
    • Increased maxLines parameter from 50 to 1000 in TestGithubPullRequestGitClone.
  • test/github_pullrequest_test.go
    • Increased maxLines parameter from 100 to 1000 in TestGithubPullandPushMatchTriggerOnlyPull.
    • Increased maxLines parameter from 100 to 1000 in TestGithubIgnoreTagPushCommitsFromSkipPushEventsSetting.
  • test/github_push_retest_test.go
    • Increased numLines parameter from 20 to 1000 in TestGithubPushRequestGitOpsCommentCancel.
  • test/github_skip_ci_test.go
    • Increased numLines parameter from 100 to 1000 in verifySkipCI.
    • Increased numLines parameter from 100 to 1000 in TestGithubSkipCITestCommand.
  • test/gitlab_delete_tag_event_test.go
    • Increased logLinesToCheck parameter from 100 to 1000 in TestGitlabDeleteTagEvent.
  • test/invalid_event_test.go
    • Renamed TestUnsupportedEvent to TestOthersUnsupportedEvent.
    • Renamed TestSkippedEvent to TestOthersSkippedEvent.
    • Renamed TestGETCall to TestOthersGETCall.
  • test/repo_validation_test.go
    • Renamed TestRepoValidation to TestOthersRepoValidation.
  • test/repository_webhook_test.go
    • Renamed TestRepositoryCreation to TestOthersRepositoryCreation.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/e2e.yaml
Activity
  • The pull request description uses a standard template and does not contain specific activity details beyond the initial submission.
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
Copy Markdown

@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 addresses test flakiness by increasing the number of log lines scanned in several E2E tests. It also introduces a new linting script to enforce a naming convention for E2E tests and refactors existing test names to comply. This is a great step towards better test organization.

My review includes a suggestion to improve the new bash script for better performance and readability. I've also pointed out an opportunity to replace the hardcoded log line count with a shared constant to improve maintainability across the test suite, aligning with the guideline to define magic numbers as constants. The PR title could also be updated to reflect the addition of the test naming linter, as it's a significant part of the changes.

Comment on lines +26 to +32
orphaned_tests=()
while IFS= read -r test; do
[[ -z "${test}" ]] && continue
if ! echo "${test}" | grep -qE "${valid_pattern}"; then
orphaned_tests+=("${test}")
fi
done <<< "${all_tests}"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The while loop to find orphaned tests can be made more efficient and concise. Instead of iterating through each test and running grep in a loop, you can use grep -v to filter out all valid tests at once and populate the orphaned_tests array directly using mapfile.

Suggested change
orphaned_tests=()
while IFS= read -r test; do
[[ -z "${test}" ]] && continue
if ! echo "${test}" | grep -qE "${valid_pattern}"; then
orphaned_tests+=("${test}")
fi
done <<< "${all_tests}"
mapfile -t orphaned_tests < <(echo "${all_tests}" | grep -vE -- "${valid_pattern}" | grep -v '^$')

defer f()
reg := regexp.MustCompile(".*successfully fetched git-clone task from default configured catalog Hub")
maxLines := int64(100)
maxLines := int64(1000)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The magic number 1000 for the maximum log lines is now used in many test files. To improve maintainability and ensure consistency, consider defining a shared constant for this value (e.g., in the test/pkg/wait package). This would also be a good opportunity to standardize the variable name, which currently varies (e.g., maxLines, numLines, logLinesToCheck) across different tests.

References
  1. Magic numbers should be defined as constants for better readability and maintainability.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR increases the log line count parameter in E2E tests from various values (20, 50, 100) to a standardized 1000 lines, and introduces a naming convention enforcement mechanism for test functions to ensure proper CI job partitioning.

Changes:

  • Standardized log line counts to 1000 across multiple E2E tests to prevent test failures due to insufficient log inspection
  • Renamed five test functions to use the "TestOthers" prefix for proper CI job routing
  • Added a linting script to enforce E2E test naming conventions
  • Updated CI configuration to route "Others"-prefixed tests appropriately

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/gitlab_delete_tag_event_test.go Increased log line count from 100 to 1000
test/github_skip_ci_test.go Increased log line count from 100 to 1000 in two locations
test/github_push_retest_test.go Increased log line count from 20 to 1000
test/github_pullrequest_test.go Increased log line count from 100 to 1000 in two locations
test/github_pullrequest_privaterepository_test.go Increased log line count from 50 to 1000
test/gitea_test.go Increased log line count to 1000 in four locations (from 20 and 100)
test/repository_webhook_test.go Renamed test function to TestOthersRepositoryCreation
test/repo_validation_test.go Renamed test function to TestOthersRepoValidation
test/invalid_event_test.go Renamed three test functions with TestOthers prefix
hack/check-e2e-test-naming.sh Added new linting script to validate E2E test naming conventions
hack/gh-workflow-ci.sh Updated to route "Others"-prefixed tests to github_second_controller job
Makefile Integrated e2e naming lint check into the main lint target
.github/workflows/e2e.yaml Alphabetically reordered environment variables for consistency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zakisk zakisk merged commit aea8830 into tektoncd:main Feb 4, 2026
25 of 27 checks passed
@chmouel chmouel deleted the more-tests-madness branch February 4, 2026 09:31
@chmouel chmouel restored the more-tests-madness branch February 19, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants