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

Dogfood recent changes #666

Merged
merged 69 commits into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from 65 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
db6ec1e
RUMM-1706: RUM Resource scope should provide optional value type to t…
0xnm Oct 13, 2021
3ddc302
RUMM-1667 Add `.release.py` tool to replace Bash scripts
ncreated Oct 13, 2021
9204645
Merge pull request #635 from DataDog/nogorodnikov/rumm-1706/allow-opt…
0xnm Oct 14, 2021
34e469a
RUMM-1667 Configure CI to start two simultaneous publishing jobs
ncreated Oct 14, 2021
e79b1c7
RUMM-1667 Cleanup
ncreated Oct 14, 2021
922357c
RUMM-1667 Reset debugging setup
ncreated Oct 14, 2021
5874718
RUMM-1086 Fix: Long task start date calculated properly
buranmert Oct 14, 2021
86300a0
RUMM-1667 CR fixes
ncreated Oct 14, 2021
84b6512
Merge pull request #637 from DataDog/buranmert/RUMM-1086-fix-long-tas…
buranmert Oct 14, 2021
96925bf
RUMM-1596 Add crash fixture for infinite recursive call
ncreated Sep 6, 2021
1a58f95
RUMM-1090 Rename `Log*` to `LogEvent*`
maxep Oct 11, 2021
ef2bee2
RUMM-1090 Make `LogEvent`
maxep Oct 11, 2021
f87355a
RUMM-1090 Add `LogEventMapper`
maxep Oct 11, 2021
cae4361
RUMM-1090 api surface
maxep Oct 11, 2021
2db296d
RUMM-1596 Remove truncation mark from stack traces exceeding the limit
ncreated Oct 15, 2021
b403768
Merge pull request #640 from DataDog/feature/logs-scrubbing
maxep Oct 15, 2021
48b3d01
RUMM-640 Enhance test for max number of events in file
ncreated Oct 15, 2021
a7aaf77
RUMM-640 Add option to delete all files through files orchestrator
ncreated Oct 15, 2021
a88103e
Merge pull request #641 from DataDog/ncreated/RUMM-1596-recursive-cal…
ncreated Oct 15, 2021
ddbe5a3
RUMM-1667 Always build PLCR from source to produce minimal slice in G…
ncreated Oct 18, 2021
0ebcb7f
Merge pull request #636 from DataDog/ncreated/RUMM-1667-fix-release-a…
ncreated Oct 18, 2021
3227a22
RUMM-640 Add `DataOrchestrator` which manages data in two directories
ncreated Oct 19, 2021
c478574
RUMM-640 Clean up `FileReader` from testing extension code
ncreated Oct 19, 2021
bf90aef
RUMM-640 Add public `clearAllData()` API
ncreated Oct 19, 2021
e9a5f01
RUMM-640 Update api-surface
ncreated Oct 19, 2021
429f7e2
RUMM-1378 RUM Manual API E2E Tests
buranmert Oct 11, 2021
68f22d7
RUMM-1378 api-surface annots added to e2e tests
buranmert Oct 19, 2021
0d1fbd1
Merge pull request #625 from DataDog/buranmert/RUMM-1378-e2e-rum
buranmert Oct 19, 2021
eecf29b
Add Custom Global Attributes Reference
alai97 Oct 19, 2021
15d498a
Slice and Dice Crusade
alai97 Oct 19, 2021
dfaaffb
Revert "Slice and Dice Crusade"
alai97 Oct 19, 2021
7bcb52a
Merge pull request #644 from DataDog/ncreated/RUMM-640-add-API-for-cl…
ncreated Oct 20, 2021
22b2dcd
SME Review #1
alai97 Oct 21, 2021
68cbbd5
Update to version 1.0.0 of testing framework
Oct 25, 2021
b249a61
Merge pull request #648 from DataDog/nachoBonafonte/update-to-testing…
Oct 25, 2021
5a6c39c
Slice and Dice Crusade
alai97 Oct 27, 2021
d281e57
Merge pull request #646 from DataDog/alai97/ios-monitoring-global-att…
alai97 Oct 27, 2021
0a62eb2
RUMM-1667: Fix distro tool
buranmert Oct 28, 2021
3f98760
Merge pull request #651 from DataDog/buranmert/RUMM-1667-fix-build-li…
buranmert Nov 2, 2021
93a99d9
RUMM-1718 error.sourceType = ios added
buranmert Oct 28, 2021
a5905e4
RUMM-1718 internalErrorSourceType is added
buranmert Nov 3, 2021
f6f3477
RUMM-1583 Fix retrieving `RUMAction` and `RUMView` attributes
ncreated Nov 3, 2021
6c7d60b
RUMM-1583 Add red tests for retrieving `contextInfo` and `usrInfo` at…
ncreated Nov 4, 2021
45fab64
RUMM-1583 Fix retrieving `contextInfo` and `usrInfo` attributes in Ob…
ncreated Nov 4, 2021
c683734
RUMM-1718 PR comments addressed
buranmert Nov 5, 2021
5db35ab
RUMM-1743 Add workaround to potential iOS 15 crash on `processInfo.is…
ncreated Nov 4, 2021
987d781
Bumped version to 1.7.2
ncreated Nov 5, 2021
5f75d6e
Update to version 1.0.1 of testing framework
Nov 5, 2021
485151c
Merge pull request #636 from DataDog/ncreated/RUMM-1667-fix-release-a…
ncreated Oct 18, 2021
4465be1
Merge pull request #651 from DataDog/buranmert/RUMM-1667-fix-build-li…
buranmert Nov 2, 2021
1b61791
Update CHANGELOG
ncreated Nov 8, 2021
12c31ff
Merge branch 'master' into hotfix/1.7.2
ncreated Nov 8, 2021
7019861
Merge pull request #654 from DataDog/ncreated/RUMM-1583-fix-reading-a…
ncreated Nov 8, 2021
13d3107
Merge pull request #656 from DataDog/nachoBonafonte/update-to-testing…
Nov 8, 2021
57a1e3b
Merge pull request #655 from DataDog/hotfix/1.7.2
ncreated Nov 8, 2021
4627462
RUMM-1718 PR comments addressed
buranmert Nov 8, 2021
eef82d8
Merge pull request #650 from DataDog/buranmert/RUMM-1718-error-source…
buranmert Nov 8, 2021
56af3d7
RUMM-1709 Gather all cross-platform attributes in a single place
ncreated Nov 9, 2021
8acb414
RUMM-1709 Add option to override `sdkVersion` with `_dd.sdk_version` …
ncreated Nov 9, 2021
44cf006
RUMM-1709 Update release tooling to the new format of `Versioning.swift`
ncreated Nov 9, 2021
73b6c6d
RUMM-640 Fix flaky test in `DatadogTests`
ncreated Nov 9, 2021
6b735fb
Merge pull request #659 from DataDog/ncreated/RUMM-640-fix-test-flaki…
ncreated Nov 10, 2021
3c129dd
RUMM-1770 test_repetition_mode is added for Xcode 13 stack
buranmert Nov 15, 2021
617911e
Merge pull request #658 from DataDog/ncreated/RUMM-1709-allow-changin…
ncreated Nov 16, 2021
690e326
RUMM-1763 Read `_dd.error.is_crash` crossplatform attribute
maxep Nov 16, 2021
90a7ab3
Merge pull request #662 from DataDog/buranmert/RUMM-1770-update-bitri…
buranmert Nov 17, 2021
79d8942
Merge pull request #665 from DataDog/maxep/RUMM-1763/cross-platform-c…
maxep Nov 17, 2021
ba21882
RUMM-1763 Run test on view scope instead of resource
maxep Nov 18, 2021
5d57899
Merge pull request #667 from DataDog/maxep/RUMM-1763/cross-platform-c…
maxep Nov 18, 2021
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
17 changes: 15 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# 1.7.2 / 11-8-2021

### Changes

* [BUGFIX] Fix iOS 15 crash related to `ProcessInfo.isLowPowerModeEnabled`. See [#609][] #655 (Thanks [@pingd][])

# 1.7.1 / 10-4-2021

### Changes

* [BUGFIX] Fix iOS 15 crash in `MobileDevice.swift`. See #609 #613 (Thanks @arnauddorgans, @earltedly)
* [BUGFIX] RUM: Fix bug with "Refresh Rate" Mobile Vital reporting very low values. #608
* [BUGFIX] Fix iOS 15 crash in `MobileDevice.swift`. See [#609][] #613 (Thanks [@arnauddorgans][], [@earltedly][])
* [BUGFIX] RUM: Fix bug with "Refresh Rate" Mobile Vital reporting very low values. [#608][]

# 1.7.0 / 09-27-2021

Expand Down Expand Up @@ -241,13 +247,19 @@
[#547]: https://github.com/DataDog/dd-sdk-ios/issues/547
[#575]: https://github.com/DataDog/dd-sdk-ios/issues/575
[#583]: https://github.com/DataDog/dd-sdk-ios/issues/583
[#608]: https://github.com/DataDog/dd-sdk-ios/issues/608
[#609]: https://github.com/DataDog/dd-sdk-ios/issues/609
[#613]: https://github.com/DataDog/dd-sdk-ios/issues/613
[#655]: https://github.com/DataDog/dd-sdk-ios/issues/655
[@00FA9A]: https://github.com/00FA9A
[@Britton-Earnin]: https://github.com/Britton-Earnin
[@Hengyu]: https://github.com/Hengyu
[@LeffelMania]: https://github.com/LeffelMania
[@SimpleApp]: https://github.com/SimpleApp
[@TsvetelinVladimirov]: https://github.com/TsvetelinVladimirov
[@arnauddorgans]: https://github.com/arnauddorgans
[@ben-yolabs]: https://github.com/ben-yolabs
[@earltedly]: https://github.com/earltedly
[@flobories]: https://github.com/flobories
[@hyling]: https://github.com/hyling
[@jegnux]: https://github.com/jegnux
Expand All @@ -257,5 +269,6 @@
[@lmramirez]: https://github.com/lmramirez
[@marcusway]: https://github.com/marcusway
[@philtre]: https://github.com/philtre
[@pingd]: https://github.com/pingd
[@provTheodoreNewell]: https://github.com/provTheodoreNewell
[@sdejesusF]: https://github.com/sdejesusF
80 changes: 68 additions & 12 deletions Datadog/Datadog.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions Datadog/E2ETests/E2EUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ struct DD {
// MARK: - Logging-specific

static let loggerInitialize = "logs_logger_initialize"

// MARK: - RUM-specific

static let rumAttributeAddAttribute = "rum_globalrum_add_attribute"
static let rumAttributeRemoveAttribute = "rum_globalrum_remove_attribute"
}

// MARK: - Special Attributes
Expand Down
309 changes: 309 additions & 0 deletions Datadog/E2ETests/RUM/RUMGlobalE2ETests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,309 @@
/*
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2019-2020 Datadog, Inc.
*/

import Foundation
import Datadog

class RUMGlobalE2ETests: E2ETests {
private lazy var rum = Global.rum.dd

// MARK: - Common Monitors

/// ```apm
/// $feature = rum
/// $monitor_id = rum_globalrum_add_attribute
/// $monitor_name = "[RUM] [iOS] Nightly Performance - rum_globalrum_add_attribute: has a high average execution time"
/// $monitor_query = "sum(last_1d):avg:trace.perf_measure{env:instrumentation,resource_name:rum_globalrum_add_attribute,service:com.datadog.ios.nightly} > 0.024"
/// $monitor_threshold = 0.024
/// ```
///
/// ```apm
/// $feature = rum
/// $monitor_id = rum_globalrum_remove_attribute
/// $monitor_name = "[RUM] [iOS] Nightly Performance - rum_globalrum_remove_attribute: has a high average execution time"
/// $monitor_query = "sum(last_1d):avg:trace.perf_measure{env:instrumentation,resource_name:rum_globalrum_remove_attribute,service:com.datadog.ios.nightly} > 0.024"
/// $monitor_threshold = 0.024
/// ```

