Skip to content

NPD needs an integration test tier that contributors can run locally #1331

Description

@DigitalVeer

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.sig/nodeCategorizes an issue or PR as relevant to SIG Node.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions