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

hoshea pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-infra-e2e.git


The following commit(s) were added to refs/heads/main by this push:
     new 935338e  Make e2e test itself in github action (#116)
935338e is described below

commit 935338e53221c7da56c47ae4768caa22416c0ad6
Author: Prince-Chen <1572839...@qq.com>
AuthorDate: Mon Sep 4 11:55:36 2023 +0800

    Make e2e test itself in github action (#116)
---
 .github/workflows/e2e-test.yaml               | 54 +++++++++++++++++++++++++++
 test/e2e/docker-compose.yml                   | 21 +++++++++++
 test/e2e/e2e.yaml                             | 48 ++++++++++++++++++++++++
 test/e2e/fail-fast/expected.yaml              | 23 ++++++++++++
 test/e2e/fail-fast/internal/expected.yaml     | 25 +++++++++++++
 test/e2e/fail-fast/internal/verify.yaml       | 41 ++++++++++++++++++++
 test/e2e/non-fail-fast/expected.yaml          | 24 ++++++++++++
 test/e2e/non-fail-fast/internal/expected.yaml | 25 +++++++++++++
 test/e2e/non-fail-fast/internal/verify.yaml   | 44 ++++++++++++++++++++++
 9 files changed, 305 insertions(+)

diff --git a/.github/workflows/e2e-test.yaml b/.github/workflows/e2e-test.yaml
new file mode 100644
index 0000000..a39c498
--- /dev/null
+++ b/.github/workflows/e2e-test.yaml
@@ -0,0 +1,54 @@
+# Licensed to 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. Apache Software Foundation (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.
+#
+
+name: E2E Test
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
github.ref }}
+  cancel-in-progress: true
+
+on:
+  pull_request:
+    branches:
+      - main
+
+jobs:
+  build:
+    name: E2E Test
+    runs-on: ubuntu-latest
+    steps:
+            
+      - name: Set up Go 1.18
+        uses: actions/setup-go@v4
+        with:
+          go-version: 1.18
+        id: go
+
+      - name: Check out code into the Go module directory
+        uses: actions/checkout@v3
+
+      - name: Build e2e
+        run: make linux
+
+      - name: Run E2E Test
+        uses: apache/skywalking-infra-e2e@main
+        with:
+           e2e-file: ./test/e2e/e2e.yaml
+
+              
+       
diff --git a/test/e2e/docker-compose.yml b/test/e2e/docker-compose.yml
new file mode 100644
index 0000000..7ed0f45
--- /dev/null
+++ b/test/e2e/docker-compose.yml
@@ -0,0 +1,21 @@
+# 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.
+
+version: '2.1'
+services:
+  httpbin:
+    image: kennethreitz/httpbin
+    ports:
+      - "8080:80"
\ No newline at end of file
diff --git a/test/e2e/e2e.yaml b/test/e2e/e2e.yaml
new file mode 100644
index 0000000..c22e99c
--- /dev/null
+++ b/test/e2e/e2e.yaml
@@ -0,0 +1,48 @@
+# 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.
+
+# This file is used to show how to write configuration files and can be used 
to test.
+
+setup:
+  env: compose
+  file: docker-compose.yml
+  timeout: 20m
+
+cleanup:
+  # always never success failure
+  on: always
+
+verify:
+  # verify with retry strategy
+  retry:
+    # max retry count
+    count: 1
+    # the interval between two attempts, e.g. 10s, 1m.
+    interval: 1s
+
+  # when a case fails, whether to stop verifying other cases. This property 
defaults to true.
+  fail-fast: false
+  # Whether to verify cases concurrently. This property defaults to false.
+  concurrency: false
+
+
+  cases:
+    - name: fail-fast
+      query: './bin/linux/e2e verify -c  
./test/e2e/fail-fast/internal/verify.yaml --summary-only -o yaml'
+      expected: ./fail-fast/expected.yaml
+
+    - name: non-fail-fast
+      query: './bin/linux/e2e verify -c  
./test/e2e/non-fail-fast/internal/verify.yaml --summary-only -o yaml'
+      expected: ./non-fail-fast/expected.yaml
\ No newline at end of file
diff --git a/test/e2e/fail-fast/expected.yaml b/test/e2e/fail-fast/expected.yaml
new file mode 100644
index 0000000..d7ea0a9
--- /dev/null
+++ b/test/e2e/fail-fast/expected.yaml
@@ -0,0 +1,23 @@
+# Licensed to 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. Apache Software Foundation (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.
+
+passed:
+- case-1
+- case-2
+failed:
+- case-3
+skipped: []
\ No newline at end of file
diff --git a/test/e2e/fail-fast/internal/expected.yaml 
b/test/e2e/fail-fast/internal/expected.yaml
new file mode 100644
index 0000000..1d9d4bc
--- /dev/null
+++ b/test/e2e/fail-fast/internal/expected.yaml
@@ -0,0 +1,25 @@
+# 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.
+
+# This file is used to show how to write configuration files and can be used 
to test.
+
+args:
+    case: success
+headers:
+    Accept: application/json
+    Host: 127.0.0.1:8080
+    User-Agent: curl/7.81.0
+origin: 172.18.0.1
+url: http://127.0.0.1:8080/get?case=success
\ No newline at end of file
diff --git a/test/e2e/fail-fast/internal/verify.yaml 
b/test/e2e/fail-fast/internal/verify.yaml
new file mode 100644
index 0000000..40b7210
--- /dev/null
+++ b/test/e2e/fail-fast/internal/verify.yaml
@@ -0,0 +1,41 @@
+# 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.
+
+# This file is used to show how to write configuration files and can be used 
to test.
+
+verify:
+  # verify with retry strategy
+  retry:
+    # max retry count
+    count: 5
+    # the interval between two attempts, e.g. 10s, 1m.
+    interval: 1s
+
+  # when a case fails, whether to stop verifying other cases. This property 
defaults to true.
+  fail-fast: true
+  # Whether to verify cases concurrently. This property defaults to false.
+  concurrency: false
+
+
+  cases:
+    - name: case-1
+      query: 'curl -s 127.0.0.1:8080/get?case=success -H "accept: 
application/json"'
+      expected: ./expected.yaml
+    - name: case-2
+      query: 'curl -s 127.0.0.1:8080/get?case=success -H "accept: 
application/json"'
+      expected: ./expected.yaml
+    - name: case-3
+      query: 'curl -s 127.0.0.1:8080/get?case=failure -H "accept: 
application/json"'
+      expected: ./expected.yaml
\ No newline at end of file
diff --git a/test/e2e/non-fail-fast/expected.yaml 
b/test/e2e/non-fail-fast/expected.yaml
new file mode 100644
index 0000000..a90d042
--- /dev/null
+++ b/test/e2e/non-fail-fast/expected.yaml
@@ -0,0 +1,24 @@
+# Licensed to 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. Apache Software Foundation (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.
+
+passed:
+- case-1
+- case-2
+- case-4
+failed:
+- case-3
+skipped: []
\ No newline at end of file
diff --git a/test/e2e/non-fail-fast/internal/expected.yaml 
b/test/e2e/non-fail-fast/internal/expected.yaml
new file mode 100644
index 0000000..1d9d4bc
--- /dev/null
+++ b/test/e2e/non-fail-fast/internal/expected.yaml
@@ -0,0 +1,25 @@
+# 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.
+
+# This file is used to show how to write configuration files and can be used 
to test.
+
+args:
+    case: success
+headers:
+    Accept: application/json
+    Host: 127.0.0.1:8080
+    User-Agent: curl/7.81.0
+origin: 172.18.0.1
+url: http://127.0.0.1:8080/get?case=success
\ No newline at end of file
diff --git a/test/e2e/non-fail-fast/internal/verify.yaml 
b/test/e2e/non-fail-fast/internal/verify.yaml
new file mode 100644
index 0000000..41e951e
--- /dev/null
+++ b/test/e2e/non-fail-fast/internal/verify.yaml
@@ -0,0 +1,44 @@
+# 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.
+
+# This file is used to show how to write configuration files and can be used 
to test.
+
+verify:
+  # verify with retry strategy
+  retry:
+    # max retry count
+    count: 5
+    # the interval between two attempts, e.g. 10s, 1m.
+    interval: 1s
+
+  # when a case fails, whether to stop verifying other cases. This property 
defaults to true.
+  fail-fast: false
+  # Whether to verify cases concurrently. This property defaults to false.
+  concurrency: false
+
+
+  cases:
+    - name: case-1
+      query: 'curl -s 127.0.0.1:8080/get?case=success -H "accept: 
application/json"'
+      expected: ./expected.yaml
+    - name: case-2
+      query: 'curl -s 127.0.0.1:8080/get?case=success -H "accept: 
application/json"'
+      expected: ./expected.yaml
+    - name: case-3
+      query: 'curl -s 127.0.0.1:8080/get?case=failure -H "accept: 
application/json"'
+      expected: ./expected.yaml
+    - name: case-4
+      query: 'curl -s 127.0.0.1:8080/get?case=success -H "accept: 
application/json"'
+      expected: ./expected.yaml
\ No newline at end of file

Reply via email to