// MARK: - RUM manual APIs

/// - api-surface: DDRUMMonitor.addAttribute(forKey key: AttributeKey, value: AttributeValue)
///
/// - data monitor:
/// ```rum
/// $monitor_id = rum_globalrum_add_attribute_for_view
/// $monitor_name = "[RUM] [iOS] Nightly - rum_globalrum_add_attribute_for_view: number of views is below expected value"
/// $monitor_query = "rum(\"service:com.datadog.ios.nightly @context.test_method_name:rum_globalrum_add_attribute_for_view @type:view @view.name:rumView* @view.url_path:datadog\\/rum* @context.custom_attribute.int:* @context.custom_attribute.string:*\").rollup(\"count\").last(\"1d\") < 1"
/// ```
func test_rum_globalrum_add_attribute_for_view() {
let viewKey = String.mockRandom()
let viewName = String.mockRandom()
let strAttrValue = String.mockRandom()
let intAttrValue = Int.mockRandom()

measure(resourceName: DD.PerfSpanName.rumAttributeAddAttribute) {
rum.addAttribute(forKey: RUMConstants.customAttribute_String, value: strAttrValue)
}
measure(resourceName: DD.PerfSpanName.rumAttributeAddAttribute) {
rum.addAttribute(forKey: RUMConstants.customAttribute_Int, value: intAttrValue)
}

rum.startView(key: viewKey, name: viewName, attributes: DD.logAttributes())
rum.stopView(key: viewKey, attributes: [:])
}

