# E2E Testing Best Practices, Reloaded

DevFeed: [E2E Testing Best Practices, Reloaded](<https://devfeed.tech/articles/e2e-testing-best-practices-reloaded-17560.md>)

Original publisher: [Read original article](<https://www.kubernetes.dev/blog/2023/04/12/e2e-testing-best-practices-reloaded/>)

Author: The Kubernetes Authors

Published: 2023-04-12T00:00:00Z

Content type: article

Language: en

Sources: [Kubernetes Contributors Blog](<https://devfeed.tech/sources/kubernetes-contributors-blog.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [Kubernetes](<https://devfeed.tech/topics/kubernetes.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [architecture](<https://devfeed.tech/tags/architecture.md>), [best-practices](<https://devfeed.tech/tags/best-practices.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [e2e-testing](<https://devfeed.tech/tags/e2e-testing.md>), [kubernetes](<https://devfeed.tech/tags/kubernetes.md>), [migration](<https://devfeed.tech/tags/migration.md>), [technical](<https://devfeed.tech/tags/technical.md>), [testing](<https://devfeed.tech/tags/testing.md>)

## AI overview

This Kubernetes blog post summarizes cleanup and refactoring of the project's end-to-end testing framework after its migration to Ginkgo v2 in Kubernetes 1.25. It describes goals for reducing internal-code dependencies, organizing sub-packages, and improving test failure messages.

## Source excerpt

End-to-end (E2E) testing in Kubernetes is how the project validates functionality with real clusters. Contributors sooner or later encounter it when asked to write E2E tests for new features or to help with debugging test failures. Cluster admins or vendors might run the conformance tests, a subset of all tests in the E2E test suite . The underlying E2E framework for writing these E2E tests has been around for a long time. Functionality was added to it as needed, leading to code that became hard to maintain and use. The testing commons WG started cleaning it up, but dissolved before completely achieving their goals. After the migration to Gingko v2 in Kubernetes 1.25, I picked up several of the loose ends and started untangling them. This blog post is a summary of those changes. Some of this content is also found in the Kubernetes contributor document about writing good E2E tests and gets reproduced here to raise awareness that the document has been updated. Overall architecture At the moment, the framework is used in-tree for testing against a cluster (test/e2e), testing kubeadm (test/e2e_kubeadm) and kubelet (test/e2e_node). The goal is to make the core test/e2e/framework a package that has no dependencies on internal code and that can be used in different E2E suites without polluting them with features or options that make no sense for them. This is currently only a technical goal. There are no plans anymore to actually move the code into a staging repository. The framework acts like a normal client of an apiserver and thus doesn't need much more than client-go. Since the sub-package refacoring , additional sub-packages like test/e2e/framework/pod depend on the framework, not the other way around. Those other sub-packages therefore can still use internal code. The import boss configuration enforces these constraints . What's left to clean up is that the framework contains a TestContext with fields that are used only by some tests or some test suites. The configur