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

RHCLOUD-35836 - Kessel E2E testing setup + Increase test coverage #258

Merged
merged 5 commits into from
Nov 29, 2024

Conversation

Adam0Brien
Copy link
Contributor

PR Template:

Describe your changes

  • E2E test deploy
    • Testing suite now includes relations-api and spicedb as part of the setup
    • Folder structure for kind setup can be found under deploy/kind
  • Test suite has been changed
    • Expanded tests in inventory_http_tests.go to include update/delete's and relationships
    • Changes have been made to kafkaconsumer_test.go because of errors found during testing (unknown topic or partition error)
  • GH workflow for e2e tests has been changed to check the status of tests and return the logs

Ticket reference (if applicable)

Fixes #RHCLOUD-35836

Checklist

  • Are the agreed upon acceptance criteria fulfilled?

  • Was the 4-eye-principle applied? (async PR review, pairing, ensembling)

  • Do your changes have passing automated tests and sufficient observability?

  • Are the work steps you introduced repeatable by others, either through automation or documentation?

    • If automation is possible but not done due to other constraints, a ticket to the tech debt sprint is added
    • An SOP (Standard Operating Procedure) was created
  • The Changes were automatically built, tested, and - if needed, behind a feature flag - deployed to our production environment. (Please check this when the new deployment is done and you could verify it.)

  • Are the agreed upon coding/architectural practices applied?

  • Are security needs fullfilled? (e.g. no internal URL)

  • Is the corresponding Ticket in the right state? (should be on "review" now, put to done when this change made it to production)

  • For changes to the public API / code dependencies: Was the whole team (or a sufficient amount of ppl) able to review?

@tonytheleg
Copy link
Contributor

Appears to be working on my system just fine!

$ kc get pods
NAME                                        READY   STATUS      RESTARTS   AGE
e2e-inventory-http-tests-gwhxr              0/1     Completed   0          27s
invdatabase-75f6cc55bc-45lbw                1/1     Running     0          2m4s
kessel-inventory-7dc5b568bb-24jkp           1/1     Running     0          2m4s
my-cluster-kafka-0                          1/1     Running     0          69s
my-cluster-kafka-1                          1/1     Running     0          69s
my-cluster-kafka-2                          1/1     Running     0          69s
my-cluster-zookeeper-0                      1/1     Running     0          104s
my-cluster-zookeeper-1                      1/1     Running     0          104s
my-cluster-zookeeper-2                      1/1     Running     0          104s
postgres-7f4f855598-xcj2x                   1/1     Running     0          2m1s
relationships-7f9656ff68-7pc7b              1/1     Running     0          118s
spicedb-cr-spicedb-7849b95878-wkspw         1/1     Running     0          83s
spicedb-operator-7d9c5c5c7d-mbrx2           1/1     Running     0          2m1s
strimzi-cluster-operator-6f9fbb4c75-pb582   1/1     Running     0          2m4s
[anatale@fedora-csb inventory-api]$ kc logs e2e-inventory-http-tests-gwhxr
Defaulted container "e2e-http-tests" out of: e2e-http-tests, wait-for-inventory (init)
INFO msg=TLS environment variables not set
=== RUN   TestInventoryAPIHTTP_Livez
=== PAUSE TestInventoryAPIHTTP_Livez
=== RUN   TestInventoryAPIHTTP_Readyz
=== PAUSE TestInventoryAPIHTTP_Readyz
=== RUN   TestInventoryAPIHTTP_Metrics
--- PASS: TestInventoryAPIHTTP_Metrics (0.00s)
=== RUN   TestInventoryAPIHTTP_RHELHostLifecycle
=== PAUSE TestInventoryAPIHTTP_RHELHostLifecycle
=== RUN   TestInventoryAPIHTTP_K8SClusterLifecycle
=== PAUSE TestInventoryAPIHTTP_K8SClusterLifecycle
=== RUN   TestInventoryAPIHTTP_K8SPolicyLifecycle
=== PAUSE TestInventoryAPIHTTP_K8SPolicyLifecycle
=== RUN   TestInventoryAPIHTTP_K8SPolicy_is_propagated_to_K8sClusterLifecycle
=== PAUSE TestInventoryAPIHTTP_K8SPolicy_is_propagated_to_K8sClusterLifecycle
=== RUN   Test_ACMKafkaConsumer
=== PAUSE Test_ACMKafkaConsumer
=== CONT  TestInventoryAPIHTTP_Livez
=== CONT  TestInventoryAPIHTTP_RHELHostLifecycle
=== CONT  TestInventoryAPIHTTP_K8SPolicyLifecycle
=== CONT  TestInventoryAPIHTTP_K8SClusterLifecycle
=== CONT  TestInventoryAPIHTTP_Readyz
=== CONT  TestInventoryAPIHTTP_K8SPolicy_is_propagated_to_K8sClusterLifecycle
=== CONT  Test_ACMKafkaConsumer
--- PASS: TestInventoryAPIHTTP_Livez (0.00s)
--- PASS: TestInventoryAPIHTTP_Readyz (0.00s)
--- PASS: TestInventoryAPIHTTP_K8SPolicy_is_propagated_to_K8sClusterLifecycle (0.16s)
--- PASS: TestInventoryAPIHTTP_RHELHostLifecycle (0.26s)
--- PASS: TestInventoryAPIHTTP_K8SClusterLifecycle (0.27s)
--- PASS: TestInventoryAPIHTTP_K8SPolicyLifecycle (0.29s)
% Message on kessel-inventory[0]@0:
{"specversion":"1.0","id":"1e974521-ac24-11ef-ae2e-c67b6670d6d5","source":"http://localhost:8000","type":"redhat.inventory.resources.rhel_host.created","subject":"/resources/rhel_host/00000000-0000-0000-0000-000000000000","datacontenttype":"application/json","time":"2024-11-26T18:27:40.380475782Z","data":{"metadata":{"id":"00000000-0000-0000-0000-000000000000","resource_type":"rhel_host","org_id":"","created_at":"2024-11-26T18:27:40.380475782Z","workspace_id":"workspace"},"reporter_data":{"reporter_instance_id":"Go-http-client/1.1","reporter_type":"ACM","console_href":"www.example.com","api_href":"www.example.com","local_resource_id":"0123","reporter_version":"0.1"}}}
% Headers: [content-type="application/cloudevents+json"]
The message is valid!
=== NAME  Test_ACMKafkaConsumer
    kafkaconsumer_test.go:230: Schema validation passed
--- PASS: Test_ACMKafkaConsumer (5.65s)
PASS

@Adam0Brien Adam0Brien marked this pull request as ready for review November 27, 2024 10:43
@akoserwal akoserwal merged commit edd8f22 into project-kessel:main Nov 29, 2024
10 checks passed
Adam0Brien added a commit to Adam0Brien/inventory-api that referenced this pull request Nov 29, 2024
…oject-kessel#258)

* RHCLOUD-35836 - Add Update checks for e2e tests

* relations/spicedb/inventory setup for e2e testing

* only try tests once

* wait after pods are ready

* remove duplicate variable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants