-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat(e2e): Add ECS E2E testing infrastructure and test suites #44061
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
Draft
JLineaweaver
wants to merge
76
commits into
main
Choose a base branch
from
jlineaweaver/exp-133
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
76 commits
Select commit
Hold shift + click to select a range
4f42cef
feat(e2e): Add comprehensive ECS E2E testing infrastructure and test …
JLineaweaver 3c00ebc
fix(e2e): Use correct TaskDefinitionVolume types for ECS apps
JLineaweaver 9c65a28
refactor(e2e): Consolidate ECS tests into dedicated ecs/ folder
JLineaweaver 05e3f4c
fix(e2e): Fix syntax errors in ECS test provisioner setup
JLineaweaver e006957
docs(releasenotes): Add release note for comprehensive ECS E2E testin…
JLineaweaver fdac5e2
docs: Update team ownership from containers/orchestrator to ecs-exper…
JLineaweaver 5aae952
fix(e2e): Fix ECS test compilation errors
JLineaweaver 2beff2b
refactor(e2e): Move test helpers to non-test files to fix import cycle
JLineaweaver 8b6147a
fix(e2e): Refactor ECS tests to use helper functions for metrics/logs
JLineaweaver d0459c6
fix(e2e): Complete ECS test refactoring - replace private API calls w…
JLineaweaver f7f027c
docs(e2e): Update ECS README with current API methods
JLineaweaver 96682c0
refactor(e2e): Move BaseSuite to ECS package and restore containers f…
JLineaweaver ed8a23e
refactor(e2e): Complete ECS test migration from containers to ecs pac…
JLineaweaver eb363fa
refactor(e2e): Apply Go code review fixes to ECS APM tests
JLineaweaver b3ddf58
fix(e2e): Remove unused imports from apm_test.go
JLineaweaver 68bdc7c
fix(e2e): Fix linter issues in ECS and containers tests
JLineaweaver db0d1ae
ci(e2e): Add dedicated ECS test job and remove old TestECSSuite
JLineaweaver a247410
fix(e2e): Rename helper methods from Test* to Assert* to prevent test…
JLineaweaver e9094f7
fix(e2e): Add wait for ECS container instances before creating services
JLineaweaver 72d99c9
fix(e2e): Increase ECS node group to 2 instances for static port mapp…
JLineaweaver 194b80d
fix(e2e): Configure APM endpoint for FakeIntake in ECS tests
JLineaweaver 1be4c44
fix(e2e): Configure primary metrics endpoint (DD_URL) for FakeIntake
JLineaweaver 94a08cc
fix(e2e): Remove logs component telemetry check from readiness test
JLineaweaver 5d05f92
feat(e2e): Add DD_SERVICE, DD_ENV, DD_VERSION to ECS workloads
JLineaweaver b50b494
fix(e2e): Remove component telemetry checks from managed instance hea…
JLineaweaver 8e46b2d
Add Docker labels for service/env/version tagging on container metrics
JLineaweaver d0c7bd2
Add expected service/env/version tags to EC2 log tests
JLineaweaver f36395c
Fix gofmt formatting in checks_test.go
JLineaweaver 050a956
fix(e2e): Update managed tests to use ECS task tags instead of host tags
JLineaweaver 1d28ddf
fix(e2e): Fix nginx EC2 log collection test filter
JLineaweaver 68d33f8
fix(e2e): Fix platform test failures in ECS tests
JLineaweaver 2cd3d9d
fix(e2e): Add Docker labels to tracegen containers for ECS metadata t…
JLineaweaver 6b5fdb1
fix(e2e): Correct APM test expectations for trace tags
JLineaweaver cca32a3
fix(e2e): Enable ECS metadata tagging for APM traces
JLineaweaver 14117cb
fix(e2e): Remove invalid DD_APM_TAG_CARDINALITY setting
JLineaweaver f4624ed
fix(e2e): Enable APM container tag enrichment for ECS metadata tags o…
JLineaweaver 10e1c78
fix(e2e): Correct environment variable name for container proc root
JLineaweaver a51f74e
Add debug logging to investigate APM trace enrichment
JLineaweaver e0c02b8
fix(e2e): Check TracerPayload.Tags for ECS container tags in APM tests
JLineaweaver 163a6ad
Merge remote-tracking branch 'origin/main' into jlineaweaver/exp-133
JLineaweaver 01be35e
ci: Add ECS e2e test suite to GitLab CI pipeline
JLineaweaver b357301
fix(e2e): Add Test00UpAndRunning warmup test to ECS test suites
JLineaweaver 11fba4d
fix(e2e): Disable DD_APM_ENABLE_CONTAINER_TAGS_BUFFER for individual …
JLineaweaver 371831d
fix(e2e): Correct trace-agent component metric prefix in APM health c…
JLineaweaver 450ea33
fix(e2e): Remove ecs_launch_type assertion from managed instance test
JLineaweaver 794db25
fix(e2e): Update APM tests to expect bundled container tags format
JLineaweaver 623e943
fix(e2e): Fix regex patterns to match bundled container tags correctly
JLineaweaver 06be637
fix(e2e): Revert APM trace tag patterns to match TracerPayload.Tags f…
JLineaweaver 19baddf
fix(e2e): Use bundled tag format for APM trace validation
JLineaweaver cdd19ff
fix(e2e): Fix ECS APM tests to correctly validate bundled container tags
JLineaweaver 7fe5fe1
fix(e2e): Improve bundled container tag pattern matching in ECS tests
JLineaweaver 0bc8fcd
fix(e2e): Use '=' separator in bundled container tag patterns
JLineaweaver f957948
fix(e2e): Revert to ':' separator - base_helpers concatenates with k+…
JLineaweaver efbef83
debug(e2e): Add logging to see actual trace tags during matching
JLineaweaver ca83623
debug(e2e): Add logging to testTrace to debug pattern matching failures
JLineaweaver 53f6d3b
fix(e2e): Use non-greedy regex to avoid matching cluster name in serv…
JLineaweaver e2fac6c
Merge branch 'main' into jlineaweaver/exp-133
JLineaweaver 5fef8a5
fix(e2e): Fix ECS E2E test timeouts and CODEOWNERS lint failure
JLineaweaver 503a989
Merge branch 'main' into jlineaweaver/exp-133
JLineaweaver ec9ea37
fix(e2e): Use container metrics for service/env tag validation
JLineaweaver eb92f02
fix(e2e): PR review cleanup - fix bugs, deduplicate, update README
JLineaweaver 4cf2b35
fix(e2e): Fix gofmt formatting and remove dead helper code
JLineaweaver 51229c7
fix(e2e): Deploy trace-correlated workloads and fix managed instance …
JLineaweaver 1170e6b
fix(e2e): Enable trace-log correlation via tracegen DD_LOGS_INJECTION
JLineaweaver 1b5d53b
fix(e2e): Remove trace-log correlation tests, fix managed trace tag l…
JLineaweaver a101205
Merge branch 'main' into jlineaweaver/exp-133
JLineaweaver 9ac966c
Merge branch 'main' into jlineaweaver/exp-133
JLineaweaver 1c7c5e4
Remove unused ECS test app components
JLineaweaver 948dac1
Fix ECS README test counts and remove stale references
JLineaweaver c1529a8
Clean up hollow ECS E2E tests and restore infrastructure config
JLineaweaver 454c331
Merge remote-tracking branch 'origin/main' into jlineaweaver/exp-133
JLineaweaver e8d76f5
Remove unused testCheckRun from containers base_test.go and tidy go.mod
JLineaweaver 8dbee13
Merge branch 'main' into jlineaweaver/exp-133
JLineaweaver b493323
Merge branch 'main' into jlineaweaver/exp-133
JLineaweaver 9df34af
Fix release note to match actual test suite state
JLineaweaver ac7c6ef
Address PR review feedback for ECS E2E infrastructure
JLineaweaver File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
releasenotes/notes/comprehensive-ecs-e2e-testing-a97556f927570a09.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Each section from every release note are combined when the | ||
| # CHANGELOG.rst is rendered. So the text needs to be worded so that | ||
| # it does not depend on any information only available in another | ||
| # section. This may mean repeating some details, but each section | ||
| # must be readable independently of the other. | ||
| # | ||
| # Each section note must be formatted as reStructuredText. | ||
| --- | ||
| other: | ||
| - | | ||
| Migrated ECS E2E tests into a dedicated test/new-e2e/tests/ecs/ package | ||
| with 4 test suites (18 tests) covering APM/DogStatsD, check autodiscovery, | ||
| platform features, and managed instances. All tests validate specific | ||
| metrics, tags, and traces against regex patterns across Fargate, EC2, | ||
| and Managed Instance deployment types. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| // Unless explicitly stated otherwise all files in this repository are licensed | ||
| // under the Apache License Version 2.0. | ||
| // This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
| // Copyright 2025-present Datadog, Inc. | ||
|
|
||
| package ecs | ||
|
|
||
| import ( | ||
| "context" | ||
| "fmt" | ||
| "time" | ||
|
|
||
| "github.com/DataDog/datadog-agent/test/e2e-framework/resources/aws" | ||
| awssdk "github.com/aws/aws-sdk-go-v2/aws" | ||
| awsconfig "github.com/aws/aws-sdk-go-v2/config" | ||
| "github.com/aws/aws-sdk-go-v2/service/ecs" | ||
| "github.com/pulumi/pulumi/sdk/v3/go/pulumi" | ||
| ) | ||
|
|
||
| // WaitForContainerInstances waits for at least minInstances container instances to be registered | ||
| // in the ECS cluster before returning. Returns the cluster ARN as a StringOutput so it can be | ||
| // used as an implicit dependency for downstream resources. | ||
| func WaitForContainerInstances(e aws.Environment, clusterArn pulumi.StringOutput, minInstances int) pulumi.StringOutput { | ||
| return pulumi.All(clusterArn).ApplyT(func(args []interface{}) (string, error) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| clusterArnStr := args[0].(string) | ||
|
|
||
| ctx := context.Background() | ||
| cfg, err := awsconfig.LoadDefaultConfig(ctx, | ||
| awsconfig.WithRegion(e.Region()), | ||
| awsconfig.WithSharedConfigProfile(e.Profile()), | ||
| ) | ||
| if err != nil { | ||
| return "", fmt.Errorf("failed to load AWS config: %w", err) | ||
| } | ||
|
|
||
| ecsClient := ecs.NewFromConfig(cfg) | ||
|
|
||
| maxWaitTime := 5 * time.Minute | ||
| pollInterval := 10 * time.Second | ||
| startTime := time.Now() | ||
|
|
||
| e.Ctx().Log.Info(fmt.Sprintf("Waiting for at least %d container instance(s) to register in cluster %s", minInstances, clusterArnStr), nil) | ||
|
|
||
| for { | ||
| if time.Since(startTime) > maxWaitTime { | ||
| return "", fmt.Errorf("timeout waiting for container instances after %v", maxWaitTime) | ||
| } | ||
|
|
||
| listOutput, err := ecsClient.ListContainerInstances(ctx, &ecs.ListContainerInstancesInput{ | ||
| Cluster: awssdk.String(clusterArnStr), | ||
| Status: "ACTIVE", | ||
| }) | ||
| if err != nil { | ||
| e.Ctx().Log.Warn(fmt.Sprintf("Failed to list container instances: %v, retrying...", err), nil) | ||
| time.Sleep(pollInterval) | ||
| continue | ||
| } | ||
|
|
||
| registeredCount := len(listOutput.ContainerInstanceArns) | ||
| e.Ctx().Log.Info(fmt.Sprintf("Found %d registered container instance(s) (need %d)", registeredCount, minInstances), nil) | ||
|
|
||
| if registeredCount >= minInstances { | ||
| e.Ctx().Log.Info(fmt.Sprintf("Container instances ready! Found %d instance(s)", registeredCount), nil) | ||
| return clusterArnStr, nil | ||
| } | ||
|
|
||
| e.Ctx().Log.Info(fmt.Sprintf("Waiting %v before checking again...", pollInterval), nil) | ||
| time.Sleep(pollInterval) | ||
| } | ||
| }).(pulumi.StringOutput) | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing
retrydirective onnew-e2e-ecs. All peer jobs (new-e2e-containers-eks,new-e2e-containers-openshift, etc.) explicitly addretry: !reference [.retry_only_infra_failure, retry]. Without it, a single transient AWS failure permanently fails the job.