Skip to content

Commit 9c08363

Browse files
authored
Merge pull request #125 from appoptics/gh_tests_updates
GH Actions and Tests Updates
2 parents ddfbdb4 + 1b888b8 commit 9c08363

Some content is hidden

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

50 files changed

+648
-275
lines changed

.github/workflows/build_for_packagecloud.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,16 @@ jobs:
5555
env:
5656
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
5757

58-
- name: Test install (give packagecloud 10 seconds to index)
59-
working-directory: .github/workflows/
60-
env:
61-
APPOPTICS_SERVICE_KEY: ${{ secrets.APPOPTICS_SERVICE_KEY }}
62-
APPOPTICS_COLLECTOR: ${{ secrets.APPOPTICS_COLLECTOR}}
63-
APPOPTICS_FROM_S3: true
64-
run: |
65-
sleep 10
66-
gem sources --add https://packagecloud.io/solarwinds/appoptics-apm-ruby/
67-
gem install appoptics_apm --version ${{ steps.gemstep.outputs.GEM_VERSION }} --verbose
68-
ruby ./scripts/test_install.rb
58+
# Run this test manually, github is having problems reading the index at packagecloud
59+
# TODO: AO-20355
60+
# - name: Test install (give packagecloud 60 seconds to index)
61+
# working-directory: .github/workflows/
62+
# env:
63+
# APPOPTICS_SERVICE_KEY: ${{ secrets.APPOPTICS_SERVICE_KEY }}
64+
# APPOPTICS_COLLECTOR: ${{ secrets.APPOPTICS_COLLECTOR}}
65+
# APPOPTICS_FROM_S3: true
66+
# run: |
67+
# sleep 60
68+
# gem sources --add https://packagecloud.io/solarwinds/appoptics-apm-ruby
69+
# gem install appoptics_apm --version ${{ steps.gemstep.outputs.GEM_VERSION }} --verbose
70+
# ruby ./scripts/test_install.rb

.github/workflows/docker-images.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ on:
44
push:
55
paths:
66
- 'test/run_tests/Dockerfile_*'
7-
# Allows you to run this workflow manually from the Actions tab
7+
# Allows running this workflow manually from the Actions tab
88
workflow_dispatch:
99

1010
env:
11-
GHRC: ghcr.io/appoptics/appoptics-apm-ruby/ao
11+
GHRC: ghcr.io/appoptics/appoptics-apm-ruby/apm_ruby
1212
DOCKERFILE: test/run_tests/Dockerfile
1313

1414
jobs:

.github/workflows/run_cpluplus_tests.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33

44
name: C++ Tests
55

