Skip to content

[release-tool] test coverage #10587

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

Merged
merged 7 commits into from
Jun 24, 2025

Conversation

radTuti
Copy link
Contributor

@radTuti radTuti commented Jun 21, 2025

Description

This add unit tests to a couple functions in the release tool.

Related issues/PRs

Todos

  • Tests
  • Documentation
  • Release note

Release Note

TBD

Reminder for the reviewer

Make sure that this PR has the correct labels and milestone set.

Every PR needs one docs-* label.

  • docs-pr-required: This change requires a change to the documentation that has not been completed yet.
  • docs-completed: This change has all necessary documentation completed.
  • docs-not-required: This change has no user-facing impact and requires no docs.

Every PR needs one release-note-* label.

  • release-note-required: This PR has user-facing changes. Most PRs should have this label.
  • release-note-not-required: This PR has no user-facing changes.

Other optional labels:

  • cherry-pick-candidate: This PR should be cherry-picked to an earlier release. For bug fixes only.
  • needs-operator-pr: This PR is related to install and requires a corresponding change to the operator.

@Copilot Copilot AI review requested due to automatic review settings June 21, 2025 00:07
@radTuti radTuti requested a review from a team as a code owner June 21, 2025 00:08
@marvin-tigera marvin-tigera added this to the Calico v3.31.0 milestone Jun 21, 2025
@radTuti radTuti added docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact labels Jun 21, 2025
Copy link
Contributor

@Copilot 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 enhances test coverage and refines underlying utility functions for the release tool. Key changes include:

  • Addition of unit tests for version determination, component formatting, release notes generation, and image scanning.
  • Improvements to error handling, logging, and file output in the image scanner, as well as refinements in CI configuration and Makefile targets.
  • Updates to the CI semaphore configuration and .gitignore to support the new test report artifacts.

Reviewed Changes

Copilot reviewed 15 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
release/internal/version/version_test.go Added multiple test cases for version stream and branching logic.
release/internal/registry/component_test.go Introduced tests for component string and init image generation.
release/internal/outputs/templates/release-note.md.gotmpl Adjusted template formatting for bug fixes and other changes.
release/internal/outputs/releasenotes_test.go Added approval tests to verify release notes output.
release/internal/imagescanner/scanner_test.go Expanded tests to cover various scanner configurations and HTTP responses.
release/internal/imagescanner/scanner.go Refined error handling and ensured proper resource cleanup on scan.
release/internal/ci/semaphore.go Updated URL building using url.JoinPath and improved promotion filtering logic.
release/Makefile Enhanced unit test target to generate JUnit reports and installed gotestsum.
release/.gitignore Added new ignore patterns for test reports and approval test artifacts.
go.mod Added dependency for go-approval-tests.
.semaphore/*.yml Updated CI configuration to publish unit-test reports.
Comments suppressed due to low confidence (1)

release/internal/ci/semaphore.go:39

  • The local variable 'url' shadows the imported package 'net/url'. Consider renaming the variable (e.g., promotionsURL) to avoid confusion.
	url, err := url.JoinPath(orgURL, "promotions")

- update variables names to be more explict
- fix grammar
@coutinhop coutinhop merged commit 3a317f5 into projectcalico:master Jun 24, 2025
2 of 3 checks passed
@radTuti radTuti mentioned this pull request Jun 26, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants