Skip to content

OCPBUGS-85436: Make random test assertions format-based instead of value-based - #588

Open
kunalmemane wants to merge 1 commit into
openshift:release-5.0from
kunalmemane:randseend-5.0
Open

kunalmemane wants to merge 1 commit into
openshift:release-5.0from
kunalmemane:randseend-5.0

Conversation

@kunalmemane

Copy link
Copy Markdown
Member

Test improvements
rewrote TestRandomBuildTag, TestRandomBuildTagNoDupes, and TestContainerName to use format/structure assertions instead of hardcoded random values.

What does this pull request do?
Update pkg/build/builder/common_test.go so TestRandomBuildTag and TestContainerName validate the required name structure and 8-character lowercase hexadecimal suffix instead of relying on the old global math/rand.Seed sequence. Production code is unchanged.

Why is this needed?
Go 1.24 and later no longer make the deprecated top-level rand.Seed deterministic by default. The release-5.0 unit job failed because these tests expected the old fixed suffix f1f85ff5.

Validation

  • Tagged make test passed for all packages in a disposable Fedora 42 container.
  • make verify passed, including gofmt and import checks.
  • git diff --check passed.
  • The final diff contains only pkg/build/builder/common_test.go.

Failure reproduced by: release-5.0 unit job.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification

This PR uses the pipeline controller for second-stage tests. Selection and triggering follow the repository configuration.

Use /test ? to list jobs and /pipeline help for commands.

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Nov 27, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@kunalmemane: This pull request references Jira Issue OCPBUGS-85436, which is valid.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.z) matches configured target version for branch (5.0.z)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note type set to "Release Note Not Required"
  • dependent bug Jira Issue OCPBUGS-148070 is in the state Closed (Done), which is one of the valid states (VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA))
  • dependent Jira Issue OCPBUGS-148070 targets the "5.1.0" version, which is one of the valid target versions: 5.1.0
  • bug has dependents

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Test improvements
rewrote TestRandomBuildTag, TestRandomBuildTagNoDupes, and TestContainerName to use format/structure assertions instead of hardcoded random values.

What does this pull request do?
Update pkg/build/builder/common_test.go so TestRandomBuildTag and TestContainerName validate the required name structure and 8-character lowercase hexadecimal suffix instead of relying on the old global math/rand.Seed sequence. Production code is unchanged.

Why is this needed?
Go 1.24 and later no longer make the deprecated top-level rand.Seed deterministic by default. The release-5.0 unit job failed because these tests expected the old fixed suffix f1f85ff5.

Validation

  • Tagged make test passed for all packages in a disposable Fedora 42 container.
  • make verify passed, including gofmt and import checks.
  • git diff --check passed.
  • The final diff contains only pkg/build/builder/common_test.go.

Failure reproduced by: release-5.0 unit job.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML; Path: .coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 25b5ce3b-d94b-4b25-9531-f4b7ec00c257

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

@prabhapa

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Nov 27, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-ovn
/test e2e-aws-ovn-builds
/test e2e-aws-ovn-image-ecosystem

@openshift-ci

openshift-ci Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: prabhapa

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 27, 2026
@prabhapa

Copy link
Copy Markdown
Contributor

/test e2e-aws-ovn-builds

2 similar comments
@prabhapa

Copy link
Copy Markdown
Contributor

/test e2e-aws-ovn-builds

@kunalmemane

Copy link
Copy Markdown
Member Author

/test e2e-aws-ovn-builds

@openshift-ci

openshift-ci Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

@kunalmemane: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/security f85a360 link false /test security

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants