From ac41e5658222d93ad52629dee2119eb7fc5a9374 Mon Sep 17 00:00:00 2001 From: Nabarun Pal Date: Tue, 29 Jun 2021 23:30:50 +0530 Subject: [PATCH] docs: add documentation on adding files to the embedded data Signed-off-by: Nabarun Pal --- test/e2e/testing-manifests/README.md | 22 ++++++++++++++++++++++ test/fixtures/README.md | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 test/e2e/testing-manifests/README.md create mode 100644 test/fixtures/README.md diff --git a/test/e2e/testing-manifests/README.md b/test/e2e/testing-manifests/README.md new file mode 100644 index 00000000000..fd495331fc9 --- /dev/null +++ b/test/e2e/testing-manifests/README.md @@ -0,0 +1,22 @@ +# test/e2e/testing-manifests + +## Embedded Test Data + +In case one needs to use any test fixture inside your tests and those are defined inside this directory, they need to be added to the `//go:embed` directive in `embed.go`. + +For example, if one wants to include this Readme as a test fixture (potential bad idea in reality!), + +``` +// embed.go + +... +//go:embed some other files README.md +... +``` + +This fixture can be accessed in the e2e tests using `test/e2e/framework/testfiles.Read` like +`testfiles.Read("test/e2e/testing-manifests/README.md)`. + +This is needed since [migrating to //go:embed from go-bindata][1]. + +[1]: https://github.com/kubernetes/kubernetes/pull/99829 diff --git a/test/fixtures/README.md b/test/fixtures/README.md new file mode 100644 index 00000000000..0e793126b98 --- /dev/null +++ b/test/fixtures/README.md @@ -0,0 +1,22 @@ +# test/fixtures + +## Embedded Test Data + +In case one needs to use any test fixture inside your tests and those are defined inside this directory, they need to be added to the `//go:embed` directive in `embed.go`. + +For example, if one wants to include this Readme as a test fixture (potential bad idea in reality!), + +``` +// embed.go + +... +//go:embed some other files README.md +... +``` + +This fixture can be accessed in the e2e tests using `test/e2e/framework/testfiles.Read` like +`testfiles.Read("test/fixtures/README.md)`. + +This is needed since [migrating to //go:embed from go-bindata][1]. + +[1]: https://github.com/kubernetes/kubernetes/pull/99829