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

Add AzureTest framework #967

Merged
merged 34 commits into from Jul 27, 2021
Merged

Add AzureTest framework #967

merged 34 commits into from Jul 27, 2021

Conversation

tjprescott
Copy link
Member

@tjprescott tjprescott commented Jul 26, 2021

Adds AzureTest for creating record/playback style tests. Add RecordableXCTestCase to make it easier to add recordable tests.

Documentation provided here:
https://github.com/Azure/azure-sdk-for-ios/wiki/Writing-End-to-End-Tests-using-AzureTest

tjprescott and others added 24 commits June 9, 2021 09:01
* Update DVR references to point to fork rather than venmo.

* Remove static linkage to DVR.
* Environment Variable for sdk root

* Revert project.pbxproj

* Edit to outputDirectory construction
* 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 <t-jairmyree@microsoft.com>
* 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.
* 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.
* Remove headers.

* Add scrubbed recordings.
…o feature/AzureTest

# Conflicts:
#	sdk/communication/AzureCommunicationChat/AzureCommunicationChat.xcodeproj/project.pbxproj
* Major edits toward scrubbing subscription IDs

* Minor edits on scrubbing

* Update sdk/test/AzureTest/Scrubbing.swift

Co-authored-by: Travis Prescott <tjprescott@users.noreply.github.com>

* Update sdk/test/AzureTest/Scrubbing.swift

Co-authored-by: Travis Prescott <tjprescott@users.noreply.github.com>

* Update sdk/test/AzureTest/Scrubbing.swift

Co-authored-by: Travis Prescott <tjprescott@users.noreply.github.com>

* Update sdk/test/AzureTest/Scrubbing.swift

Co-authored-by: Travis Prescott <tjprescott@users.noreply.github.com>

* 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 <tjprescott@users.noreply.github.com>

* 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 <t-jairmyree@microsoft.com>
Co-authored-by: Travis Prescott <tjprescott@users.noreply.github.com>
* Add base class for recordable tests.

* Run swiftformat.
@ghost ghost added the Azure.Core label Jul 26, 2021
@ghost ghost added the Communication label Jul 26, 2021
@check-enforcer
Copy link

This repository is protected by Check Enforcer. The check-enforcer check-run will not pass until there is at least one more check-run successfully passing. Check Enforcer supports the following comment commands:

  • /check-enforcer evaluate; tells Check Enforcer to evaluate this pull request.
  • /check-enforcer override; by-pass Check Enforcer (approvals still required).

@@ -5,36 +5,49 @@

Copy link
Member

Choose a reason for hiding this comment

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

Would this file be better placed in the ACS service directory?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's what I would have preferred if I could have used test-resources-post.py. Absent that, I don't want to clutter the service directory and figured it would be best to keep this in the "normal" spot under eng/scripts.

key = "AZURE_COMMUNICATION_USER_ID_2"
value = ""
key = "SDK_REPO_ROOT"
value = "/Users/travisprescott/repos/azure-sdk-for-ios"
Copy link
Member

Choose a reason for hiding this comment

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

I assume this shouldn't be your windows user path?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is my Mac user directory and yes, it is intentional. Anyone who wants to run the test would need to update this with their own settings, but since the build artifact isn't "aware" of the source directory, it (seemingly) has to be hard coded like this for the recording functionality to work correctly.

@tjprescott tjprescott merged commit b72da16 into main Jul 27, 2021
@tjprescott tjprescott deleted the feature/AzureTest branch July 27, 2021 18:32
@tjprescott tjprescott mentioned this pull request Aug 4, 2021
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.

None yet

3 participants