Skip to content

Commit

Permalink
Merge pull request #325 from DataDog/nachoBonafonte/update-to-0.4.0-t…
Browse files Browse the repository at this point in the history
…esting-sdk

Update to DataDogSDKTesting 0.4.0
  • Loading branch information
Ignacio Bonafonte authored Dec 1, 2020
2 parents 0594d47 + c58fe65 commit a92a604
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 36 deletions.
17 changes: 11 additions & 6 deletions Datadog/Datadog.xcodeproj/xcshareddata/xcschemes/Datadog.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<EnvironmentVariable
key = "DD_DISABLE_NETWORK_INSTRUMENTATION"
value = "1"
isEnabled = "YES">
isEnabled = "NO">
</EnvironmentVariable>
<EnvironmentVariable
key = "DD_DISABLE_HEADERS_INJECTION"
Expand All @@ -91,11 +91,6 @@
value = "$(BITRISE_SOURCE_DIR)"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "BITRISE_TRIGGERED_WORKFLOW_ID"
value = "$(BITRISE_TRIGGERED_WORKFLOW_ID)"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "BITRISE_BUILD_NUMBER"
value = "$(BITRISE_BUILD_NUMBER)"
Expand Down Expand Up @@ -131,6 +126,16 @@
value = "$(GIT_CLONE_COMMIT_HASH)"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "BITRISE_APP_TITLE"
value = "$(BITRISE_APP_TITLE)"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "BITRISE_BUILD_SLUG"
value = "$(BITRISE_BUILD_SLUG)"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<CodeCoverageTargets>
<BuildableReference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,6 @@
value = "$(BITRISE_SOURCE_DIR)"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "BITRISE_TRIGGERED_WORKFLOW_ID"
value = "$(BITRISE_TRIGGERED_WORKFLOW_ID)"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "BITRISE_BUILD_NUMBER"
value = "$(BITRISE_BUILD_NUMBER)"
Expand Down Expand Up @@ -166,6 +161,16 @@
value = "$(GIT_CLONE_COMMIT_HASH)"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "BITRISE_APP_TITLE"
value = "$(BITRISE_APP_TITLE)"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "BITRISE_BUILD_SLUG"
value = "$(BITRISE_BUILD_SLUG)"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<Testables>
<TestableReference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,6 @@
value = "$(BITRISE_SOURCE_DIR)"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "BITRISE_TRIGGERED_WORKFLOW_ID"
value = "$(BITRISE_TRIGGERED_WORKFLOW_ID)"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "BITRISE_BUILD_NUMBER"
value = "$(BITRISE_BUILD_NUMBER)"
Expand Down Expand Up @@ -167,6 +162,16 @@
value = "$(GIT_CLONE_COMMIT_HASH)"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "BITRISE_APP_TITLE"
value = "$(BITRISE_APP_TITLE)"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "BITRISE_BUILD_SLUG"
value = "$(BITRISE_BUILD_SLUG)"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<CodeCoverageTargets>
<BuildableReference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<EnvironmentVariable
key = "DD_DISABLE_NETWORK_INSTRUMENTATION"
value = "1"
isEnabled = "YES">
isEnabled = "NO">
</EnvironmentVariable>
<EnvironmentVariable
key = "DD_DISABLE_HEADERS_INJECTION"
Expand All @@ -90,11 +90,6 @@
value = "$(BITRISE_SOURCE_DIR)"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "BITRISE_TRIGGERED_WORKFLOW_ID"
value = "$(BITRISE_TRIGGERED_WORKFLOW_ID)"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "BITRISE_BUILD_NUMBER"
value = "$(BITRISE_BUILD_NUMBER)"
Expand Down Expand Up @@ -130,6 +125,16 @@
value = "$(GIT_CLONE_COMMIT_HASH)"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "BITRISE_APP_TITLE"
value = "$(BITRISE_APP_TITLE)"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "BITRISE_BUILD_SLUG"
value = "$(BITRISE_BUILD_SLUG)"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<CodeCoverageTargets>
<BuildableReference
Expand Down
17 changes: 9 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ tools:
@echo "OK 👌"

# The release version of `dd-sdk-swift-testing` to use for tests instrumentation.
DD_SDK_SWIFT_TESTING_VERSION = 0.3.0
DD_SDK_SWIFT_TESTING_VERSION = 0.4.0

