This is an automated email from the ASF dual-hosted git repository.
chenyulin0719 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-site.git
The following commit(s) were added to refs/heads/master by this push:
new c1a31ec63e [YUNIKORN-2522] Move e2e test doc from k8shim to website
(#420)
c1a31ec63e is described below
commit c1a31ec63e9094a8e7c10cddf5fd47f02059e183
Author: targetoee <[email protected]>
AuthorDate: Fri Apr 19 11:45:34 2024 +0800
[YUNIKORN-2522] Move e2e test doc from k8shim to website (#420)
Closes: #420
Signed-off-by: Yu-Lin Chen <[email protected]>
---
docs/developer_guide/e2e_test.md | 97 ++++++++++++++++++++++++++++++++++++++++
sidebars.js | 1 +
2 files changed, 98 insertions(+)
diff --git a/docs/developer_guide/e2e_test.md b/docs/developer_guide/e2e_test.md
new file mode 100644
index 0000000000..99d5c6fdd6
--- /dev/null
+++ b/docs/developer_guide/e2e_test.md
@@ -0,0 +1,97 @@
+---
+id: e2e_test
+title: End-to-End Testing
+---
+
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+-->
+
+End-to-end (e2e) tests for YuniKorn-K8shim provide a mechanism to test
end-to-end behavior of the system, and is the last signal to ensure end user
operations match developer specifications.
+
+The primary objectives of the e2e tests are to ensure a consistent and
reliable behavior of the yunikorn code base, and to catch hard-to-test bugs
before users do, when unit and integration tests are insufficient.
+
+The e2e tests are built atop of [Ginkgo](https://onsi.github.io/ginkgo/) and
[Gomega](https://github.com/onsi/gomega). There are a host of features that
this Behavior-Driven Development (BDD) testing framework provides, and it is
recommended that the developer read the documentation prior to diving into the
tests.
+
+Below is the structure of e2e tests, all contained within the
[yunikorn-k8shim](https://github.com/apache/yunikorn-k8shim).
+* `test/e2e/` contains tests for YuniKorn Features like Scheduling, Predicates
etc
+* `test/e2e/framework/configManager` manages & maintains the test and cluster
configuration
+* `test/e2e/framework/helpers` contains utility modules for k8s client,
(de)serializers, rest api client and other common libraries.
+* `test/e2e/testdata` contains all the test related data like configmaps, pod
specs etc
+
+## Pre-requisites
+This project requires Go to be installed. On OS X with Homebrew you can just
run `brew install go`.
+OR follow this doc for deploying go https://golang.org/doc/install
+
+## Understanding the Command Line Arguments
+* `yk-namespace` - namespace under which YuniKorn is deployed. [Required]
+* `kube-config` - path to kube config file, needed for k8s client [Required]
+* `yk-host` - hostname of the YuniKorn REST Server, defaults to localhost.
+* `yk-port` - port number of the YuniKorn REST Server, defaults to 9080.
+* `yk-scheme` - scheme of the YuniKorn REST Server, defaults to http.
+* `timeout` - timeout for all tests, defaults to 24 hours
+
+## Launching Tests
+
+### Trigger through CLI
+* Begin by installing a new cluster dedicated to testing, such as one named
'yktest'
+```shell
+./scripts/run-e2e-tests.sh -a install -n yktest -v kindest/node:v1.28.0
+```
+
+* Launching CI tests is as simple as below.
+```shell
+# We need to add a 'kind' prefix to the argument of the run-e2e-tests.sh -n
command.
+kubectl config use-context kind-yktest
+ginkgo -r -v ci -timeout=2h -- -yk-namespace "yunikorn" -kube-config
"$HOME/.kube/config"
+```
+
+* Launching all the tests can be done as.
+```shell
+ginkgo -r -v -timeout=2h -- -yk-namespace "yunikorn" -kube-config
"$HOME/.kube/config"
+```
+
+* Launching all the tests in specified e2e folder.
+e.g. test/e2e/user_group_limit/
+```shell
+cd test/e2e/
+ginkgo -r user_group_limit -v -- -yk-namespace "yunikorn" -kube-config
"$HOME/.kube/config"
+```
+
+* Launching specified test file.
+```shell
+cd test/e2e/
+ginkgo run -r -v --focus-file "admission_controller_test.go" -- -yk-namespace
"yunikorn" -kube-config "$HOME/.kube/config"
+```
+
+* Launching specified test.
+e.g. Run test with ginkgo.it() spec name
"Verify_maxapplications_with_a_specific_group_limit"
+```shell
+cd test/e2e/
+ginkgo run -r -v --focus "Verify_maxapplications_with_a_specific_group_limit"
-- -yk-namespace "yunikorn" -kube-config "$HOME/.kube/config"
+```
+
+* Launching all the tests except specified test file.
+```shell
+cd test/e2e/
+ginkgo run -r -v --skip-file "admission_controller_test.go" -- -yk-namespace
"yunikorn" -kube-config "$HOME/.kube/config"
+```
+
+* Delete the cluster after we finish testing (this step is optional).
+```shell
+./scripts/run-e2e-tests.sh -a cleanup -n yktest
+```
\ No newline at end of file
diff --git a/sidebars.js b/sidebars.js
index 6de952f713..018de07bd0 100644
--- a/sidebars.js
+++ b/sidebars.js
@@ -76,6 +76,7 @@ module.exports = {
'developer_guide/deployment',
'developer_guide/openshift_development',
'developer_guide/scheduler_object_states',
+ 'developer_guide/e2e_test',
{
type: 'category',
label: 'Designs',
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]