/// - api-surface: DDRUMMonitor.removeAttribute(forKey key: AttributeKey)
///
/// - data monitor:
/// ```rum
/// $monitor_id = rum_globalrum_remove_attribute_for_view
/// $monitor_name = "[RUM] [iOS] Nightly - rum_globalrum_remove_attribute_for_view: number of views is above expected value"
/// $monitor_query = "rum(\"service:com.datadog.ios.nightly @context.test_method_name:rum_globalrum_remove_attribute_for_view @type:view @view.name:rumView* @view.url_path:datadog\\/rum* @context.custom_attribute.int:* @context.custom_attribute.string:*\").rollup(\"count\").last(\"1d\") > 0"
/// $monitor_threshold = 0.0
/// ```
func test_rum_globalrum_remove_attribute_for_view() {
let viewKey = String.mockRandom()
let viewName = String.mockRandom()
let strAttrValue = String.mockRandom()
let intAttrValue = Int.mockRandom()

rum.addAttribute(forKey: RUMConstants.customAttribute_String, value: strAttrValue)
rum.addAttribute(forKey: RUMConstants.customAttribute_Int, value: intAttrValue)

measure(resourceName: DD.PerfSpanName.rumAttributeRemoveAttribute) {
rum.removeAttribute(forKey: RUMConstants.customAttribute_String)
}
measure(resourceName: DD.PerfSpanName.rumAttributeRemoveAttribute) {
rum.removeAttribute(forKey: RUMConstants.customAttribute_Int)
}

rum.startView(key: viewKey, name: viewName, attributes: DD.logAttributes())
rum.stopView(key: viewKey, attributes: [:])
}

