You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@submarine.apache.org by ka...@apache.org on 2021/07/15 11:04:24 UTC

[submarine] branch master updated: SUBMARINE-937. [Dev] Update test-e2e doc

This is an automated email from the ASF dual-hosted git repository.

kaihsun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/submarine.git


The following commit(s) were added to refs/heads/master by this push:
     new faf991b  SUBMARINE-937. [Dev] Update test-e2e doc
faf991b is described below

commit faf991b003895f6ef5a7287a6ed0b6a49c977271
Author: noidname01 <ti...@gmail.com>
AuthorDate: Wed Jul 14 00:30:37 2021 +0800

    SUBMARINE-937. [Dev] Update test-e2e doc
    
    ### What is this PR for?
    
    Update the doc of the test-e2e.
    
    ### What type of PR is it?
    [ Documentation ]
    
    ### Todos
    
    None
    
    ### What is the Jira issue?
    
    https://issues.apache.org/jira/projects/SUBMARINE/issues/SUBMARINE-937
    
    ### How should this be tested?
    
    None
    
    ### Screenshots (if appropriate)
    
    None
    
    ### Questions:
    * Do the license files need updating? No
    * Are there breaking changes for older versions? No
    * Does this need new documentation? No
    
    Author: noidname01 <ti...@gmail.com>
    
    Signed-off-by: Kai-Hsun Chen <ka...@apache.org>
    
    Closes #676 from noidname01/SUBMARINE-937 and squashes the following commits:
    
    209573e5 [noidname01] delete redundant file
    995e9b59 [noidname01] add doc for test-e2e
---
 submarine-cloud-v2/artifacts/examples/README.md | 14 ++++++
 submarine-test/test-e2e/run_frontend_e2e.sh     | 42 +++++++++++++++++
 website/docs/devDocs/IntegrationTestE2E.md      | 63 +++++++++++++++++++++++++
 website/sidebars.js                             |  3 +-
 4 files changed, 121 insertions(+), 1 deletion(-)

diff --git a/submarine-cloud-v2/artifacts/examples/README.md b/submarine-cloud-v2/artifacts/examples/README.md
index 4f3afa7..ef33449 100644
--- a/submarine-cloud-v2/artifacts/examples/README.md
+++ b/submarine-cloud-v2/artifacts/examples/README.md
@@ -15,6 +15,20 @@ Before you start reading this document, you need to understand the following Kub
 * Custom Resource (CR)
 * Role-based access control (RBAC): Cluster Role, Cluster Role Binding, and Service Account
 
+`crd.yaml`
 
+This file defines the schema of our [custom resource](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/).
+
+`example-submarine.yaml`
+
+This file specifies the metadata of our custom resource, we can apply this file to deploy it.
+
+`submarine-operator-service-account.yaml`
+
+This file grants that submarine-operator has cluster-wide access, which allow it to operate on other resources.
+
+`submarine-operator.yaml`
+
+We can apply this file to deploy submarine-operator.
 
 
diff --git a/submarine-test/test-e2e/run_frontend_e2e.sh b/submarine-test/test-e2e/run_frontend_e2e.sh
new file mode 100755
index 0000000..60f9e41
--- /dev/null
+++ b/submarine-test/test-e2e/run_frontend_e2e.sh
@@ -0,0 +1,42 @@
+#!/usr/bin/env bash
+#
+# 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.
+#
+
+# Description: Run a frontend E2E tests
+# Usage: ./run_frontend_e2e.sh [Testcase]
+#       Testcase: Check the directory "submarine-test/test-e2e/src/test/java/org/apache/submarine/integration"
+#       Example : ./run_frontend_e2e.sh loginIT
+
+# ======= Modifiable Variables ======= #
+# Note: URL must start with "http" 
+# (Ref: https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/WebDriver.html#get(java.lang.String))
+WORKBENCH_PORT=8080
+URL="http://127.0.0.1"
+# ==================================== #
+
+HTTP_CODE=$(curl -sL -w "%{http_code}\\n" $URL:$WORKBENCH_PORT -o /dev/null)
+if [[ "$HTTP_CODE" != "200" ]]; then
+  echo "Make sure Submarine Workbench is running on $URL:$WORKBENCH_PORT"
+  exit 1
+else
+  echo "HTTP_CODE ($URL:$WORKBENCH_PORT): $HTTP_CODE"
+fi
+
+set -e
+TESTCASE=$1
+mvn -DSUBMARINE_WORKBENCH_URL=$URL -DSUBMARINE_WORKBENCH_PORT=$WORKBENCH_PORT -Dtest=$TESTCASE -DSUBMARINE_E2E_LOCAL=true test
diff --git a/website/docs/devDocs/IntegrationTestE2E.md b/website/docs/devDocs/IntegrationTestE2E.md
new file mode 100644
index 0000000..adc7c9a
--- /dev/null
+++ b/website/docs/devDocs/IntegrationTestE2E.md
@@ -0,0 +1,63 @@
+---
+title: How to Run integration E2E Test
+---
+
+<!---
+  Licensed 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. See accompanying LICENSE file.
+-->
+
+## Introduction
+
+* It checks the components in the website works correctly.
+
+* You can run the test-e2e either locally or on GitHub Actions.
+
+## Run E2E test locally
+
+1. Ensure you have setup the submarine locally. If not, you can refer to `Submarine Local Deployment`.
+
+2. Forward port
+
+  ```bash
+  kubectl port-forward --address 0.0.0.0 service/submarine-traefik 32080:80
+  ```
+
+3. Modify run_frontend_e2e.sh
+
+    You need to modify the port and the URL in this script to where you run the workbench on.
+
+   > Example:
+   > If you just finished developing the workbench appearance and the workbench is running on localhost:4200, then you should modify the WORKBENCH_PORT to 4200
+
+   ```bash
+   # at submarine-test/test_e2e/run_frontend_e2e.sh
+   ...
+   # ======= Modifiable Variables ======= #
+    # Note: URL must start with "http" 
+    # (Ref: https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/WebDriver.html#get(java.lang.String))
+    WORKBENCH_PORT=8080 #<= modify this
+    URL="http://127.0.0.1" #<=modify this
+    # ==================================== #
+    ...
+   ```
+
+4. Run run_frontend_e2e.sh
+
+   This script will check whether the port can be accessed or not, and run the test case.
+   ```bash
+   # at submarine-test/test_e2e
+   ./run_fronted_e2e.sh ${TESTCASE}
+   # TESTCASE is the IT you want to run, ex: loginIT, experimentIT...
+   ```
+
+## Run E2E test in GitHub Actions
+
+Each time a code is submitted, GitHub Actions is automatically triggered for testing.
\ No newline at end of file
diff --git a/website/sidebars.js b/website/sidebars.js
index 69c3a42..cf4693b 100644
--- a/website/sidebars.js
+++ b/website/sidebars.js
@@ -67,7 +67,8 @@ module.exports = {
                 "devDocs/BuildFromCode",
                 "devDocs/Development",
                 "devDocs/IntegrationTest",
-                "devDocs/IntegrationTestK8s"
+                "devDocs/IntegrationTestK8s",
+                "devDocs/IntegrationTestE2E",
             ],
             "Community": [
                 "community/README",

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org