6-
on: [push]
6+
on:
7+
push:
8+
paths:
9+
- ext/oboe_metal/src/*.h
10+
- ext/oboe_metal/src/*.cc
11+
- ext/oboe_metal/test/*
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
714

815
jobs:
916
tests:

.github/workflows/run_tests.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# Copyright (c) 2021 SolarWinds, LLC.
22
# All rights reserved.
33

4-
name: Ruby Tests
4+
name: Run Ruby Tests on Ubuntu
55

6-
on: [push]
6+
on:
7+
# push:
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
710

811
jobs:
912
tests:
@@ -126,18 +129,15 @@ jobs:
126129
run: export DBTYPE=${{ matrix.dbtype }}
127130

128131
- name: Add javascript runtime
129-
run: |
130-
curl -sL https://deb.nodesource.com/setup_14.x | bash -
131-
apt-get install nodejs -y --no-install-recommends
132-
# curl -o- -L https://yarnpkg.com/install.sh | bash
132+
uses: actions/setup-node@v2
133+
with:
134+
node-version: '14'
133135

134136
- name: Initialize services
135-
# env:
136-
# POSTGRES_HOST: postgres
137137
run: |
138138
export PGPASSWORD=$POSTGRES_PASSWORD; psql -c 'create database travis_ci_test;' -U postgres -h $POSTGRES_HOST
139139
curl -SL http://download.redis.io/releases/redis-4.0.0.tar.gz | tar xzC /tmp && cd /tmp/redis-4.0.0/ && make && make install && cd -
140-
redis-server --requirepass redis_pass &
140+
redis-server --requirepass redis_pass --loglevel "warning" &
141141
142142
- name: Bundle with 1.17.3
143143
if: matrix.gemfile == 'rails42' || matrix.gemfile == 'frameworks'

.github/workflows/scripts/test_install.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,19 @@
55
# the collector
66
# requires env vars:
77
# - APPOPTICS_SERVICE_KEY
8-
# - APPOPTICS_COLLECTOR (optional if the kye is for production)
8+
# - APPOPTICS_COLLECTOR (optional if the key is for production)
99

1010
require 'appoptics_apm'
1111
AppOpticsAPM.support_report
1212
exit 1 unless AppOpticsAPM.reporter
13+
14+
AppOpticsAPM::Config[:profiling] = :enabled
15+
16+
AppOpticsAPM::SDK.start_trace("install_test_profiling") do
17+
AppOpticsAPM::Profiling.run do
18+
10.times do
19+
[9, 6, 12, 2, 7, 1, 9, 3, 4, 14, 5, 8].sort
20+
sleep 0.2
21+
end
22+
end
23+
end
Lines changed: 140 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,159 @@
1-
name: Test on all Linux
1+
# Copyright (c) 2021 SolarWinds, LLC.
2+
# All rights reserved.
3+
4+
name: Run Ruby Tests on 4 Linux
25

36
on:
47
push:
5-
# Allows you to run this workflow manually from the Actions tab
8+
paths-ignore:
9+
- 'test/run_tests/Dockerfile_*'
10+
# Allows you to run this workflow manually from the Actions tab
611
workflow_dispatch:
712

13+
env:
14+
GHRC: ghcr.io/appoptics/appoptics-apm-ruby/apm_ruby
15+
DOCKERFILE: test/run_tests/Dockerfile
16+
817
jobs:
918

19+
#-------------------------------------------------------------------------------
20+
# TODO: figure out how to build images first if necessary
21+
#
22+
# ********* this is not working because we don't have a *************
23+
# ********* reference to the commit of the previous GH run *************
24+
#
25+
# build_images:
26+
# name: Build docker images if necessary
27+
# runs-on: ubuntu-latest
28+
#
29+
# strategy:
30+
# fail-fast: true
31+
# matrix:
32+
# os: [ ubuntu, debian, centos, alpine ]
33+
#
34+
# steps:
35+
# - name: Checkout
36+
# uses: actions/checkout@v2
37+
#
38+
#
39+
# ## comment out to get a debug session
40+
# ## only works with ubuntu and debian, because it uses apt:
41+
## - name: tmate debugging session
42+
## uses: mxschmitt/action-tmate@v3
43+
## with:
44+
## sudo: false
45+
#
46+
# - name: check modified files
47+
# id: check_files
48+
# run: |
49+
# git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep Dockerfile_
50+
# echo ::set-output name=check_dockerfiles::$?
51+
## git diff --name-only HEAD^ HEAD | grep [D]ockerfile_
52+
## echo ::set-output name=check_dockerfiles::$?
53+
#
54+
# - name: ghcr.io login ... build and publish images if needed
55+
# uses: docker/login-action@v1
56+
# if: ${{ steps.check_files.outputs.check_dockerfiles == 0}}
57+
# with:
58+
# registry: ghcr.io
59+
# username: ${{ github.actor }}
60+
# password: ${{ secrets.GITHUB_TOKEN }}
61+
#
62+
# - name: Build and publish new Docker image
63+
# if: ${{ steps.check_files.outputs.check_dockerfiles == 0 }}
64+
# run: |
65+
# docker build -f ${{ env.DOCKERFILE }}_${{ matrix.os }} -t ${{ env.GHRC }}_${{ matrix.os }} .
66+
# docker push ${{ env.GHRC }}_${{ matrix.os }}
67+
68+
#-------------------------------------------------------------------------------
1069
all_linux_test:
11-
name: Test on all Linux
70+
name: ${{ matrix.os }} - ruby ${{ matrix.ruby }}
1271
runs-on: ubuntu-latest
72+
# needs: build_images
1373

1474
strategy:
1575
fail-fast: false
1676
matrix:
1777
os: [ubuntu, debian, centos, alpine]
78+
ruby: ['3.0', '2.7', '2.6', '2.5', '2.4']
1879

1980
container:
20-
image: ghcr.io/appoptics/appoptics-apm-ruby/ao_${{ matrix.os }}
81+
# maybe github.repository works
82+
image: ghcr.io/${{ github.repository }}/apm_ruby_${{ matrix.os }}
83+
84+
env:
85+
APPOPTICS_GEM_TEST: true
86+
APPOPTICS_REPORTER: file
87+
APPOPTICS_COLLECTOR: /tmp/appoptics_traces.bson
88+
APPOPTICS_MONGO_SERVER: "mongo"
89+
APPOPTICS_RABBITMQ_SERVER: "rabbitmq"
90+
APPOPTICS_MEMCACHED_SERVER: "memcached"
91+
APPOPTICS_REPORTER_FILE_SINGLE: false
92+
APPOPTICS_FROM_S3: true
93+
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
94+
MYSQL_ROOT_PASSWORD: "admin"
95+
MYSQL_HOST: "mysql"
96+
MYSQL_DATABASE: "travis_ci_test"
97+
POSTGRES_DB: "travis_ci_test"
98+
DOCKER_MYSQL_PASS: "admin"
99+
DOCKER_PSQL_PASS: "postgres"
100+
POSTGRES_USER: "postgres"
101+
POSTGRES_PASSWORD: "postgres"
102+
POSTGRES_HOST: "postgres"
103+
REDIS_PASSWORD: "redis_pass"
104+
TEST_RUNS_TO_FILE: "true"
105+
106+
services:
107+
memcached:
108+
image: memcached:latest
109+
ports:
110+
- 11211:11211
111+
options: --health-cmd "timeout 5 bash -c 'cat < /dev/null > /dev/udp/127.0.0.1/11211'" --health-interval 10s --health-timeout 5s --health-retries 5
112+
rabbitmq:
113+
image: rabbitmq:latest
114+
ports:
115+
- 5672:5672
116+
options: --health-cmd "rabbitmqctl node_health_check" --health-interval 10s --health-timeout 5s --health-retries 5
117+
mongo:
118+
image: mongo:latest
119+
ports:
120+
- 27017:27017
121+
options: "--health-cmd \"mongo --quiet --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)'\" --health-interval 10s --health-timeout 5s --health-retries 5"
122+
postgres:
123+
image: postgres:10.8
124+
env:
125+
POSTGRES_DB: travis_ci_test
126+
ports:
127+
- 5432:5432
128+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
129+
mysql:
130+
image: mariadb:latest
131+
env:
132+
MYSQL_USER: user
133+
MYSQL_PASSWORD: password
134+
MYSQL_DATABASE: travis_ci_test
135+
MYSQL_ROOT_PASSWORD: admin
136+
ports:
137+
- 3306:3306
138+
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
21139

22140
steps:
23-
- name: Checkout
24-
uses: actions/checkout@v1
141+
- name: Checkout ${{ github.ref }}
142+
uses: actions/checkout@v2
143+
144+
- name: print some info
145+
run: |
146+
user=`whoami`
147+
pwd=`pwd`
148+
echo "User: $user"
149+
echo "Current dir: $pwd"
150+
echo "Home dir: $HOME"
151+
echo "Branch: ${GITHUB_REF#refs/*/}"
25152
26-
- name: just a shell command
27-
run: echo "I am fine!"
153+
- name: ruby tests
154+
run: |
155+
export HOME=/root
156+
test/run_tests/ruby_setup.sh
157+
version=`rbenv versions --bare | grep ${{ matrix.ruby }}`
158+
echo "testing with ruby version: $version"
159+
test/run_tests/run_tests.sh -r $version

