-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add logs agent integ test #433
Open
varunch77
wants to merge
28
commits into
main
Choose a base branch
from
add-logs-agent-integ-test
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.
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
21aa051
update config files
varunch77 734f8e0
Add integ test for Logs agent
varunch77 5ed1a93
Have the agent sleep after starting it
varunch77 96522cd
update flush time to 90s
varunch77 b98c612
Update flush time to 120 seconds
varunch77 bdd40b9
Add delay to ensure tag deletion propagates
varunch77 43d2ca6
Change order of tests
varunch77 9f28f03
Change order of tests again
varunch77 e1bb9ce
Enable instance metadata tags
varunch77 fd59713
Clean up unused code
varunch77 6e00757
Differentiate sleep times
varunch77 bb229f7
Merge branch 'main' into add-logs-agent-integ-test
varunch77 84cc3d3
Address nits and make minor changes
varunch77 7a3b428
UGet region from EC2 metadata instead of hardcoding
varunch77 e37d84a
Revert EC2 metadata change
varunch77 79744f1
Revert EC2 metadata change
varunch77 7950725
Address misc comments
varunch77 37cb8a5
update code to search for log group directly
varunch77 006a057
Revert to search by prefix
varunch77 eb95406
address comments
varunch77 df7abce
remove unused packageS
varunch77 8dcc2d4
use clients from the awsservice package
varunch77 9f5722b
Merge remote-tracking branch 'origin/main' into add-logs-agent-integ-…
varunch77 6f1e4cf
Make ValidateEntity a common package
varunch77 5bd4a65
modify ValidateLogs to be a function in a common package
varunch77 d116feb
Merge remote-tracking branch 'origin/main' into add-logs-agent-integ-…
varunch77 6c272ee
Increase flush time
varunch77 58f0a88
run linter
varunch77 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 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 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
22 changes: 22 additions & 0 deletions
22
test/cloudwatchlogs/resources/config_log_service_name.json
This file contains 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,22 @@ | ||
{ | ||
"agent": { | ||
"run_as_user": "root", | ||
"debug": true | ||
}, | ||
"logs": { | ||
"logs_collected": { | ||
"files": { | ||
"collect_list": [ | ||
{ | ||
"file_path": "/tmp/cwagent_log_test.log*", | ||
"log_group_name": "{instance_id}", | ||
"log_stream_name": "{instance_id}", | ||
"timezone": "UTC", | ||
"service.name": "service-in-config", | ||
"deployment.environment": "environment-in-config" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
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.
Why not just increase
sleepForFlush
? Do we usesleepForFlush
anywhere else in the code?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.
yeah we use
sleepForFlush
in other places too. For the other test cases, waiting for 180 seconds instead of 20 seconds would be overkill and sometimes results in a timeout as it can cause all the test cases in the file take over an hour to run. This is because we callsleepForFlush
before and after the agent runs and some of the test cases are set to loop multiple times so this extra 160 seconds adds up quickly. We only want the tests to wait for 180 seconds in two places, which is why I just created another variable.