Skip to content

Restructuring integration tests - #899

Open
rithikanarayan wants to merge 13 commits into
mainfrom
rithika.narayan/APMSVLS-728
Open

rithikanarayan wants to merge 13 commits into
mainfrom
rithika.narayan/APMSVLS-728

Conversation

@rithikanarayan

@rithikanarayan rithikanarayan commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Refactors the integration tests to be more assertion-based than snapshot based and also changes deployment from the serverless framework to use the AWS SAM.

The new integration job will be turned off while the old ones are still there to keep costs down.

Motivation

Follow up PRs will expand the coverage of the integration tests to include cold start spans, timeout warnings, different Lambda types, and different products beyond APM. This PR sets up the infrastructure for that.

Testing Guidelines

CI.

Additional Notes

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)

Comment thread tests/integration/test_baseline.py Fixed
@datadog-prod-us1-4

datadog-prod-us1-4 Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Pipelines

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 9d8983b | Docs | Give us feedback!

@rithikanarayan
rithikanarayan marked this pull request as ready for review December 4, 2026 17:59
@rithikanarayan
rithikanarayan requested review from a team as code owners December 4, 2026 17:59

@datadog-prod-us1-4 datadog-prod-us1-4 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: FAIL

The CI default enables 32 additional deployment jobs despite the stated opt-in plan. Extension smoke tests on reused stacks can also pass using historical telemetry when the current invocation emits none.

Open Bits AI session

🤖 Bits Code Review · Commit 9d8983b

Comment thread .gitlab-ci.yml

# Opt-in pytest integration suite (integration-test-pytest jobs).
# TODO(APMSVLS-728): set back to "false" before merging.
RUN_PYTEST_INTEGRATION_TESTS: "true"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Keep the replacement integration suite disabled by default

Without an explicit pipeline override, this enables two new integration jobs for each of eight Python runtimes and two architectures: 32 additional AWS stack deployments alongside the existing suite. That adds deployment costs and CI work despite the stated plan to keep the replacement suite disabled. Default this variable to false so the jobs remain opt-in.

Suggested change
RUN_PYTEST_INTEGRATION_TESTS: "true"
RUN_PYTEST_INTEGRATION_TESTS: "false"

React: 👍 useful · 👎 wrong · 😕 unclear · 👀 right, but not acting on it

What each reaction means
  • 👍 Useful: correct, and you're fixing it or will.
  • 👎 Wrong: the finding is incorrect, for example the bug can't happen or the code was misread.
  • 😕 Unclear: you can't tell what it means or why it matters.
  • 👀 Right, not acting: correct, but intended, out of scope for this PR, a known risk, or too minor.

🤖 Bits Code Review · Open Bits AI session

assert inv.function_error is None, inv.response
aws.wait_for_logs(run_settings.region, extension_function, [inv.request_id])

def done(requests):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Scope Extension intake assertions to the current invocation

When INTEGRATION_STACK_NAME reuses a previously successful stack, wait_for_intake reads historical requests that satisfy both the polling predicate and downstream assertions. A focused execution of the original fixture and assertions with mocked CloudWatch logs reproduced both tests passing without any telemetry from the current invocation. Carry a current-invocation boundary or correlation through log collection, and filter both polling and returned payloads so historical data cannot hide a telemetry regression.

React: 👍 useful · 👎 wrong · 😕 unclear · 👀 right, but not acting on it

What each reaction means
  • 👍 Useful: correct, and you're fixing it or will.
  • 👎 Wrong: the finding is incorrect, for example the bug can't happen or the code was misread.
  • 😕 Unclear: you can't tell what it means or why it matters.
  • 👀 Right, not acting: correct, but intended, out of scope for this PR, a known risk, or too minor.

🤖 Bits Code Review · Open Bits AI session

@purple4reina purple4reina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+9,525 seems like a lot of new code... is that because this PR is mostly just copying the existing integration tests to a new dir? So we'd have duplicate code?

A few thoughts I'm having.

  • Should we be copying so much code? I think it's an excellent and far too long overdue task to migrate these integration tests to the new form. But wondering if there's a way that, during this interim period, most of the code can be shared instead of duplicated?
  • Code review makes me want to 😵‍💫. If we do indeed decide to copy the code, maybe do this in two PRs? One to copy and then one to add the new apparatus. Sifting through so many lines of code is tough to find what's new vs what's copied.

This branch has not been deployed

No deployments
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