/// - api-surface: DDRUMMonitor.addAttribute(forKey key: AttributeKey, value: AttributeValue)
///
/// - data monitor:
/// ```rum
/// $monitor_id = rum_globalrum_add_attribute_for_action
/// $monitor_name = "[RUM] [iOS] Nightly - rum_globalrum_add_attribute_for_action: number of actions is below expected value"
/// $monitor_query = "rum(\"service:com.datadog.ios.nightly @context.test_method_name:rum_globalrum_add_attribute_for_action @type:action @context.custom_attribute.int:* @context.custom_attribute.string:*\").rollup(\"count\").last(\"1d\") < 1"
/// ```
func test_rum_globalrum_add_attribute_for_action() {
let viewKey = String.mockRandom()
let viewName = String.mockRandom()
let actionName = String.mockRandom()
let strAttrValue = String.mockRandom()
let intAttrValue = Int.mockRandom()

measure(resourceName: DD.PerfSpanName.rumAttributeAddAttribute) {
rum.addAttribute(forKey: RUMConstants.customAttribute_String, value: strAttrValue)
}
measure(resourceName: DD.PerfSpanName.rumAttributeAddAttribute) {
rum.addAttribute(forKey: RUMConstants.customAttribute_Int, value: intAttrValue)
}

rum.startView(key: viewKey, name: viewName, attributes: DD.logAttributes())

rum.addUserAction(type: .custom, name: actionName, attributes: DD.logAttributes())
Thread.sleep(forTimeInterval: RUMConstants.actionInactivityThreshold)

rum.stopView(key: viewKey, attributes: [:])

rum.removeAttribute(forKey: RUMConstants.customAttribute_String)
rum.removeAttribute(forKey: RUMConstants.customAttribute_Int)
}

