Skip to content

[5.6] Adapt tests to work better in Swift CI (#45) #68

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

Closed
wants to merge 1 commit into from

Conversation

d-ronnqvist
Copy link
Contributor

  • Rationale: The original modified a large number of unit tests. If this is different in main and release/5.6 it increases the chance that a commit from main that's cherry picked onto 5.6 has a conflict in the unit testing code.
  • Risk: Low.
  • Risk Detail: This is almost entirely a change in test code. Minor non-test code changes were made to allow unit tests to pass in custom unique temp directories to code that write temp data.
  • Reward: Low/Medium
  • Reward Details: Minimizes risk of conflicts when cherry picking other work onto the 5.6 release branch.
  • Original PR: Adapt tests to work better in Swift CI #45
  • Issue: rdar://85055022
  • Code Reviewed By: @franklinsch
  • Testing Details: This is almost entirely a change in test code.

* Add utility to create temp directories in unit tests

* Create new target for test utilities

* Pass the temporary directory to ConvertAction

* Re-enable one skipped test

* Update new tests to use `createTemporaryDirectory` helper

* Remove `createDirectoryForLastPathComponent` argument in test helper

* Update test helper documentation

* Prefer `FileManager.temporaryDirectory` property in ConvertAction

* Move `Files` and `Folder` types into test utility target

* Add additional safety checks when creating and removing temporary directories

* Replace `TempFolder` test class with `createTempFolder` test function

* Use XCTUnwrap instead of force unwrap in test helper

* Also shadow `FileManager.temporaryDirectory` in tests

* Add temp directory test helper variant with "named" argument

This is clearer at the call site when only a single path component is specified.

* Fix test helper syntax in disabled preview server test

* Re-enable one file monitoring test
@d-ronnqvist
Copy link
Contributor Author

I'll close this and open a new PR with a better branch name.

@d-ronnqvist d-ronnqvist deleted the release/5.6 branch January 12, 2022 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant