Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,33 @@ jobs:
name: lint-report
path: lint-report.xml

run-setup:
name: Run Integration Setup
runs-on: ubuntu-latest
steps:
- name: ⬇️ Check out code into the Go module directory
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2

- name: 🛠️ Setup Terraform
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd
with:
terraform_wrapper: false

- name: 🚀 Integration Setup - Terraform Init
working-directory: ./testsetup
run: terraform init

- name: 🚀 Integration Setup - Terraform Apply
working-directory: ./testsetup
env:
TF_VAR_DYNATRACE_ENV_URL: ${{ secrets.DYNATRACE_ENV_URL }}
TF_VAR_DYNATRACE_API_TOKEN: ${{ secrets.DYNATRACE_API_TOKEN }}
run: terraform apply -auto-approve

integration-tests:
name: Integration Tests - ${{ matrix.config.name }}
runs-on: ubuntu-latest
needs: [ run-setup ]
strategy:
fail-fast: false
matrix:
Expand Down
30 changes: 30 additions & 0 deletions testsetup/mobile_application.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
locals {
mobile_application_name = "Application"
}

data "dynatrace_mobile_application" "setup_application" {
name = local.mobile_application_name
}

import {
to = dynatrace_mobile_application.application
for_each = try(data.dynatrace_mobile_application.setup_application.id, null) == null ? [] : [data.dynatrace_mobile_application.setup_application.id]
id = each.value
}

resource "dynatrace_mobile_application" "application" {
name = local.mobile_application_name
beacon_endpoint_type = "INSTRUMENTED_WEB_SERVER"
beacon_endpoint_url = "https://dynatrace.com/dtmb"
application_type = "MOBILE_APPLICATION"
user_session_percentage = 100
apdex {
frustrated = 12000
frustrated_on_error = true
tolerable = 3000
}

lifecycle {
prevent_destroy = true
}
}
13 changes: 13 additions & 0 deletions testsetup/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
terraform {
required_providers {
dynatrace = {
source = "dynatrace-oss/dynatrace"
version = ">=1.90.0"
}
}
}

provider "dynatrace" {
dt_env_url = var.DYNATRACE_ENV_URL
dt_api_token = var.DYNATRACE_API_TOKEN
}
28 changes: 28 additions & 0 deletions testsetup/synthetic_location.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
locals {
location_name = "Location"
}

data "dynatrace_synthetic_location" "location" {
name = local.location_name
}

import {
to = dynatrace_synthetic_location.location
for_each = try(data.dynatrace_synthetic_location.location.id, null) == null ? [] : [data.dynatrace_synthetic_location.location.id]
id = each.value
}

resource "dynatrace_synthetic_location" "location" {
name = local.location_name
city = "San Francisco de Asis"
country_code = "VE"
region_code = "04"
deployment_type = "STANDARD"
latitude = 10.0756
location_node_outage_delay_in_minutes = 3
longitude = -67.5442

lifecycle {
prevent_destroy = true
}
}
10 changes: 10 additions & 0 deletions testsetup/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
variable "DYNATRACE_API_TOKEN" {
type = string
description = "Dynatrace API Token with appropriate permissions."
sensitive = true
}

variable "DYNATRACE_ENV_URL" {
type = string
description = "Dynatrace Environment URL."
}
Loading