/// - api-surface: DDRUMMonitor.removeAttribute(forKey key: AttributeKey)
///
/// - data monitor:
/// ```rum
/// $monitor_id = rum_globalrum_remove_attribute_for_action
/// $monitor_name = "[RUM] [iOS] Nightly - rum_globalrum_remove_attribute_for_action: number of actions is below expected value"
/// $monitor_query = "rum(\"service:com.datadog.ios.nightly @context.test_method_name:rum_globalrum_remove_attribute_for_action @type:action @context.custom_attribute.int:* @context.custom_attribute.string:*\").rollup(\"count\").last(\"1d\") < 1"
/// ```
func test_rum_globalrum_remove_attribute_for_action() {
let viewKey = String.mockRandom()
let viewName = String.mockRandom()
let actionName = String.mockRandom()
let strAttrValue = String.mockRandom()
let intAttrValue = Int.mockRandom()

rum.startView(key: viewKey, name: viewName, attributes: DD.logAttributes())

rum.addAttribute(forKey: RUMConstants.customAttribute_String, value: strAttrValue)
rum.addAttribute(forKey: RUMConstants.customAttribute_Int, value: intAttrValue)

measure(resourceName: DD.PerfSpanName.rumAttributeRemoveAttribute) {
rum.removeAttribute(forKey: RUMConstants.customAttribute_String)
}

measure(resourceName: DD.PerfSpanName.rumAttributeRemoveAttribute) {
rum.removeAttribute(forKey: RUMConstants.customAttribute_Int)
}

rum.addUserAction(type: .custom, name: actionName, attributes: DD.logAttributes())
Thread.sleep(forTimeInterval: RUMConstants.actionInactivityThreshold)

rum.stopView(key: viewKey, attributes: [:])
}

/// - api-surface: DDRUMMonitor.addAttribute(forKey key: AttributeKey, value: AttributeValue)
///
/// - data monitor:
/// ```rum
/// $monitor_id = rum_globalrum_add_attribute_for_resource
/// $monitor_name = "[RUM] [iOS] Nightly - rum_globalrum_add_attribute_for_resource: number of actions is below expected value"
/// $monitor_query = "rum(\"service:com.datadog.ios.nightly @context.test_method_name:rum_globalrum_add_attribute_for_resource @type:resource @context.custom_attribute.int:* @context.custom_attribute.string:*\").rollup(\"count\").last(\"1d\") < 1"
/// ```
func test_rum_globalrum_add_attribute_for_resource() {
let viewKey = String.mockRandom()
let viewName = String.mockRandom()
let resourceKey = String.mockRandom()
let strAttrValue = String.mockRandom()
let intAttrValue = Int.mockRandom()

rum.startView(key: viewKey, name: viewName, attributes: DD.logAttributes())

measure(resourceName: DD.PerfSpanName.rumAttributeAddAttribute) {
rum.addAttribute(forKey: RUMConstants.customAttribute_String, value: strAttrValue)
}
measure(resourceName: DD.PerfSpanName.rumAttributeAddAttribute) {
rum.addAttribute(forKey: RUMConstants.customAttribute_Int, value: intAttrValue)
}

rum.startResourceLoading(
resourceKey: resourceKey,
httpMethod: .get,
urlString: String.mockRandom(),
attributes: DD.logAttributes()
)
Thread.sleep(forTimeInterval: RUMConstants.writeDelay)

rum.stopView(key: viewKey, attributes: [:])

rum.removeAttribute(forKey: RUMConstants.customAttribute_String)
rum.removeAttribute(forKey: RUMConstants.customAttribute_Int)
}

/// - api-surface: DDRUMMonitor.removeAttribute(forKey key: AttributeKey)
///
/// - data monitor:
/// ```rum
/// $monitor_id = rum_globalrum_remove_attribute_for_resource
/// $monitor_name = "[RUM] [iOS] Nightly - rum_globalrum_remove_attribute_for_resource: number of actions is below expected value"
/// $monitor_query = "rum(\"service:com.datadog.ios.nightly @context.test_method_name:rum_globalrum_remove_attribute_for_resource @type:resource @context.custom_attribute.int:* @context.custom_attribute.string:*\").rollup(\"count\").last(\"1d\") < 1"
/// ```
func test_rum_globalrum_remove_attribute_for_resource() {
let viewKey = String.mockRandom()
let viewName = String.mockRandom()
let resourceKey = String.mockRandom()
let strAttrValue = String.mockRandom()
let intAttrValue = Int.mockRandom()

rum.startView(key: viewKey, name: viewName, attributes: DD.logAttributes())

rum.addAttribute(forKey: RUMConstants.customAttribute_String, value: strAttrValue)
rum.addAttribute(forKey: RUMConstants.customAttribute_Int, value: intAttrValue)

measure(resourceName: DD.PerfSpanName.rumAttributeRemoveAttribute) {
rum.removeAttribute(forKey: RUMConstants.customAttribute_String)
}
measure(resourceName: DD.PerfSpanName.rumAttributeRemoveAttribute) {
rum.removeAttribute(forKey: RUMConstants.customAttribute_Int)
}

rum.startResourceLoading(
resourceKey: resourceKey,
httpMethod: .get,
urlString: String.mockRandom(),
attributes: DD.logAttributes()
)
Thread.sleep(forTimeInterval: RUMConstants.writeDelay)

rum.stopView(key: viewKey, attributes: [:])
}

