You can find the docs here: https://docs.testkube.io
System requirements:
If you're editing the docs, follow this workflow:
- Install dependencies with
npm install - Spin up local development with
npm run start, add-- --port XXXXif you need to change the default port (3000) - Update the docs inside the
/docsfolder - Make sure to add the new document in the
sidebar.jsonfile:
{
type: "category",
label: "Concepts",
items: [
{
type: "category",
label: "Tests",
items: [
"concepts/tests/tests-creating",
"concepts/tests/tests-running",
"concepts/tests/tests-getting-results",
"concepts/tests/tests-variables",
+ "concepts/new-concept"
],
},
}Also make sure the documentation builds ok locally before opening a PR - this will check for broken links, etc.
npm run build
- You can preview the changes locally in your browser: http://localhost:3000
If you want to add a warning/info message like the below, use Docusuarus Admonitions.
If the content of the code blocks refers to a file, use Docusaurus Code Block title.
Don't:
file.js
```js
file;
content;
```Do:
```js title="file.js"
file;
content;
```You can create tabs for structuring your content, for example as in the CLI Installation page.
Please note that headlines inside tab content will be shown in the navigation menu to the right, but will not work as direct links from external sources unless they are under the default/first tab.
For search, we've indexed all the pages into 3 distinct categories Main, Reference and Legacy.
By default the Main index is used which contains all the results which haven't been included in the other 2 indexes.
The user can switch between indexes by clicking one of the 3 options at the top for the search bar.
All docs pages which haven't been explicitly included in the other indexes, are part of the Main index.
To add a page to a specific index, add the following meta tag in the head of the page. e.g:
<meta name="docsearch:indexPrefix" content="YOUR_INDEX" />
These docs use redocusaurus to generate OpenAPI documentation, but
since the Testkube OpenAPI definitions are too large (resulting in very long build/rendering times), there is a
small script at src/scripts/split-openapis.ts that:
- retrieves the OpenAPI definitions for both the agent and control plane APIs
- splits them into smaller definitions into the
src/openapifolder - generates corresponding mdx files into the
docs/openapifolder - generates
src/opeanpi/../redoc-sidebar.jsfiles that are included into the mainsidebar.jsconfig to add the generated mdx files to the sidebar navigation - generates
src/openapi/../redoc-specs.jsfiles that are included into thedocusaurus.config.jsconfig to add the generated specs to the redocusaurs configuration - generates aggregated openapi files for the agent and control plane APIs into the
static/openapifolder
The script requires a GitHub Access Token to be provided in a TESTKUBE_OPENAPI_GITHUB_ACCESS_TOKEN environment variable for retrieving the Control Plane OpenAPI definition from its private repo.
This script needs to be run every time the openapi definition is updated to regenerate the docs accordingly:
npm run split-openapis
Once run, the generated/updated files need to be committed back to the repo for the automated build to publish them.
CRD references docs at are generated from the corresponding GoLang types using a fork of the https://github.com/elastic/crd-ref-docs project, available at https://github.com/kubeshop/crd-ref-docs.
The customized Markdown templates are in this repositories src/crd-templates folder
Follow these steps:
- Ensure you have pulled the testkube-operator submodule
mainbranch to make sure you have the latest types available locally. - Make sure you have go tooling installed.
- Set the desired Kubernetes Version to use for outgoing links to reference docs in the
config.yamlfile (at least v1.28) - Run
go generate gen-crds.go. - Make sure the links and info in
/docs/articles/crds.mdis correct and up to date - Add the deprecation warning after the main headline in all files containing deprecated APIs:
# Testkube API Reference import LegacyWarning from '../\_legacy-warning.mdx'; <LegacyWarning />
- Create a branch, commit and create a PR
The CLI docs are generated in the Testkube Repo by running
make docs
in the root folder and copying the generated files from the gen/docs/cli folder to the /docs/cli folder in this repo (clear the folder first so old files are removed).
:::tip
Make sure the generated docs build with npm run build ok before committing, and fix any errors manually as applicable.
:::

