Skip to content

Comments

test: refactor E2E dependencies (Part 1)#976

Open
Kirdock wants to merge 10 commits intomainfrom
test/refactor-e2e
Open

test: refactor E2E dependencies (Part 1)#976
Kirdock wants to merge 10 commits intomainfrom
test/refactor-e2e

Conversation

@Kirdock
Copy link
Collaborator

@Kirdock Kirdock commented Feb 4, 2026

This is the first PR of multiple. More are incoming later.
This one mostly touches the dependencies of and to V1 resources

Why this PR?

Some E2E tests (e.g., examples) refer to existing objects (e.g., management zones, request attributes, process groups, etc.). As this can easily break if someone just deletes something in the environment, we need to remove hardcoded IDs and create the needed dependencies on demand.

What has changed?

E2E tests are more stable. Changes in the environment will less likely cause E2Es to fail.

How does it do it?

Hardcoded IDs in E2E (examples) are removed, and referenced resources are created via resource or fetched via data source within the example.
This includes

  • management zones
  • request attributes
  • process groups (not fully, but aligned)
  • synthetic locations (private ones are created on demand and public ones are referenced via a data source)
  • synthetic monitors
  • mobile applications
  • dashboards
  • credentials

For dynatrace_calculated_web_metric, I combined the Terraform files. Web applications take longer than 1m30s to create, that's why I decided to join the configs and create them all at once, referring to the same web application

Also changed some payloads.

  • json dashboard: The payload used doesn't depend on installed extensions anymore

How is it tested?

That's literally about tests

How does it affect users?

They will see better documentation if the touched examples are included. They will now see the correct relation between resources or data sources.

Issue: CA-17770

Additional notes:

There is still one small dependency. Process groups can't be manually created. Also, a data source can't be used, as process groups fade out after 3 days, meaning the OneAgent would have to run continuously. Even though process groups time out, they can still be used and queried via ID. Therefore, the best approach here is to provide the process group ID.

This implementation already relies on the created setup-resources of #986

@Kirdock Kirdock marked this pull request as draft February 4, 2026 15:00
@Kirdock Kirdock force-pushed the test/refactor-e2e branch 5 times, most recently from 5a37c74 to 6de3ec4 Compare February 10, 2026 09:01
@Kirdock Kirdock changed the title test: refactor E2E dependencies (Part 1) test: refactor E2E dependencies (for V1 configs) Feb 10, 2026
@Kirdock Kirdock changed the title test: refactor E2E dependencies (for V1 configs) test: refactor E2E dependencies (Part 1) Feb 10, 2026
@Kirdock Kirdock force-pushed the test/refactor-e2e branch 2 times, most recently from 642bab5 to a24d852 Compare February 10, 2026 10:11
@Kirdock Kirdock marked this pull request as ready for review February 10, 2026 10:59
@Kirdock Kirdock marked this pull request as draft February 10, 2026 11:01
@Kirdock Kirdock force-pushed the test/refactor-e2e branch 6 times, most recently from bafc2b0 to ffe75d0 Compare February 19, 2026 08:21
@Kirdock Kirdock marked this pull request as ready for review February 19, 2026 10:32
Process group IDs most probably don't exist on a different tenant. Because they can't be created manually but via the  OneAgent, a data source that matches via a name is the best way forward here
Instead of using a static mobile application ID that may not exist, we are now creating a mobile application first if we need one.
Some resources need additional creation time. Because of that, the "time_sleep" resource is needed, which must also be defined in the ExternalProviders test case options of the TF testing framework. Therefore, the ExternalProviders are now exposed in the test options, so that resources that need them can set them.
… time

Some examples have the same dependency to a certain resource (e.g., request attributes or management zones). Because the creation may take some time, it makes sense to create dependencies once instead for each example. With this the examples are concatenated and executed once. It basically merges several tf files into one
…static one

Instead of using a static browser monitor ID that may not exist, we now create a browser monitor first if needed.
Instead of using a static credential vault ID that may not exist, we now create a dummy credential first if needed.
Instead of using a static geo location ID that may not exist, we are now fetching by name
Instead of using a static dashboard ID that may not exist, we now create one first if needed.
Removes the static request attribute and management zone dependency for `dynatrace_calculated_service_metric` and creates them on demand
The previous dashboard relied on installed extensions and was based on old configurations (not Data Explorer). With this change, it's more independent
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.

1 participant