/// - api-surface: DDRUMMonitor.addAttribute(forKey key: AttributeKey, value: AttributeValue)
///
/// - data monitor:
/// ```rum
/// $monitor_id = rum_globalrum_add_attribute_for_error
/// $monitor_name = "[RUM] [iOS] Nightly - rum_globalrum_add_attribute_for_error: number of actions is below expected value"
/// $monitor_query = "rum(\"service:com.datadog.ios.nightly @context.test_method_name:rum_globalrum_add_attribute_for_error @type:resource @context.custom_attribute.int:* @context.custom_attribute.string:*\").rollup(\"count\").last(\"1d\") < 1"
/// ```
func test_rum_globalrum_add_attribute_for_error() {
let viewKey = String.mockRandom()
let viewName = String.mockRandom()
let errorMessage = String.mockRandom()
let strAttrValue = String.mockRandom()
let intAttrValue = Int.mockRandom()

rum.startView(key: viewKey, name: viewName, attributes: DD.logAttributes())

measure(resourceName: DD.PerfSpanName.rumAttributeAddAttribute) {
rum.addAttribute(forKey: RUMConstants.customAttribute_String, value: strAttrValue)
}
measure(resourceName: DD.PerfSpanName.rumAttributeAddAttribute) {
rum.addAttribute(forKey: RUMConstants.customAttribute_Int, value: intAttrValue)
}

rum.addError(
message: errorMessage,
source: .source,
stack: nil,
attributes: DD.logAttributes(),
file: nil,
line: nil
)
Thread.sleep(forTimeInterval: RUMConstants.writeDelay)

rum.stopView(key: viewKey, attributes: [:])

rum.removeAttribute(forKey: RUMConstants.customAttribute_String)
rum.removeAttribute(forKey: RUMConstants.customAttribute_Int)
}

/// - api-surface: DDRUMMonitor.removeAttribute(forKey key: AttributeKey)
///
/// - data monitor:
/// ```rum
/// $monitor_id = rum_globalrum_remove_attribute_for_error
/// $monitor_name = "[RUM] [iOS] Nightly - rum_globalrum_remove_attribute_for_error: number of actions is below expected value"
/// $monitor_query = "rum(\"service:com.datadog.ios.nightly @context.test_method_name:rum_globalrum_remove_attribute_for_error @type:resource @context.custom_attribute.int:* @context.custom_attribute.string:*\").rollup(\"count\").last(\"1d\") < 1"
/// ```
func test_rum_globalrum_remove_attribute_for_error() {
let viewKey = String.mockRandom()
let viewName = String.mockRandom()
let errorMessage = String.mockRandom()
let strAttrValue = String.mockRandom()
let intAttrValue = Int.mockRandom()

rum.startView(key: viewKey, name: viewName, attributes: DD.logAttributes())

rum.addAttribute(forKey: RUMConstants.customAttribute_String, value: strAttrValue)
rum.addAttribute(forKey: RUMConstants.customAttribute_Int, value: intAttrValue)

measure(resourceName: DD.PerfSpanName.rumAttributeRemoveAttribute) {
rum.removeAttribute(forKey: RUMConstants.customAttribute_String)
}
measure(resourceName: DD.PerfSpanName.rumAttributeRemoveAttribute) {
rum.removeAttribute(forKey: RUMConstants.customAttribute_Int)
}

rum.addError(
message: errorMessage,
source: .source,
stack: nil,
attributes: DD.logAttributes(),
file: nil,
line: nil
)
Thread.sleep(forTimeInterval: RUMConstants.writeDelay)

rum.stopView(key: viewKey, attributes: [:])
}
}
Loading