Skip to content

Commit

Permalink
Merge branch 'master' into auto-generate/update-latest-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCTHsu authored Nov 22, 2024
2 parents bef55ec + 8915924 commit f2abaf0
Show file tree
Hide file tree
Showing 1,136 changed files with 374 additions and 1,600 deletions.
34 changes: 1 addition & 33 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,35 +115,7 @@ step_get_test_agent_trace_check_results: &step_get_test_agent_trace_check_result
run:
name: Get APM Test Agent Trace Check Results
command: |
set +e # Disable exiting from testagent response failure
SUMMARY_RESPONSE=$(curl -s -w "\n%{http_code}" -o summary_response.txt http://testagent:9126/test/trace_check/summary)
set -e
SUMMARY_RESPONSE_CODE=$(echo "$SUMMARY_RESPONSE" | awk 'END {print $NF}')
if [[ SUMMARY_RESPONSE_CODE -eq 200 ]]; then
echo "APM Test Agent is running. (HTTP 200)"
else
echo "APM Test Agent is not running and was not used for testing. No checks failed."
exit 0
fi
RESPONSE=$(curl -s -w "\n%{http_code}" -o response.txt http://testagent:9126/test/trace_check/failures)
RESPONSE_CODE=$(echo "$RESPONSE" | awk 'END {print $NF}')
if [[ $RESPONSE_CODE -eq 200 ]]; then
echo "All APM Test Agent Check Traces returned successful! (HTTP 200)"
echo "APM Test Agent Check Traces Summary Results:"
cat summary_response.txt | jq '.'
elif [[ $RESPONSE_CODE -eq 404 ]]; then
echo "Real APM Agent running in place of TestAgent, no checks to validate!"
else
echo "APM Test Agent Check Traces failed with response code: $RESPONSE_CODE"
echo "Failures:"
cat response.txt
echo "APM Test Agent Check Traces Summary Results:"
cat summary_response.txt | jq '.'
exit 1
fi
ruby .circleci/test_agent_check.rb
when: always

filters_all_branches_and_tags: &filters_all_branches_and_tags
Expand Down Expand Up @@ -285,10 +257,6 @@ orbs:
curl --silent --show-error --location --fail --retry 3 --output /usr/local/bin/dockerize $DOCKERIZE_URL
chmod +x /usr/local/bin/dockerize
dockerize --version
# Test agent uses `jq` to check results
- run:
name: Install jq
command: apt update && apt install jq -y
# Wait for containers to start
- docker-wait:
port: 5432
Expand Down
2 changes: 1 addition & 1 deletion .circleci/images/primary/binary_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
463
464
42 changes: 42 additions & 0 deletions .circleci/test_agent_check.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env ruby

require 'net/http'
require 'uri'
require 'json'

# Disable exiting on command failure
begin
# Check if test agent is running
summary_uri = URI.parse('http://testagent:9126/test/trace_check/summary')
summary_response = Net::HTTP.get_response(summary_uri)

if summary_response.code == '200'
puts 'APM Test Agent is running. (HTTP 200)'
else
puts 'APM Test Agent is not running and was not used for testing. No checks failed.'
exit 0
end

# Check for test failures
failures_uri = URI.parse('http://testagent:9126/test/trace_check/failures')
failures_response = Net::HTTP.get_response(failures_uri)

case failures_response.code
when '200'
puts 'All APM Test Agent Check Traces returned successful! (HTTP 200)'
puts 'APM Test Agent Check Traces Summary Results:'
puts JSON.pretty_generate(JSON.parse(summary_response.body))
when '404'
puts 'Real APM Agent running in place of TestAgent, no checks to validate!'
else
puts "APM Test Agent Check Traces failed with response code: #{failures_response.code}"
puts 'Failures:'
puts failures_response.body
puts 'APM Test Agent Check Traces Summary Results:'
puts JSON.pretty_generate(JSON.parse(summary_response.body))
exit 1
end
rescue => e
puts "An error occurred: #{e.message}"
exit 1
end
7 changes: 4 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ default:
parallel:
matrix:
# ADD NEW RUBIES HERE
- RUBY_VERSION: ["3.2.2", "3.1.4", "3.0.6", "2.7.8"]
- RUBY_VERSION: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7"]
script:
- >
docker build
Expand Down Expand Up @@ -60,7 +60,7 @@ promote-image:
parallel:
matrix:
# ADD NEW RUBIES HERE
- RUBY_VERSION: ["3.2.2", "3.1.4", "3.0.6", "2.7.8"]
- RUBY_VERSION: ["3.4", "3.3", "3.2", "3.1", "3.0", "2.7"]
ARCHITECTURE: ["amd64", "arm64"]
script:
- docker pull $RUBY_CUSTOM_IMAGE_BASE/$RUBY_VERSION-$ARCHITECTURE:$CI_PIPELINE_ID
Expand Down Expand Up @@ -92,7 +92,8 @@ install-dependencies:
tags: [ "arch:$ARCH" ]
parallel:
matrix:
- RUBY_VERSION: ["2.7.8", "3.0.6", "3.1.4", "3.2.2"]
# Promote again when adding 3.4 support
- RUBY_VERSION: ["3.3", "3.2", "3.1", "3.0", "2.7"]
ARCH: [ "amd64", "arm64" ]
stage: package
needs:
Expand Down
1 change: 1 addition & 0 deletions .gitlab/Dockerfile-2.7
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM ghcr.io/datadog/images-rb/engines/ruby:2.7-centos-gcc
94 changes: 0 additions & 94 deletions .gitlab/Dockerfile-2.7.8

This file was deleted.

1 change: 1 addition & 0 deletions .gitlab/Dockerfile-3.0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM ghcr.io/datadog/images-rb/engines/ruby:3.0-centos-gcc
94 changes: 0 additions & 94 deletions .gitlab/Dockerfile-3.0.6

This file was deleted.

1 change: 1 addition & 0 deletions .gitlab/Dockerfile-3.1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM ghcr.io/datadog/images-rb/engines/ruby:3.1-centos-gcc
Loading

0 comments on commit f2abaf0

Please sign in to comment.