.gitignore

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
*.code-workspace
1+
!.keep
22
*.gem
33
*.lock
4+
*.log
45
*.swp
56
*~
67
.*byebug*
@@ -9,13 +10,11 @@
910
.irb_history
1011
.irbrc
1112
.ruby-version
12-
.vagrant
1313
.yardoc/
14-
ext/oboe_metal/src/ruby_headers/
14+
app/
1515
builds/
1616
coverage/
1717
doc/
18-
ext/.vscode/
1918
ext/oboe_metal/*.o
2019
ext/oboe_metal/Makefile
2120
ext/oboe_metal/lib/liboboe*so*
@@ -28,14 +27,10 @@ ext/oboe_metal/src/oboe.h
2827
ext/oboe_metal/src/oboe_api.hpp
2928
ext/oboe_metal/src/oboe_debug.h
3029
ext/oboe_metal/src/oboe_swig_wrap.cc
31-
ext/oboe_metal/test/GMock-prefix/
32-
ext/oboe_metal/test/CMakeFiles/
30+
ext/oboe_metal/test/build/
3331
ext/oboe_metal/test/MakeFile
3432
gemfiles/*.lock
3533
gemfiles/.bundle/
3634
gemfiles/vendor*
3735
lib/libappoptics_apm.so
38-
log/
39-
scrap/
40-
swig/
4136
vendor/

.travis.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ env:
1010
- DBTYPE=mysql2
1111

1212
rvm:
13-
- 3.0.1
14-
- 2.7.3
15-
- 2.6.7
13+
- 3.0.2
14+
- 2.7.4
15+
- 2.6.8
1616
- 2.5.8
1717
- 2.4.10
1818
# - ruby-head
@@ -27,16 +27,19 @@ gemfile:
2727
- gemfiles/rails60.gemfile
2828
- gemfiles/rails52.gemfile
2929
- gemfiles/rails42.gemfile
30+
- gemfiles/profiling.gemfile
3031
- gemfiles/delayed_job.gemfile
3132
- gemfiles/noop.gemfile
3233

3334
matrix:
3435
exclude:
35-
- rvm: 3.0.1
36+
- rvm: 3.0.2
3637
gemfile: gemfiles/rails42.gemfile
37-
- rvm: 2.7.3
38+
- rvm: 3.0.2
39+
gemfile: gemfiles/rails52.gemfile
40+
- rvm: 2.7.4
3841
gemfile: gemfiles/rails42.gemfile
39-
- rvm: 2.6.7
42+
- rvm: 2.6.8
4043
gemfile: gemfiles/rails42.gemfile
4144
- rvm: 2.4.10
4245
gemfile: gemfiles/rails60.gemfile
@@ -55,6 +58,8 @@ matrix:
5558
env: DBTYPE=mysql2
5659
- gemfile: gemfiles/frameworks.gemfile
5760
env: DBTYPE=mysql2
61+
- gemfile: gemfiles/profiling.gemfile
62+
env: DBTYPE=mysql2
5863
- gemfile: gemfiles/delayed_job.gemfile
5964
env: DBTYPE=mysql2
6065
allow_failures:

.travis/bundle.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ Find more details in the [RubyDoc page](https://www.rubydoc.info/gems/appoptics_
234234
# Support
235235

236236
If you run into a problem, find a bug, or would like to request an enhancement, feel free to contact our tech support
237-
[support@appoptics.com](support@appoptics.com).
237+
[technicalsupport@solarwinds.com](technicalsupport@solarwinds.com).
238238

239239
# Contributing
240240

0 commit comments

Comments
 (0)