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

[NR-347440] CFN template validate lambda integration logs #17

Open
wants to merge 30 commits into
base: develop
Choose a base branch
from

Conversation

ahegdeNR
Copy link
Contributor

As part of this pr:

Create events in lambda from s3 and cloudwatch
Validate that logs are getting populated in New Relic on event creation.
Create scripts to fetch and validate logs in New Relic.

@ahegdeNR ahegdeNR self-assigned this Jan 15, 2025
e2e-tests/common-scripts.sh Outdated Show resolved Hide resolved
e2e-tests/common-scripts.sh Outdated Show resolved Hide resolved
.github/workflows/run-e2e-tests.yaml Outdated Show resolved Hide resolved
exit_with_error "Log event with $attribute_key: $attribute_value not found in New Relic. Error Received: $response"
}

validate_logs_not_present() {
Copy link
Contributor

Choose a reason for hiding this comment

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

validate_logs_in_new_relic() and validate_logs_not_present() have common code, can be refactored to one method with a flag.

Copy link
Contributor

Choose a reason for hiding this comment

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

in one method you are trying exponential backoff while in other it's simple retry, should have uniformity.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hrai-nr here it's retrying to check that logs should NOT get sent to new relic. Hence extended retry is not required in my opinion.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree with @hrai-nr about being consistent with retry strategy here.

e2e-tests/common-scripts/logs-scripts.sh Outdated Show resolved Hide resolved
e2e-tests/lambda-cloudwatch-trigger.sh Outdated Show resolved Hide resolved
e2e-tests/lambda-cloudwatch-trigger.sh Show resolved Hide resolved
@hrai-nr
Copy link
Contributor

hrai-nr commented Jan 22, 2025

  1. Test cases for entity synthesis params are missing.
  2. Please add the slack notification code.

@ahegdeNR ahegdeNR requested a review from hrai-nr January 29, 2025 08:56
Copy link
Contributor

@hrai-nr hrai-nr left a comment

Choose a reason for hiding this comment

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

These changes are looking fine, but code to send notification to slack channel is missing, please add that.

hrai-nr
hrai-nr previously approved these changes Feb 3, 2025
hrai-nr
hrai-nr previously approved these changes Feb 3, 2025
Copy link
Contributor

@maya-jha maya-jha left a comment

Choose a reason for hiding this comment

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

Demo to team.

@@ -7,12 +7,51 @@ on:
- main

jobs:
run-e2e-tests:
run-e2e-tests-cloudwatch:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it going to run in parallel?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, all tests will run in parallel

cd ..
./lambda-s3-trigger.sh ${{ matrix.test-case }}

clean-up:
Copy link
Contributor

Choose a reason for hiding this comment

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

What are we doing in cleanup?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cleaning out templates s3 bucket, template artifacts and templates will be removed

.github/workflows/run-e2e-tests.yaml Outdated Show resolved Hide resolved
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
run: |
cd e2e-tests/common-scripts
./build-templates.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

We are building multiple times.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes but since all the tests run in parallel it's going to take the same time as first building and passing build artifacts to parallel running test jobs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me know what you think

Comment on lines 19 to 35
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22'

- name: Install AWS SAM CLI
run: |
pip install aws-sam-cli

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_E2E_ROLE }}
aws-region: us-east-1
Copy link
Contributor

Choose a reason for hiding this comment

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

is it possible to avoid repeating common steps?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@maya-jha but these are required steps in both the test jobs. I cannot add them as a common step and re-use. If you want it specifically in any way let me know.

e2e-tests/common-scripts/entity_synthesis_param.cfg Outdated Show resolved Hide resolved
exit_with_error "Log event with $attribute_key: $attribute_value not found in New Relic. Error Received: $response"
}

validate_logs_not_present() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Agree with @hrai-nr about being consistent with retry strategy here.

e2e-tests/common-scripts/config-file.cfg Outdated Show resolved Hide resolved
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.

3 participants