Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: run ddapm-test-agent in docker #291

Closed
wants to merge 6 commits into from

Conversation

rarguelloF
Copy link
Contributor

@rarguelloF rarguelloF commented Sep 23, 2024

What

This PR changes the setup of ddapm-test-agent from running in a python subprocess to a shared docker container.

Motivation

I've observed flakiness in integration tests with the following error:

gen_test.go:26: 
        	Error Trace:	/home/runner/work/orchestrion/orchestrion/_integration-tests/utils/suite.go:70
        	            				/home/runner/work/orchestrion/orchestrion/_integration-tests/tests/gocql/gen_test.go:26
        	Error:      	Received unexpected error:
        	            	Get "http://127.0.0.1:32779/test/session/start?test_session_token=8dd45585-440c-446f-886e-2ec732e7756b": context deadline exceeded
        	Test:       	TestIntegration_gocql_StructLiteralPtr

Running the agent using testcontainers should provide a better way to manage the lifecycle of the agent process, so we don't attempt to run the test when the agent is not ready or not running at all.

This change also simplifies the setup as python is no longer required and allows to run tests concurrently using the same agent by configuring the http client used by the tracer to set the X-Datadog-Test-Session-Token header for every request.

I opened an alternative PR with an very basic implementation of the mock agent in Go that should provide similar benefits, in case we are not interested in the extra features the ddapm-test-agent provides.

Copy link
Contributor

@RomainMuller RomainMuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will beak testing of Windows & macOS variants in GitHub actions (Windows only supports Windows guests, and macOS flat out does not support nested virtualization).

From this perspective, I'd rather go with #282 (it's pure go, fewer dependencies, supports all platforms we wanna target).

@RomainMuller RomainMuller deleted the rarguellof/testagent-docker branch October 30, 2024 14:11
Copy link

codecov bot commented Oct 30, 2024

Codecov Report

Attention: Patch coverage is 98.13084% with 2 lines in your changes missing coverage. Please review.

Project coverage is 72.45%. Comparing base (1b1f5aa) to head (d3bf423).
Report is 58 commits behind head on main.

Files with missing lines Patch % Lines
_integration-tests/utils/agent/agent.go 97.53% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #291      +/-   ##
==========================================
- Coverage   78.99%   72.45%   -6.55%     
==========================================
  Files         143      145       +2     
  Lines        6738     7914    +1176     
==========================================
+ Hits         5323     5734     +411     
- Misses        984     1763     +779     
+ Partials      431      417      -14     
Components Coverage Δ
Generators 76.69% <ø> (-1.58%) ⬇️
Instruments 88.05% <ø> (ø)
Go Driver 72.81% <ø> (-7.44%) ⬇️
Toolexec Driver 70.88% <ø> (-3.42%) ⬇️
Aspects 71.95% <ø> (-7.20%) ⬇️
Injector 73.42% <ø> (-5.24%) ⬇️
Job Server 63.20% <ø> (-5.63%) ⬇️
Integration Test Suite 83.65% <98.13%> (-8.99%) ⬇️
Other 72.45% <98.13%> (-6.55%) ⬇️
Files with missing lines Coverage Δ
_integration-tests/tests/aws.v1/aws.go 89.18% <100.00%> (-10.82%) ⬇️
_integration-tests/tests/aws.v2/base.go 93.87% <100.00%> (-6.13%) ⬇️
_integration-tests/tests/gcp_pubsub/gcp_pubsub.go 85.71% <100.00%> (-14.29%) ⬇️
_integration-tests/tests/go-redis.v7/go-redis.go 83.33% <100.00%> (-11.27%) ⬇️
_integration-tests/tests/go-redis.v8/go-redis.go 83.33% <100.00%> (-11.27%) ⬇️
_integration-tests/tests/go-redis.v9/go-redis.go 81.17% <100.00%> (-13.50%) ⬇️
_integration-tests/tests/gocql/base.go 88.11% <100.00%> (-11.89%) ⬇️
_integration-tests/tests/ibm_sarama/ibm_sarama.go 81.91% <100.00%> (-7.62%) ⬇️
_integration-tests/tests/mongo/mongo.go 77.50% <100.00%> (-13.68%) ⬇️
_integration-tests/tests/redigo/redigo.go 80.00% <100.00%> (-9.89%) ⬇️
... and 6 more

... and 111 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants