Skip to content

Commit

Permalink
Rewrite the E2E test framework and tests (apache#4510)
Browse files Browse the repository at this point in the history
Motivation:

According the feedback from the community, the e2e tests are hard for
them to understand and get them started, so this pull request aims to
rewrite the e2e tests with some improvements:

- debuggable locally, now you can run every individual case directly
inside the IDE, just like running a plain unit test.

- same functionalities of multiple counterparts share the same codes,
cases like different storages and cluster coordinators share the same
codes, easy to add more similar cases.

- the "end" now extends to the Doccker images, meaning that some bugs
like apache#4483 and apache#4471 can be more easily and early to be discovered.

- codes style and license headers are checked

Modifications:

- adopt jupeter (a.k.a junit 5), testcontainers as the new test
framework, all containers are orchestrated by docker-compose.yml,
well-known technology that developers should be familiar with.

- rewrite all test cases and verify them.

- reorganize the workflows in GitHub Actions.

Result:

- new e2e test should be easy to add.

- closes apache#4472
  • Loading branch information
kezhenxu94 authored Mar 16, 2020
1 parent b91d744 commit dcd66ee
Show file tree
Hide file tree
Showing 413 changed files with 8,030 additions and 14,442 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/e2e.cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# 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.

name: E2E

on:
pull_request:
push:
branches:
- master
tags:
- 'v*'

env:
SKIP_TEST: true

jobs:
CoordinatorsStorage:
name: Coordinators & Storage
runs-on: ubuntu-latest
strategy:
matrix:
coordinator: ['zk']
storage: ['mysql', 'es6', 'es7', 'influxdb']
env:
SW_COORDINATOR: ${{ matrix.coordinator }}
SW_STORAGE: ${{ matrix.storage }}
steps:
- uses: actions/checkout@v2
- name: checkout submodules
shell: bash
run: |
git submodule sync --recursive
git -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Compile and Build
run: make docker && ES_VERSION=es7 TAG=latest-es7 make docker
- name: Copy dist package
run: cp -R dist test/e2e/
- name: Cluster with ${{ matrix.coordinator }} and ${{ matrix.storage }}
run: ./mvnw --batch-mode -f test/e2e/pom.xml -am -DfailIfNoTests=false verify -Dit.test=org.apache.skywalking.e2e.ClusterE2E
- uses: actions/upload-artifact@v1
if: failure()
with:
name: logs
path: logs

Cluster:
runs-on: ubuntu-latest
needs: [CoordinatorsStorage]
steps:
- name: Call me by your name
run: echo "Birds of a feather flock together"
64 changes: 64 additions & 0 deletions .github/workflows/e2e.jdk-versions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# 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.

name: E2E

on:
pull_request:
push:
branches:
- master
tags:
- 'v*'

env:
SKIP_TEST: true

jobs:
JavaVersions:
name: Agent Java Versions
runs-on: ubuntu-latest
strategy:
matrix:
jdk: [8, 9, 10, 11, 12]
env:
SW_SIMPLE_CASE: jdk
SW_AGENT_JDK_VERSION: ${{ matrix.jdk }}
steps:
- uses: actions/checkout@v2
- name: Checkout Submodules
shell: bash
run: |
git submodule sync --recursive
git -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Build Docker Image
run: make docker
- name: Copy dist package
run: cp -R dist test/e2e/
- name: Agent on JDK Version ${{ matrix.jdk }}
run: ./mvnw --batch-mode -f test/e2e/pom.xml -am -DfailIfNoTests=false verify -Dit.test=org.apache.skywalking.e2e.simple.SimpleE2E
- uses: actions/upload-artifact@v1
if: failure()
with:
name: logs
path: logs

Single:
runs-on: ubuntu-latest
needs: [JavaVersions]
steps:
- name: Singles Bar
run: echo "Singles Bar - Miyuki Nakajima"
57 changes: 57 additions & 0 deletions .github/workflows/e2e.profiling.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 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.

name: E2E

on:
pull_request:
push:
branches:
- master
tags:
- 'v*'

env:
SKIP_TEST: true

jobs:
Profiling:
name: Profiling
runs-on: ubuntu-latest
strategy:
matrix:
storage: ['h2', 'mysql', 'es6', 'es7', 'influxdb']
env:
SW_STORAGE: ${{ matrix.storage }}
steps:
- uses: actions/checkout@v2
- name: checkout submodules
shell: bash
run: |
git submodule sync --recursive
git -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Compile and Build
run: make docker && ES_VERSION=es7 TAG=latest-es7 make docker
- name: Copy dist package
run: cp -R dist test/e2e/
- name: Profiling ${{ matrix.storage }}
run: ./mvnw --batch-mode -f test/e2e/pom.xml -am -DfailIfNoTests=false verify -Dit.test=org.apache.skywalking.e2e.profile.ProfileE2E

- uses: actions/upload-artifact@v1
if: failure()
with:
name: logs
path: logs
63 changes: 63 additions & 0 deletions .github/workflows/e2e.storages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# 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.

name: E2E

on:
pull_request:
push:
branches:
- master
tags:
- 'v*'

env:
SKIP_TEST: true

jobs:
StoragePlugins:
name: Storage
runs-on: ubuntu-latest
strategy:
matrix:
storage: ['mysql', 'es6', 'es7', 'influxdb']
env:
SW_STORAGE: ${{ matrix.storage }}
steps:
- uses: actions/checkout@v2
- name: Checkout Submodules
shell: bash
run: |
git submodule sync --recursive
git -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Compile and Build
run: make docker && ES_VERSION=es7 TAG=latest-es7 make docker
- name: Copy dist package
run: cp -R dist test/e2e/
- name: Storage ${{ matrix.storage }}
run: ./mvnw --batch-mode -f test/e2e/pom.xml -am -DfailIfNoTests=false verify -Dit.test=org.apache.skywalking.e2e.storage.StorageE2E
- uses: actions/upload-artifact@v1
if: failure()
with:
name: logs
path: logs

Storage:
runs-on: ubuntu-latest
needs: [StoragePlugins]
steps:
- name: To pass or not pass
run: echo "Just to make the GitHub merge button green"
56 changes: 56 additions & 0 deletions .github/workflows/e2e.ttl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 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.

name: E2E

on:
pull_request:
push:
branches:
- master
tags:
- 'v*'

env:
SKIP_TEST: true

jobs:
TTL:
name: Storage TTL
runs-on: ubuntu-latest
strategy:
matrix:
storage: ['es6', 'es7', 'influxdb']
env:
SW_STORAGE: ${{ matrix.storage }}
steps:
- uses: actions/checkout@v2
- name: checkout submodules
shell: bash
run: |
git submodule sync --recursive
git -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Compile and Build
run: make docker && ES_VERSION=es7 TAG=latest-es7 make docker
- name: Copy dist package
run: cp -R dist test/e2e/
- name: TTL of storage ${{ matrix.storage }}
run: ./mvnw --batch-mode -f test/e2e/pom.xml -am -DfailIfNoTests=false verify -Dit.test=org.apache.skywalking.e2e.ttl.StorageTTLE2E
- uses: actions/upload-artifact@v1
if: failure()
with:
name: logs
path: logs
Loading

0 comments on commit dcd66ee

Please sign in to comment.