hanahmily commented on a change in pull request #172:
URL: https://github.com/apache/skywalking-website/pull/172#discussion_r545571540



##########
File path: content/blog/e2e-design/index.md
##########
@@ -0,0 +1,282 @@
+---
+title: "[Design] NGE2E - Next Generation End-to-End Testing Framework"
+date: 2020-12-14
+author: "[Zhenxu Ke](https://github.com/kezhenxu94), Tetrate.io; [Huaxi 
Jiang](http://github.com/fgksgf), Committer; [Ke 
Zhang](http://github.com/HumbertZhang), Committer"
+description: "The design of Next Generation End-to-End Testing Framework"
+---
+
+NGE2E is the next generation End-to-End Testing framework that aims to help 
developers to set up, debug, and verify E2E tests with ease. It's built based 
on the lessons learnt from tens of hundreds of test cases in the SkyWalking 
main repo.
+
+# Goal
+
+- Keep the feature parity with the existing E2E framework in SkyWalking main 
repo;
+- Support both [docker-compose](https://docs.docker.com/compose/) and 
[KinD](https://kind.sigs.k8s.io) to orchestrate the tested services under 
different environments;
+- Get rid of the heavy `Java/Maven` stack, which exists in the current E2E; be 
language independent as much as possible, users only need to configure YAMLs 
and run commands, without writing codes;
+
+# Non-Goal
+
+- This framework is not involved with the build process, i.e. it won't do 
something like `mvn package` or `docker build`, the artifacts (`.tar`, docker 
images) should be ready in an earlier process before this;
+- This project doesn't take the plugin tests into account, at least for now;
+- This project doesn't mean to add/remove any new/existing test case to/from 
the main repo;
+- This documentation won't cover too much technical details of how to 
implement the framework, that should go into an individual documentation;
+
+# Design
+
+Before diving into the design details, let's take a quick look at how the end 
user might use NGE2E.
+
+> All the following commands are mock, and are open to debate.
+
+To run a test case in a directory `/path/to/the/case/directory`
+
+```shell
+swctl e2e run /path/to/the/case/directory
+
+# or
+
+cd /path/to/the/case/directory && swctl e2e run
+```
+
+This will run the test case in the specified directory, this command is a 
wrapper that glues all the following commands, which can be executed 
separately, for example, to debug the case:
+
+**NOTE**: because all the options can be loaded from a configuration file, so 
as long as a configuration file (say `e2e.yaml`) is given in the directory, 
every command should be able to run in bare mode (without any option explicitly 
specified in the command line);
+
+### Set Up Services
+
+```shell
+swctl e2e setup --env=compose --file=docker-compose.yaml 
--wait=for=service-health
+swctl e2e setup --env=kind --file=kind.yaml 
--resources=bookinfo.yaml,gateway.yaml --wait=for=pod-ready

Review comment:
       > Can you please elaborate more why we need this in a test case (Do the 
workloads matter)?
   
   NO. 2 and NO. 3 are from the same idea, that we should run a test case step 
by step. Deploy a manifest then wait or make sure all of the components are 
ready, then move to the next step.  The benefit of this pattern is to split the 
focus, which makes contributors debug more easily. 
   
   And you mention `command` option, which brings some flexibility but makes 
more confuses me indeed. In general, we need the deployment-wait workflow in 
command either, for example, after deploying SW, we have to wait for deployment 
and pod available.  I tweak the example a bit to explain what I need :
   
   ```
   setup:
     env: kind
     file: kind.yaml
     steps:
     - command: kubectl apply -f skywalking.yml
        wait: 
            namespace: istio-system
            label-selector: app=skywalking
            for: deployment-avaiable
     - command:  istioctl install --profile=demo -y
        wait:
            namespace: istio-system
            label-selector: app=istio
             for: deployment-ready
     - command:  kubectl label namespace default istio-injection=enabled
     - command: kubectl apply -f bookinfo.yaml
        wait:
             namespace: default
             for: deployment-ready
   ```
   
   All of the steps are sync or async. If it's a sync step, we could check the 
return code to verify the result, while in the async step we should leverage 
the async function `wait` to check the result is what I expect eventually. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to