Skip to content

Commit 19b2d38

Browse files
authored
Merge pull request #3909 from DataDog/backport-perm
2 parents edd7a25 + ec2c75a commit 19b2d38

File tree

7 files changed

+31
-60
lines changed

7 files changed

+31
-60
lines changed

.github/workflows/lib-injection.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
jobs:
77
build-and-publish-test-image:
88
runs-on: ubuntu-latest
9+
permissions:
10+
packages: write
911
steps:
1012
- uses: actions/checkout@v4
1113
- name: Set up QEMU

.github/workflows/system-tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
- name: proxy
2626
internal: datadog/system-tests:proxy-v1
2727
runs-on: ubuntu-latest
28+
permissions:
29+
packages: write
2830
name: Build (${{ matrix.image.name }})
2931
steps:
3032
- name: Checkout
@@ -100,6 +102,8 @@ jobs:
100102
- rails71
101103
runs-on: ubuntu-latest
102104
name: Build (${{ matrix.app }})
105+
permissions:
106+
packages: write
103107
steps:
104108
- name: Checkout
105109
uses: actions/checkout@v4

.github/workflows/update-gemfiles.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ jobs:
2929
check:
3030
name: Update Gemfiles
3131
runs-on: ubuntu-22.04
32+
permissions:
33+
contents: write
34+
pull-requests: write
3235
steps:
3336
# Only execute if there's a PR attached to this branch.
3437
# Because we execute on `push`, we have to double check here if this is part of a PR.

.gitlab-ci.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ stages:
99
include:
1010
- remote: https://gitlab-templates.ddbuild.io/apm/packaging.yml
1111
- local: ".gitlab/benchmarks.yml"
12-
- local: ".gitlab/onboarding_tests.yml"
12+
- remote: https://gitlab-templates.ddbuild.io/libdatadog/include/single-step-instrumentation-tests.yml
1313

1414
variables:
1515
DOWNSTREAM_BRANCH:
@@ -199,27 +199,19 @@ oci-internal-test-ecr-publish:
199199
IMG_REGISTRIES: agent-qa
200200

201201
onboarding_tests:
202-
extends: .base_job_onboarding_tests
202+
extends: .base_job_onboarding
203203
stage: integration-tests
204-
needs: [ package-amd64, package-arm64, oci-internal-test-ecr-publish]
204+
needs: [ oci-internal-test-ecr-publish ]
205205
allow_failure: false
206206
variables:
207207
TEST_LIBRARY: ruby
208-
ONBOARDING_FILTER_ENV: prod
208+
SCENARIO: SIMPLE_INSTALLER_AUTO_INJECTION
209+
DD_INSTALLER_LIBRARY_VERSION: pipeline-${CI_PIPELINE_ID}
209210
parallel:
210211
matrix:
211-
- ONBOARDING_FILTER_WEBLOG: [test-app-ruby]
212-
SCENARIO: [SIMPLE_HOST_AUTO_INJECTION]
213-
- ONBOARDING_FILTER_WEBLOG: [test-app-ruby-container]
214-
SCENARIO: [SIMPLE_CONTAINER_AUTO_INJECTION]
215-
- ONBOARDING_FILTER_WEBLOG: [test-app-ruby,test-app-ruby-container]
216-
SCENARIO: [INSTALLER_AUTO_INJECTION]
212+
- ONBOARDING_FILTER_WEBLOG: [test-app-ruby, test-app-ruby-container]
217213
script:
218214
- git clone https://[email protected]/DataDog/system-tests.git system-tests
219-
- cp packaging/*.rpm system-tests/binaries
220-
- cp packaging/*.deb system-tests/binaries
221-
- export DD_INSTALLER_LIBRARY_VERSION="pipeline-${CI_PIPELINE_ID}"
222-
- ls system-tests/binaries
223215
- cd system-tests
224216
- ./build.sh -i runner
225217
- timeout 2700s ./run.sh $SCENARIO --vm-weblog ${ONBOARDING_FILTER_WEBLOG} --vm-env prod --vm-library ${TEST_LIBRARY} --vm-provider aws --vm-skip-branches ubuntu18_amd64

.gitlab/onboarding_tests.yml

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

integration/apps/rack/Gemfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ source "https://rubygems.org"
44

55
gem 'puma'
66
gem 'unicorn'
7-
gem 'passenger'
7+
if RUBY_VERSION < '2.6.0'
8+
gem 'passenger', '< 6.0.23'
9+
else
10+
gem 'passenger'
11+
end
812
gem 'rack'
913
gem 'rackup' if RUBY_VERSION >= '2.4' # The `rackup` is its own gem since Rack 3.0
1014

spec/datadog/core/environment/execution_spec.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@
5757

5858
context 'when in an IRB session' do
5959
it 'returns true' do
60-
_, err = Bundler.with_clean_env do # Ruby 2.6 does not have irb by default in a bundle, but has it outside of it.
61-
Open3.capture3('irb', '--noprompt', '--noverbose', stdin_data: repl_script)
60+
_, err, = Bundler.with_clean_env do # Ruby 2.6 does not have irb by default in a bundle, but has it outside of it.
61+
Open3.capture3('irb', '--noprompt', '--noverbose', '--noecho', stdin_data: repl_script)
6262
end
63-
expect(err).to end_with('true')
63+
expect(err).to end_with('ACTUAL:true')
6464
end
6565
end
6666

@@ -70,8 +70,8 @@
7070
f.write(repl_script)
7171
f.close
7272

73-
out, = Open3.capture2e('pry', '-f', '--noprompt', f.path)
74-
expect(out).to eq('ACTUAL:true')
73+
_, err, = Open3.capture3('pry', '-f', '--noprompt', f.path)
74+
expect(err).to end_with('ACTUAL:true')
7575
end
7676
end
7777
end
@@ -128,7 +128,7 @@ def test_it_does_something_useful
128128

129129
it 'returns true' do
130130
_, err, = Open3.capture3('ruby', stdin_data: script)
131-
expect(err).to end_with('true')
131+
expect(err).to end_with('ACTUAL:true')
132132
end
133133
end
134134

@@ -186,9 +186,10 @@ def test_it_does_something_useful
186186
# Add our script to `env.rb`, which is always run before any feature is executed.
187187
File.write('features/support/env.rb', repl_script)
188188

189-
_, err = Bundler.with_clean_env do
189+
_, err, = Bundler.with_clean_env do
190190
Open3.capture3('ruby', stdin_data: script)
191191
end
192+
192193
expect(err).to include('ACTUAL:true')
193194
end
194195
end
@@ -252,7 +253,7 @@ def test_it_does_something_useful
252253

253254
context 'when given WebMock', skip: Gem::Version.new(Bundler::VERSION) < Gem::Version.new('2') do
254255
it do
255-
out, err = Bundler.with_clean_env do
256+
out, = Bundler.with_clean_env do
256257
Open3.capture3('ruby', stdin_data: <<-RUBY
257258
require 'bundler/inline'
258259
@@ -268,13 +269,12 @@ def test_it_does_something_useful
268269
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
269270
require 'datadog/core/environment/execution'
270271
271-
STDOUT.print Datadog::Core::Environment::Execution.webmock_enabled?
272+
STDOUT.print "ACTUAL:\#{Datadog::Core::Environment::Execution.webmock_enabled?}"
272273
RUBY
273274
)
274275
end
275276

276-
expect(err).to be_empty
277-
expect(out).to eq('true')
277+
expect(out).to end_with('ACTUAL:true')
278278
end
279279
end
280280
end

0 commit comments

Comments
 (0)