Skip to content

Commit 7ebe626

Browse files
Implement e2e tests and bump up agent-version (#2)
1 parent dc7b044 commit 7ebe626

File tree

150 files changed

+1154
-2401
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+1154
-2401
lines changed

.dockerignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
.idea
18+
.git
19+
examples

.github/PULL_REQUEST_TEMPLATE

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!--
2+
⚠️ Please make sure to read this template first, pull requests that don't accord with this template
3+
maybe closed without notice.
4+
Texts surrounded by `<` and `>` are meant to be replaced by you, e.g. <framework name>, <issue number>.
5+
Put an `x` in the `[ ]` to mark the item as CHECKED. `[x]`
6+
-->
7+
8+
<!-- ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👇 ====
9+
### Fix <bug description or bug issue link>
10+
- [ ] Add a unit test to verify that the fix works.
11+
- [ ] Explain briefly why the bug exists and how to fix it.
12+
==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👆 ==== -->
13+
14+
<!-- ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👇 ====
15+
### Improve the performance of <class or module or ...>
16+
- [ ] Add a benchmark for the improvement, refer to [the existing ones](https://github.com/apache/skywalking/blob/master/oap-server/microbench/src/main/java/org/apache/skywalking/oap/server/microbench/library/datacarrier/LinkedArrayBenchmark.java)
17+
- [ ] The benchmark result.
18+
```text
19+
<Paste the benchmark results here>
20+
```
21+
- [ ] Links/URLs to the theory proof or discussion articles/blogs. <links/URLs here>
22+
==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👆 ==== -->
23+
24+
<!-- ==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👇 ====
25+
### <Feature description>
26+
- [ ] If this is non-trivial feature, paste the links/URLs to the design doc.
27+
- [ ] Update the documentation to include this new feature.
28+
- [ ] Tests(including UT, IT, E2E) are added to verify the new feature.
29+
- [ ] If it's UI related, attach the screenshots below.
30+
- [ ] I have rebuilt the `Configuration.md` documentation by running `make doc-gen`
31+
==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👆 ==== -->
32+
33+
<!-- ==== 📱 Remove this line WHEN AND ONLY WHEN you're adding or modifying a plugin instrumentation, follow the checklist 👇 ====
34+
### <Feature description>
35+
- [ ] If adding a new plugin, add a component id in [the main repo](https://github.com/apache/skywalking/blob/master/oap-server/server-starter/src/main/resources/component-libraries.yml)
36+
- [ ] If adding a new plugin, add a logo in [the UI repo](https://github.com/apache/skywalking-booster-ui/tree/main/src/assets/img/technologies)
37+
- [ ] I have added the library to `pyproject.toml` (plugin group) by running `poetry add library --group plugins`
38+
- [ ] I have rebuilt the `Plugins.md` documentation by running `make doc-gen`
39+
==== 📱 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👆 ==== -->
40+
41+
- [ ] If this pull request closes/resolves/fixes an existing issue, replace the issue url. Closes: <URL to main repo issue>
42+
- [ ] Update the [`CHANGELOG.md`](https://github.com/apache/skywalking-ruby/blob/main/CHANGELOG.md).

.github/workflows/ci.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,43 +23,48 @@ on:
2323
- main
2424
tags:
2525
- 'v*'
26-
schedule:
27-
- cron: '0 18 * * *'
2826

2927
concurrency:
30-
group: CI-plugin-e2e-${{ github.event.pull_request.number || github.ref }}
28+
group: ci-${{ github.event.pull_request.number || github.ref }}
3129
cancel-in-progress: true
3230

3331
jobs:
34-
build:
32+
build-and-check:
3533
runs-on: ubuntu-latest
36-
name: Ruby ${{ matrix.ruby }}
34+
name: Ruby ${{ matrix.ruby-version }} | Build and Check
35+
timeout-minutes: 60
3736
strategy:
38-
fail-fast: true
37+
fail-fast: false
3938
matrix:
40-
ruby:
41-
- 3.2
39+
ruby-version: [ 3.0 ]
4240

4341
steps:
44-
- name: Set up Ruby
42+
- name: Checkout source codes
43+
uses: actions/checkout@v4
44+
with:
45+
submodules: true
46+
- name: Set up Ruby ${{ matrix.ruby-version }}
4547
uses: ruby/setup-ruby@v1
4648
with:
47-
ruby-version: ${{ matrix.ruby }}
48-
bundler-cache: true
49-
- name: Run Bundler
49+
ruby-version: ${{ matrix.ruby-version }}
50+
- name: Check License
51+
uses: apache/skywalking-eyes/header@3ea9df11bb3a5a85665377d1fd10c02edecf2c40
52+
- name: Install system dependency
5053
run: |
5154
gem install bundler
52-
bundle --version
55+
bundler install
56+
- name: RuboCop Linter
57+
run: bundler exec rubocop
5358

5459
CheckStatus:
5560
if: always()
5661
needs:
57-
- build
62+
- build-and-check
5863
runs-on: ubuntu-latest
5964
timeout-minutes: 10
6065
steps:
6166
- name: Merge Requirement
6267
run: |
63-
if [[ ${{ needs.build.result }} != 'success' ]]; then
68+
if [[ ${{ needs.build-and-check.result }} != 'success' ]]; then
6469
exit -1
6570
fi

.github/workflows/e2e.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
name: e2e
18+
19+
on:
20+
pull_request:
21+
push:
22+
branches:
23+
- main
24+
25+
concurrency:
26+
group: e2e-${{ github.event.pull_request.number || github.ref }}
27+
cancel-in-progress: true
28+
29+
jobs:
30+
prep-build-plugin:
31+
name: Build matrix
32+
runs-on: ubuntu-latest
33+
timeout-minutes: 5
34+
outputs:
35+
plugins: ${{ steps.plugins.outputs.plugins }}
36+
steps:
37+
- uses: actions/checkout@v4
38+
with:
39+
submodules: true
40+
- id: plugins
41+
run: echo "plugins=$(ls spec/scenarios | grep -v common | jq --raw-input | jq --slurp --compact-output)" >> "$GITHUB_OUTPUT"
42+
43+
e2e-test:
44+
name: Run E2E Tests | ${{ matrix.plugin }} | Ruby ${{ matrix.ruby-version }}
45+
runs-on: ubuntu-latest
46+
timeout-minutes: 90
47+
needs: [ prep-build-plugin ]
48+
strategy:
49+
matrix:
50+
plugin: ${{ fromJson(needs.prep-build-plugin.outputs.plugins) }}
51+
ruby-version: [ "3.0" ]
52+
env:
53+
SW_RUBY_VERSION: ${{ matrix.ruby-version }}
54+
steps:
55+
- uses: actions/checkout@v4
56+
with:
57+
submodules: true
58+
- name: Set up Ruby ${{ matrix.ruby-version }}
59+
uses: ruby/setup-ruby@v1
60+
with:
61+
ruby-version: ${{ matrix.ruby-version }}
62+
- name: Install docker-compose
63+
shell: bash
64+
run: |
65+
if ! command docker-compose 2>&1 > /dev/null; then
66+
echo "Installing docker-compose"
67+
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
68+
sudo chmod +x /usr/local/bin/docker-compose
69+
fi
70+
- name: Run E2E tests
71+
run: |
72+
gem install bundler && bundle
73+
bundle exec rspec spec/scenarios/${{ matrix.plugin }}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
name: publish-docker
18+
19+
on:
20+
push:
21+
branches:
22+
- main
23+
24+
env:
25+
HUB: ghcr.io/apache/skywalking-ruby
26+
27+
jobs:
28+
build:
29+
if: github.repository == 'apache/skywalking-ruby'
30+
runs-on: ubuntu-latest
31+
permissions:
32+
contents: read
33+
packages: write
34+
timeout-minutes: 150
35+
env:
36+
VERSION: ${{ github.sha }}
37+
steps:
38+
- uses: actions/checkout@v4
39+
with:
40+
submodules: true
41+
- name: Log in to the Container registry
42+
uses: docker/[email protected]
43+
with:
44+
registry: ${{ env.HUB }}
45+
username: ${{ github.actor }}
46+
password: ${{ secrets.GITHUB_TOKEN }}
47+
- name: Polish docker image
48+
run: |
49+
make docker.push || make docker.push

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,5 @@ build-iPhoneSimulator/
7676
# .rubocop-https?--*
7777
Gemfile.lock
7878
gemfiles/*.lock
79-
.DS_Store!
79+
.DS_Store!
80+
spec/workspace

.licenserc.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
header:
20+
license:
21+
spdx-id: Apache-2.0
22+
copyright-owner: Apache Software Foundation
23+
24+
paths-ignore:
25+
- 'licenses'
26+
- '**/*.md'
27+
- 'LICENSE'
28+
- 'NOTICE'
29+
- '.github/PULL_REQUEST_TEMPLATE'
30+
- '**/.gitignore'
31+
- '.gitmodules'
32+
- 'lib/skywalking/proto/**'
33+
- 'examples/**'
34+
- '.rspec'
35+
36+
comment: on-failure

.rspec

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
--format documentation
2-
--color
3-
--require spec_helper
2+
--color

.rubocop.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ Style/SymbolProc:
124124
Style/ExplicitBlockArgument:
125125
Enabled: false
126126

127+
Style/ClassVars:
128+
Enabled: false
129+
130+
Style/CombinableDefined:
131+
Enabled: false
132+
127133
#####
128134
# Lint
129135
#####

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ Release Notes.
66
------------------
77
#### Features
88
- Initialize the ruby agent core.
9+
- Implement e2e tests.
910

1011
#### Plugins
1112
* Support [Sinatra](https://github.com/sinatra/sinatra)
1213
* Support [redis-rb](https://github.com/redis/redis-rb)
14+
* Support [net-http](https://github.com/ruby/net-http)
1315

1416
#### Documentation
1517
* Initialize the documentation.

0 commit comments

Comments
 (0)