Skip to content
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

✨ Add e2e test for inventory-api #1216

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

yanmxa
Copy link
Member

@yanmxa yanmxa commented Nov 12, 2024

Summary

  1. Kraft Compatibility: Installation error fixed in this PR: 🐛 The Kafka cluster enabled the KRaft should not validate the zookeeper  #1232, visit the discussion https://github.com/orgs/strimzi/discussions/10836 for more detail
  2. Inventory API Accession: Improve Event Consumption by Exposing Internal Event API Externally project-kessel/inventory-api#243
  3. Inventory data conflicts: Align Resource ID Definitions Between Eventing API and Inventory API project-kessel/inventory-api#244
  4. The defined kafka event is different from the eventing API(the relationship_data is not exist)!
  5. The kafka deletion event of the relationship is not different from the definition of the Kafka event.
    Relationship example:
  • Create
Context Attributes,
  specversion: 1.0
  type: redhat.inventory.resources_relationship.k8s-policy_ispropagatedto_k8s-cluster.created
  source: https:
  subject: /resources_relationship/k8s-policy_ispropagatedto_k8s-cluster/policy-id-24546
  id: 4153de06-a366-11ef-8785-8a12bc3224a5
  time: 2024-11-15T15:28:24.975603472Z
  datacontenttype: application/json
Data,
  {
    "metadata": {
      "id": 12,
      "last_reported": "2024-11-15T15:28:24.975603472Z",
      "relationship_type": "k8s-policy_ispropagatedto_k8s-cluster"
    },
    "reporter_data": {
      "reporter_instance_id": "guest",
      "reporter_type": "ACM",
      "last_reported": "2024-11-15T15:28:24.976340254Z",
      "subject_local_resource_id": "policy-id-24546",
      "object_local_resource_id": "cluster-id-51474",
      "reporter_version": "2.12"
    },
    "relationship_data": {
      "status": "VIOLATIONS",
      "k8s_policy_id": 0,
      "k8s_cluster_id": 0
    }
  }
  • Update
Context Attributes,
  specversion: 1.0
  type: redhat.inventory.resources_relationship.k8s-policy_ispropagatedto_k8s-cluster.updated
  source: https:
  subject: /resources_relationship/k8s-policy_ispropagatedto_k8s-cluster/policy-id-24546
  id: 43b6eeba-a366-11ef-8785-8a12bc3224a5
  time: 2024-11-15T15:28:28.982812429Z
  datacontenttype: application/json
Data,
  {
    "metadata": {
      "id": 0,
      "last_reported": "2024-11-15T15:28:28.982812429Z",
      "relationship_type": "k8s-policy_ispropagatedto_k8s-cluster"
    },
    "reporter_data": {
      "reporter_instance_id": "guest",
      "reporter_type": "ACM",
      "last_reported": "2024-11-15T15:28:28.982812429Z",
      "subject_local_resource_id": "policy-id-24546",
      "object_local_resource_id": "cluster-id-51474",
      "reporter_version": "2.12"
    },
    "relationship_data": {
      "status": "NO_VIOLATIONS",
      "k8s_policy_id": 0,
      "k8s_cluster_id": 0
    }
  }
  • Delete
Context Attributes,
  specversion: 1.0
  type: redhat.inventory.resources_relationship.k8s-policy_ispropagatedto_k8s-cluster.deleted
  source: https:
  subject: /resources_relationship/k8s-policy_ispropagatedto_k8s-cluster/cluster-id-51474_policy-id-24546
  id: 444fd42d-a366-11ef-8785-8a12bc3224a5
  time: 2024-11-15T15:28:29.984868624Z
  datacontenttype: application/json
Data,
  {
    "metadata": {
      "id": 0,
      "last_reported": "0001-01-01T00:00:00Z",
      "relationship_type": ""
    },
    "reporter_data": {
      "reporter_instance_id": "guest",
      "reporter_type": "",
      "last_reported": "0001-01-01T00:00:00Z",
      "subject_local_resource_id": "local-id",
      "object_local_resource_id": "local-id",
      "reporter_version": "1.0"
    }
  }

Related issue(s)

Fixes # https://issues.redhat.com/browse/ACM-15034

Tests

  • Unit/function tests have been added and incorporated into make unit-tests.
  • Integration tests have been added and incorporated into make integration-test.
  • E2E tests have been added and incorporated into make e2e-test-all.
  • List other manual tests you have done.

Copy link

openshift-ci bot commented Nov 12, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yanmxa

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

Signed-off-by: myan <[email protected]>

fix the test

Signed-off-by: myan <[email protected]>

fix it

Signed-off-by: myan <[email protected]>

fix the it

Signed-off-by: myan <[email protected]>

fix the panic

Signed-off-by: myan <[email protected]>

fix it

Signed-off-by: myan <[email protected]>

inventory e2e

Signed-off-by: myan <[email protected]>

resolve the conflict of it

Signed-off-by: myan <[email protected]>

config dir

Signed-off-by: myan <[email protected]>

invenotry cert

Signed-off-by: myan <[email protected]>
Signed-off-by: myan <[email protected]>
Signed-off-by: myan <[email protected]>
Signed-off-by: myan <[email protected]>
Signed-off-by: myan <[email protected]>
Copy link

sonarcloud bot commented Nov 15, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
31.8% Coverage on New Code (required ≥ 70%)

See analysis details on SonarQube Cloud

Copy link

openshift-ci bot commented Nov 15, 2024

@yanmxa: 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/sonarcloud 0d2813b link true /test sonarcloud
ci/prow/test-e2e 0d2813b link true /test test-e2e

Full PR test history. Your PR dashboard.

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.

2 participants