Skip to content

Commit

Permalink
Feature/recording location (#907)
Browse files Browse the repository at this point in the history
* Environment Variable for sdk root

* Revert project.pbxproj

* Edit to outputDirectory construction
  • Loading branch information
jairmyree authored Jun 16, 2021
1 parent d0b6bf4 commit 6fe29aa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@
<EnvironmentVariables>
<EnvironmentVariable
key = "TEST_MODE"
value = "playback"
value = "record"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "SDK_REPO_ROOT"
value = ""
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
Expand All @@ -53,6 +58,11 @@
value = ""
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = ""
value = ""
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<Testables>
<TestableReference
Expand Down
6 changes: 5 additions & 1 deletion sdk/test/AzureTest/DVRSessionTransport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ public class DVRSessionTransport: TransportStage {

public func open() {
guard session == nil else { return }
session = Session(cassetteName: cassetteName)
let sdkPath = environmentVariable(forKey: "SDK_REPO_ROOT", default: "~")
guard let outputDirectory = URL(string: sdkPath)?.appendingPathComponent("sdk/communication/AzureCommunicationChat/Tests/Recordings").absoluteString else {
fatalError("SDK Path Invalid")
}
session = Session(outputDirectory: outputDirectory, cassetteName: cassetteName)
if environmentVariable(forKey: "TEST_MODE", default: "playback") == "record" {
session?.recordingEnabled = true
session?.beginRecording()
Expand Down

0 comments on commit 6fe29aa

Please sign in to comment.