NPD needs an integration test tier that contributors can run locally

Đang mở
#1,331 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
gcp, go, kubernetes
Lĩnh vực
devops, testing-qa

Hướng nghiên cứu

Bắt đầu với entry point hiện có make e2e-test và lần theo các yêu cầu về GCP, image, zone và SSH key của nó. Đọc cách --apiserver-override được xử lý, sau đó lập kế hoạch cho các bài kiểm thử ở cấp độ process bằng các tệp log cố định và một fake apiserver, tiếp theo là coverage bằng KIND cho vòng đời của DaemonSet và các chuyển đổi của NodeCondition. Được xem là hoàn tất khi cả hai tầng đều chạy được cục bộ và assert các event, condition và cleanup đã mô tả.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

kind/cleanup lifecycle/stale sig/node

We should add a test tier between unit tests and the GCE suite that can be run locally.


NPD currently has two test tiers:

  1. Unit tests
  2. GCE e2e tests (Prow)

The e2e suite today only asserts against a local metrics endpoint on a GCE VM; yet, we cannot easily run the same functionality locally. This is because make e2e-test requires a GCP project, a zone, an image, and SSH keys. Not all important behaviors are unit-testable, and having the ability to run e2e tests locally will help author better improvements to NPD.

We should have two additional forms of testing to enable local e2e testing:

Form What it covers Sketch
Process-level log parsing through condition/event run NPD against fixed log files and assert emitted events against a local fake apiserver ( via --apiserver-override)
KIND DaemonSet lifecycle, NodeCondition transitions run NPD as a DaemonSet in a KIND cluster and inject faults, assert conditions and cleanup on shutdown

This pattern is the standard in other Kubernetes repositories. Kubernetes has an integration test tier and only merges PRs when unit, integration, and e2e tests all pass (https://github.com/kubernetes/community/blob/master/contributors/devel/sig-testing/testing.md). Furthermore, cert-manager and cilium run KIND-based e2e locally as well.

Together with #1328, this allows extensive coverage of NPD behavior before reaching a VM.

/sig node
/kind cleanup

Ngôn ngữ chính
Go
Star
3.5k
Fork
703
Merge trung bình
1 ngày 49 phút
Pull request đã merge (30 ngày)
23

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của kubernetes/node-problem-detector

Tất cả issue của kubernetes/node-problem-detector

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.