compliance-operator icon indicating copy to clipboard operation
compliance-operator copied to clipboard

CMP-3776: Enhance TestSingleTailoredScanSucceeds to cover 33398 logic

Open Anna-Koudelkova opened this issue 1 month ago • 4 comments

Downstream test case OCP-33398 enables and disables rules as well as set a variable value in a tailored profile. This PR aims to:

  • Add rule to disable in TailoredProfile - just for the sake of checking if disabled rule gets referred in CM
  • Set value of a variable in TailoredProfile
  • Add check to see if the ConfigMap contains the rules and value set in the TailoredProfile

make e2e-parallel E2E_CONTENT_IMAGE_PATH="quay.io/rh-ee-akoudelk/content_repo:testcontent" E2E_BROKEN_CONTENT_IMAGE_PATH="ghcr.io/complianceascode/test-broken-content-ocp" E2E_GO_TEST_FLAGS="-v -timeout 60m -run TestSingleTailoredScanSucceeds" was used on OCP 4.20 cluster to trigger this test case and it has passed when implementing also the changes in PR #960

=== RUN   TestSingleTailoredScanSucceeds
=== PAUSE TestSingleTailoredScanSucceeds
=== CONT  TestSingleTailoredScanSucceeds
2025/11/25 19:36:45 TailoredProfile ready (READY)
2025/11/25 19:36:50 Waiting for run of test-tailoredprofile-master compliancescan (LAUNCHING)
2025/11/25 19:36:55 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING)
2025/11/25 19:37:00 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING)
2025/11/25 19:37:05 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING)
2025/11/25 19:37:10 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING)
2025/11/25 19:37:15 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING)
2025/11/25 19:37:22 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING)
2025/11/25 19:37:25 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING)
2025/11/25 19:37:30 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING)
2025/11/25 19:37:35 Waiting for run of test-tailoredprofile-master compliancescan (AGGREGATING)
2025/11/25 19:37:40 Waiting for run of test-tailoredprofile-master compliancescan (AGGREGATING)
2025/11/25 19:37:45 Waiting for run of test-tailoredprofile-master compliancescan (AGGREGATING)
2025/11/25 19:37:50 ComplianceScan ready (DONE)
2025/11/25 19:37:56 ComplianceScan ready (DONE)
--- PASS: TestSingleTailoredScanSucceeds (76.68s)
PASS
...
ok  	github.com/ComplianceAsCode/compliance-operator/tests/e2e/parallel	228.963s

Anna-Koudelkova avatar Nov 24 '25 20:11 Anna-Koudelkova

@Anna-Koudelkova: This pull request references CMP-3776 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.

In response to this:

Downstream test case OCP-33398 enables and disables rules as well as set a variable value in a tailored profile. This PR aims to:

  • Add rule to disable in TailoredProfile
  • Set variable rule in TailoredProfile
  • Add check to see if the ConfigMap contains the rules and value set in the TailoredProfile

make e2e-parallel E2E_CONTENT_IMAGE_PATH="quay.io/rh-ee-akoudelk/content_repo:testcontent" E2E_BROKEN_CONTENT_IMAGE_PATH="ghcr.io/complianceascode/test-broken-content-ocp" E2E_GO_TEST_FLAGS="-v -timeout 60m -run TestSingleTailoredScanSucceeds" was used on OCP 4.20 cluster to trigger this test case and it has passed when implementing also the changes in PR #960

=== RUN   TestSingleTailoredScanSucceeds
=== PAUSE TestSingleTailoredScanSucceeds
=== CONT  TestSingleTailoredScanSucceeds
2025/11/24 20:35:08 TailoredProfile ready (READY)
2025/11/24 20:35:08 In the middle of checking configmap: test-tailoredprofile-tp configmap
2025/11/24 20:35:14 Waiting for run of test-tailoredprofile-master compliancescan (LAUNCHING)
2025/11/24 20:35:19 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING)
2025/11/24 20:35:24 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING)
2025/11/24 20:35:29 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING)
2025/11/24 20:35:34 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING)
2025/11/24 20:35:39 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING)
2025/11/24 20:35:44 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING)
2025/11/24 20:35:49 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING)
2025/11/24 20:35:54 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING)
2025/11/24 20:35:59 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING)
2025/11/24 20:36:04 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING)
2025/11/24 20:36:09 Waiting for run of test-tailoredprofile-master compliancescan (AGGREGATING)
2025/11/24 20:36:14 ComplianceScan ready (DONE)
2025/11/24 20:36:19 ComplianceScan ready (DONE)
--- PASS: TestSingleTailoredScanSucceeds (77.63s)
PASS
...
ok  	github.com/ComplianceAsCode/compliance-operator/tests/e2e/parallel	350.232s

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-robot avatar Nov 24 '25 20:11 openshift-ci-robot

Hi @Anna-Koudelkova. 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.

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.

openshift-ci[bot] avatar Nov 24 '25 20:11 openshift-ci[bot]

/ok-to-test

xiaojiey avatar Nov 26 '25 09:11 xiaojiey

tested on 4.20 and it seems working: === RUN TestSingleTailoredScanSucceeds === PAUSE TestSingleTailoredScanSucceeds === CONT TestSingleTailoredScanSucceeds 2025/11/26 15:57:41 TailoredProfile ready (READY) 2025/11/26 15:57:46 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING) 2025/11/26 15:57:51 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING) 2025/11/26 15:57:56 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING) 2025/11/26 15:58:01 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING) 2025/11/26 15:58:06 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING) 2025/11/26 15:58:11 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING) 2025/11/26 15:58:16 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING) 2025/11/26 15:58:21 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING) 2025/11/26 15:58:26 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING) 2025/11/26 15:58:31 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING) 2025/11/26 15:58:36 Waiting for run of test-tailoredprofile-master compliancescan (RUNNING) 2025/11/26 15:58:41 Waiting for run of test-tailoredprofile-master compliancescan (AGGREGATING) 2025/11/26 15:58:46 Waiting for run of test-tailoredprofile-master compliancescan (AGGREGATING) 2025/11/26 15:58:51 Waiting for run of test-tailoredprofile-master compliancescan (AGGREGATING) 2025/11/26 15:58:56 Waiting for run of test-tailoredprofile-master compliancescan (AGGREGATING) 2025/11/26 15:59:01 ComplianceScan ready (DONE) 2025/11/26 15:59:06 ComplianceScan ready (DONE) --- PASS: TestSingleTailoredScanSucceeds (90.92s) PASS

taimurhafeez avatar Nov 27 '25 11:11 taimurhafeez

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Anna-Koudelkova, rhmdnd

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

The pull request process is described here

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[bot] avatar Dec 01 '25 22:12 openshift-ci[bot]