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

Env Variable TEST_MODE works as expected #909

Merged
merged 6 commits into from
Jun 17, 2021

Conversation

jairmyree
Copy link
Member

@jairmyree jairmyree commented Jun 15, 2021

Enforce that DVR record-playback honors environment variables
Live will ignore recordings and always run live
Record will ignore recordings, run live, and create a new recording
Playback will only play recordings and fail if the recording isn't valid or does not exist.
Closes #906

Enforce that DVR record-playback honors environment variables
@jairmyree jairmyree requested a review from tjprescott June 15, 2021 21:39
@jairmyree jairmyree requested review from mayurid, sacheu and a team as code owners June 15, 2021 21:39
@ghost ghost added the Communication label Jun 15, 2021
Copy link
Member

@tjprescott tjprescott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I'm assuming it depends on a yet-to-be-opened PR against DVR?

@tjprescott
Copy link
Member

Closes #906.

@tjprescott
Copy link
Member

Depends on: tjprescott/DVR#1

jairmyree and others added 3 commits June 17, 2021 12:24
Conflicts:
	sdk/communication/AzureCommunicationChat/AzureCommunicationChat.xcodeproj/xcshareddata/xcschemes/AzureCommunicationChat.xcscheme
Local Changes that need to be removed
Copy link
Member Author

@jairmyree jairmyree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tjprescott Please take a look when you get a chance.

@@ -64,8 +64,14 @@ public class DVRSessionTransport: TransportStage {
}
session = Session(outputDirectory: outputDirectory, cassetteName: cassetteName)
if environmentVariable(forKey: "TEST_MODE", default: "playback") == "record" {
session?.recordMode = .newEpisodes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If in record mode, this should be .all. I don't think we'll use .once or .newEpisodes at all.

@tjprescott tjprescott merged commit 3e94533 into feature/AzureTest Jun 17, 2021
@tjprescott tjprescott deleted the feature/re-record branch June 17, 2021 20:44
tjprescott added a commit that referenced this pull request Jul 27, 2021
* Initial commit for AzureTest.

* AzureTest DVR commit.

* Rename "AzureTestClient" to "ResourceUtilityClient". Eliminate MSAL dependency for AzureTest.

* Add util function to AzureTest to get environment variables (moved out of Chat).

* DVR updates. (#896)

* Update DVR references to point to fork rather than venmo (#903)

* Update DVR references to point to fork rather than venmo.

* Remove static linkage to DVR.

* Recordings on a per-test basis (#904)

* Feature/recording location (#907)

* Environment Variable for sdk root

* Revert project.pbxproj

* Edit to outputDirectory construction

* Env Variable TEST_MODE works as expected (#909)

* Environment Variable for sdk root

Enforce that DVR record-playback honors environment variables

* Environment Variables work as intended with the new DVR updates

* Undo Podfile Changes

Local Changes that need to be removed

* Slight edit to record mode

Co-authored-by: Jair Myree <[email protected]>

* Automated means of creating test resources (#912)

* Add resource group delete operation.

* Progress.

* Project setting fixes.

* Add test-resources.bicep file.

* Update bicep file.

* Target python script in test resource deploy post-script.

* Remove ResourceUtil files and dependencies.

* Revert to previous output style.

* Remove empty environment variable. (#919)

* Injectable test settings  (#924)

* Commit test-settings.plist and git-ignore.

* TestSettings protocol.

* Update Podfile for DVR

* Don't use local DVR

* Chat test updates.

* Add recordings to project.

* Update prepare_chat_tests.py

* Update deployment targets.

* Add podspec.

* Add readme.

* Fix hard-coded links.

* Scrub headings and commit chat test recordings. (#935)

* Remove headers.

* Add scrubbed recordings.

* Feature/scrub subscription ids (#932)

* Major edits toward scrubbing subscription IDs

* Minor edits on scrubbing

* Update sdk/test/AzureTest/Scrubbing.swift

Co-authored-by: Travis Prescott <[email protected]>

* Update sdk/test/AzureTest/Scrubbing.swift

Co-authored-by: Travis Prescott <[email protected]>

* Update sdk/test/AzureTest/Scrubbing.swift

Co-authored-by: Travis Prescott <[email protected]>

* Update sdk/test/AzureTest/Scrubbing.swift

Co-authored-by: Travis Prescott <[email protected]>

* Recommit: Files changes got left out of last commit

* Requested Draft PR changes

* Clean up after rebase

* Testing response scrubbing in progress

* Finished Scrubbing SubscriptionIDs

* Adjustments made to PR based on review comments.

* Edits to PR based on review comments

* Update sdk/test/AzureTest/AzureTestTests/AzureTestTests.swift

Co-authored-by: Travis Prescott <[email protected]>

* More edits based of pr review

* More edits to pr based off of review comments

* More edits to PR based off suggestions in review

* More edits to PR from review comments

* Removed unused functions and extensions

* Edits to PR based off review comments

* Edits to PR from review comments

* Edits based off PR review comments

Co-authored-by: Jair Myree <[email protected]>
Co-authored-by: Travis Prescott <[email protected]>

* RPF: RecordableXCTestCase (#963)

* Add base class for recordable tests.

* Run swiftformat.

* CI fixes.

* Fix podspec source_files.

* Fix project structure.

* Fixes

* Fix broken links.

* CI fixes.

* Remove test-settings.plist reference.

* Re-record tests.

* Fix tests for playback.

Co-authored-by: Jair <[email protected]>
Co-authored-by: Jair Myree <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants