-
Notifications
You must be signed in to change notification settings - Fork 1.4k
tests: add a workaround for SPM tests #6853
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,7 +192,7 @@ class SourceControlPackageContainerTests: XCTestCase { | |
func testVprefixVersions() throws { | ||
let fs = InMemoryFileSystem() | ||
|
||
let repoPath = AbsolutePath.root | ||
let repoPath = AbsolutePath.root.appending("SourceCache") | ||
let filePath = repoPath.appending("Package.swift") | ||
|
||
let specifier = RepositorySpecifier(path: repoPath) | ||
|
@@ -234,7 +234,7 @@ class SourceControlPackageContainerTests: XCTestCase { | |
func testVersions() throws { | ||
let fs = InMemoryFileSystem() | ||
|
||
let repoPath = AbsolutePath.root | ||
let repoPath = AbsolutePath.root.appending("SourceCache") | ||
let filePath = repoPath.appending("Package.swift") | ||
|
||
let specifier = RepositorySpecifier(path: repoPath) | ||
|
@@ -327,7 +327,10 @@ class SourceControlPackageContainerTests: XCTestCase { | |
func testPreReleaseVersions() throws { | ||
let fs = InMemoryFileSystem() | ||
|
||
let repoPath = AbsolutePath.root | ||
// Insert an arc in the path prior to the repository root to prevent | ||
// `\Package.swift` being the path that is used. The | ||
// intermediate arc allows processing the tools versions. | ||
let repoPath = AbsolutePath.root.appending("SourceCache") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I can connect the description of the PR to the actual change here. It mentions relative path, but only an absolute is stored here. How does adding a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The path to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add this as a comment in code so that it's visible when reviewed in the future by someone else and not "cleaned up" by accident. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks!
MaxDesiatov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
let filePath = repoPath.appending("Package.swift") | ||
|
||
let specifier = RepositorySpecifier(path: repoPath) | ||
|
@@ -371,7 +374,7 @@ class SourceControlPackageContainerTests: XCTestCase { | |
func testSimultaneousVersions() throws { | ||
let fs = InMemoryFileSystem() | ||
|
||
let repoPath = AbsolutePath.root | ||
let repoPath = AbsolutePath.root.appending("SourceCache") | ||
let filePath = repoPath.appending("Package.swift") | ||
|
||
let specifier = RepositorySpecifier(path: repoPath) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Should we use
withTemporaryDirectory
here instead? Untested e.gThis way, we won't risk corrupting the host drive folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do that in place of the
InMemoryFileSystem
. I think that the test issues do often arise from the use ofInMemoryFileSystem
. Note that I care little what solution we go with as long as we can get SPM tests correctly testing SPM on Windows as well :)