define DD_SDK_TESTING_XCCONFIG_CI
FRAMEWORK_SEARCH_PATHS=$$(inherited) $$(SRCROOT)/../instrumented-tests/\n
LD_RUNPATH_SEARCH_PATHS=$$(inherited) $$(SRCROOT)/../instrumented-tests/\n
FRAMEWORK_SEARCH_PATHS=$$(inherited) $$(SRCROOT)/../instrumented-tests/DatadogSDKTesting.xcframework/ios-arm64_x86_64-simulator/\n
LD_RUNPATH_SEARCH_PATHS=$$(inherited) $$(SRCROOT)/../instrumented-tests/DatadogSDKTesting.xcframework/ios-arm64_x86_64-simulator/\n
OTHER_LDFLAGS=$$(inherited) -framework DatadogSDKTesting\n
DD_TEST_RUNNER=1\n
DD_SDK_SWIFT_TESTING_SERVICE=dd-sdk-ios\n
Expand All @@ -26,11 +26,12 @@ ifeq (${ci}, true)
@echo $$DD_SDK_TESTING_XCCONFIG_CI > xcconfigs/DatadogSDKTesting.local.xcconfig;
endif
@brew install gh
@rm -rf instrumented-tests/DatadogSDKTesting.framework-iphonesimulator.zip
@rm -rf instrumented-tests/DatadogSDKTesting.framework
@gh release download ${DD_SDK_SWIFT_TESTING_VERSION} -D instrumented-tests -R https://github.com/DataDog/dd-sdk-swift-testing -p "DatadogSDKTesting.framework-iphonesimulator.zip"
@unzip instrumented-tests/DatadogSDKTesting.framework-iphonesimulator.zip -d instrumented-tests
@[ -e "instrumented-tests/DatadogSDKTesting.framework" ] && echo "DatadogSDKTesting.framework - OK" || { echo "DatadogSDKTesting.framework - missing"; exit 1; }
@rm -rf instrumented-tests/DatadogSDKTesting.xcframework
@rm -rf instrumented-tests/DatadogSDKTesting.zip
@rm -rf instrumented-tests/LICENSE
@gh release download ${DD_SDK_SWIFT_TESTING_VERSION} -D instrumented-tests -R https://github.com/DataDog/dd-sdk-swift-testing -p "DatadogSDKTesting.zip"
@unzip instrumented-tests/DatadogSDKTesting.zip -d instrumented-tests
@[ -e "instrumented-tests/DatadogSDKTesting.xcframework" ] && echo "DatadogSDKTesting.xcframework - OK" || { echo "DatadogSDKTesting.xcframework - missing"; exit 1; }

xcodeproj-httpservermock:
@echo "⚙️ Generating 'HTTPServerMock.xcodeproj'..."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,8 @@ class RUMResourcesScenarioTests: IntegrationTests, RUMCommonAsserts {
XCTAssertEqual(firstPartyResource1.resource.method, .methodGET)
XCTAssertGreaterThan(firstPartyResource1.resource.duration, 0)

//TEMPORARY workaround for dd-sdk-testing
if ProcessInfo.processInfo.environment["DD_TEST_RUNNER"] == nil {
XCTAssertNil(firstPartyResource1.dd.traceID, "`firstPartyGETResourceURL` should not be traced")
XCTAssertNil(firstPartyResource1.dd.spanID, "`firstPartyGETResourceURL` should not be traced")
}
XCTAssertNil(firstPartyResource1.dd.traceID, "`firstPartyGETResourceURL` should not be traced")
XCTAssertNil(firstPartyResource1.dd.spanID, "`firstPartyGETResourceURL` should not be traced")

let firstPartyResource2 = try XCTUnwrap(
session.viewVisits[0].resourceEvents.first { $0.resource.url == firstPartyPOSTResourceURL.absoluteString },
Expand Down
2 changes: 1 addition & 1 deletion tools/license/check-license.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function files {
-not -path "*Carthage/Build/*" \
-not -path "*Carthage/Checkouts/*" \
-not -path "./tools/generate-models/rum-events-format/*" \
-not -path "./instrumented-tests/DatadogSDKTesting.framework/*" \
-not -path "./instrumented-tests/DatadogSDKTesting.xcframework/*" \
-not -name "OTSpan.swift" \
-not -name "OTFormat.swift" \
-not -name "OTTracer.swift" \
Expand Down

0 comments on commit a92a604

Please sign in to comment.