Skip to content

Conversation

@taimurhafeez
Copy link

To run it:
make e2e-serial E2E_GO_TEST_FLAGS="-v -run TestMustGatherImageWorksAsExpected"

Expected Output:

Must-gather content verification passed
--- PASS: TestMustGatherImageWorksAsExpected (129.04s)
PASS

Note: Must use PR-960

@openshift-ci-robot
Copy link
Collaborator

@taimurhafeez: This pull request references CMP-3846 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.21.0" version, but no target version was set.

Details

In response to this:

To run it:
make e2e-serial E2E_GO_TEST_FLAGS="-v -run TestMustGatherImageWorksAsExpected"

Expected Output:

Must-gather content verification passed
--- PASS: TestMustGatherImageWorksAsExpected (129.04s)
PASS

Note: Must use PR-960

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.

@openshift-ci
Copy link

openshift-ci bot commented Dec 8, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: taimurhafeez
Once this PR has been reviewed and has the lgtm label, please assign vincent056 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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
Copy link

openshift-ci bot commented Dec 8, 2025

Hi @taimurhafeez. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@taimurhafeez taimurhafeez changed the title CMP-3846: Added new test TestMustGatherImageWorksAsExpected to cover 75670 test from downstream CMP-3863: Added new test TestMustGatherImageWorksAsExpected to cover 75670 test from downstream Dec 8, 2025
@openshift-ci-robot
Copy link
Collaborator

@taimurhafeez: This pull request references CMP-3863 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.21.0" version, but no target version was set.

Details

In response to this:

To run it:
make e2e-serial E2E_GO_TEST_FLAGS="-v -run TestMustGatherImageWorksAsExpected"

Expected Output:

Must-gather content verification passed
--- PASS: TestMustGatherImageWorksAsExpected (129.04s)
PASS

Note: Must use PR-960

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.


// Wait for the ComplianceSuite scans to complete
log.Printf("Waiting for ComplianceSuite scans to complete...")
err = f.WaitForSuiteScansStatus(f.OperatorNamespace, scanSettingBindingName, compv1alpha1.PhaseDone, compv1alpha1.ResultNonCompliant)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Potential improvement here would be to consider implementing a backwards compatible change to WaitForSuiteScansStatus to accept a list of acceptable statues. That would allow us to say "wait for NonCompliant or Inconsistent - either are fine".

crdPath := fmt.Sprintf("%s/%s", complianceNamespaceDir, crd)
if _, err := os.Stat(crdPath); err == nil {
log.Printf("Found CRD directory: %s", crd)
foundCRD = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will only get set on the first occurrence, so if we have compliance scans but not a compliance suite, for example. Since we're using a binding, all three should certainly exist.

Comment on lines 2450 to 2490
if !foundCRD {
// Check if there are CRD directories at the parent level (timestampDir)
// The gather script collects CRDs across all namespaces at lines 8-20
log.Printf("Checking for CRD directories at the parent level...")
for _, crd := range complianceCRDs {
crdPath := fmt.Sprintf("%s/%s", timestampDir, crd)
if _, err := os.Stat(crdPath); err == nil {
log.Printf("Found CRD directory at parent level: %s", crd)
foundCRD = true
}
}
}

if !foundCRD {
// Check in other namespace directories (e.g., test namespace osdk-e2e-*)
// Scans may be created in the test namespace, not openshift-compliance
log.Printf("Checking for CRD directories in other namespace directories...")
timestampEntries, err := os.ReadDir(timestampDir)
if err == nil {
for _, entry := range timestampEntries {
if entry.IsDir() && entry.Name() != "openshift-compliance" && entry.Name() != "gather.logs" {
for _, crd := range complianceCRDs {
crdPath := fmt.Sprintf("%s/%s/%s", timestampDir, entry.Name(), crd)
if _, err := os.Stat(crdPath); err == nil {
log.Printf("Found CRD directory in %s: %s", entry.Name(), crd)
foundCRD = true
}
}
}
}
}
}

if !foundCRD {
// CRD directories are created by gather_compliance script at lines 8-20
// They may not exist if the script encounters errors or if CRDs are not found
// This is a warning but not a failure since core must-gather functionality works
t.Logf("WARNING: No compliance CRD directories found in any namespace")
t.Logf("This may indicate the gather script failed to collect CRD data - check gather.logs")
log.Printf("WARNING: No compliance CRD directories found, but core must-gather data was collected successfully")
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could these be consolidated into a single conditional?

Copy link
Collaborator

@rhmdnd rhmdnd left a comment

Choose a reason for hiding this comment

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

A few suggestions/questions inline.

})
if createErr != nil {
return fmt.Errorf("failed to create Machine Config Pool %s: %w", n, createErr)
//return fmt.Errorf("failed to create Machine Config Pool %s: %w", n, createErr)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove the comment, please

// Wait for the ComplianceSuite scans to complete
log.Printf("Waiting for ComplianceSuite scans to complete...")
err = f.WaitForSuiteScansStatus(f.OperatorNamespace, scanSettingBindingName, compv1alpha1.PhaseDone, compv1alpha1.ResultNonCompliant)
if err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nested if statements here. How about below if statements?

  suite := &compv1alpha1.ComplianceSuite{}
  if suite.Status.Result != compv1alpha1.ResultNonCompliant && suite.Status.Result != compv1alpha1.ResultInconsistent {
      t.Fatalf("Unexpected scan result: %v", suite.Status.Result)
  }

t.Fatalf("Scan did not complete successfully: %v", err)
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove the empty line, please

@openshift-ci
Copy link

openshift-ci bot commented Dec 11, 2025

@taimurhafeez: The following tests 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/unit f4f00af link true /test unit
ci/prow/verify f4f00af link true /test verify
ci/prow/go-build f4f00af link true /test go-build
ci/prow/images f4f00af link true /test images
ci/prow/e2e-aws-parallel f4f00af link true /test e2e-aws-parallel
ci/prow/e2e-aws-serial f4f00af link true /test e2e-aws-serial
ci/prow/e2e-rosa f4f00af link true /test e2e-rosa
ci/prow/e2e-aws-parallel-arm f4f00af link true /test e2e-aws-parallel-arm
ci/prow/e2e-aws-serial-arm f4f00af link true /test e2e-aws-serial-arm

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants