Skip to content

Ensure attachments path directory is created#1788

Open
bkhouri wants to merge 1 commit into
swiftlang:mainfrom
bkhouri:t/main/gh1665_create_attachment-path-if-it-does-not-exists
Open

Ensure attachments path directory is created#1788
bkhouri wants to merge 1 commit into
swiftlang:mainfrom
bkhouri:t/main/gh1665_create_attachment-path-if-it-does-not-exists

Conversation

@bkhouri

@bkhouri bkhouri commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

When running swift test --attachments-path /does/not/exist, the Swift Testing library will fail with an error like:

Invalid value "/path/does/not/exists" for argument ---attachments-path

Ensure the path specified by --attachments-path is created, and update the error message to remote the additional - in the argument name.

Closes #1665

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.
  • Update documentation to reflect behavioural changes

@bkhouri
bkhouri force-pushed the t/main/gh1665_create_attachment-path-if-it-does-not-exists branch from cb47ad0 to aab38cf Compare July 13, 2026 19:52

@grynspan grynspan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a lot of new code just to create a directory. I'd suggest we just leverage Foundation for it unless we're doing it a lot. (So, yes, you did the right thing avoiding Foundation, but sometimes it's not worth the effort!)

@grynspan grynspan added tools integration 🛠️ Integration of swift-testing into tools/IDEs command-line experience ⌨️ enhancements to the command line interface attachments/activities 🖇️ Work related to attachments and/or activities labels Jul 15, 2026
@grynspan grynspan added this to the Swift 6.5.0 (main) milestone Jul 15, 2026
@bkhouri
bkhouri force-pushed the t/main/gh1665_create_attachment-path-if-it-does-not-exists branch 2 times, most recently from 58f0c81 to 9b7fa6d Compare July 15, 2026 21:20
@bkhouri
bkhouri requested a review from grynspan July 15, 2026 21:20
@bkhouri
bkhouri force-pushed the t/main/gh1665_create_attachment-path-if-it-does-not-exists branch 2 times, most recently from e919a0e to 0388251 Compare July 15, 2026 22:03
@bkhouri
bkhouri marked this pull request as ready for review July 15, 2026 22:04
@bkhouri
bkhouri marked this pull request as draft July 15, 2026 22:04
Comment thread Sources/Testing/Testing.docc/ReleaseNotes/Unreleased.md Outdated
Comment thread Sources/Testing/Testing.docc/Documentation.md Outdated
Comment thread Sources/Testing/Testing.docc/Attachments.md Outdated
Comment thread Sources/Testing/ABI/EntryPoints/EntryPoint.swift Outdated
Comment thread Sources/Testing/Support/VersionNumber.swift Outdated
Comment thread Sources/Testing/Testing.docc/ReleaseNotes.md Outdated
Comment thread Tests/TestingTests/SwiftPMTests.swift Outdated
Comment thread Tests/TestingTests/SwiftPMTests.swift Outdated
Comment thread Sources/Testing/ABI/EntryPoints/EntryPoint.swift Outdated
Comment thread Sources/Testing/ABI/EntryPoints/EntryPoint.swift Outdated
Comment thread Sources/Testing/ABI/EntryPoints/EntryPoint.swift Outdated
Comment thread Sources/Testing/ABI/EntryPoints/EntryPoint.swift Outdated
@bkhouri
bkhouri force-pushed the t/main/gh1665_create_attachment-path-if-it-does-not-exists branch 5 times, most recently from ec1e385 to c23543e Compare July 16, 2026 16:21
@bkhouri
bkhouri requested a review from grynspan July 16, 2026 16:22

@grynspan grynspan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor changes requested, looks much cleaner now!

Comment thread Sources/Testing/ABI/EntryPoints/EntryPoint.swift Outdated
Comment thread Tests/TestingTests/SwiftPMTests.swift Outdated
When running `swift test --attachments-path /does/not/exist`, the Swift
Testing library will fail with an error like:

```
Invalid value "/path/does/not/exists" for argument ---attachments-path
```

Ensure the path specified by `--attachments-path` is created, and update
the error message to remote the additional `-` in the argument name.

Closes swiftlang#1665
@bkhouri
bkhouri force-pushed the t/main/gh1665_create_attachment-path-if-it-does-not-exists branch from c23543e to e5321fb Compare July 16, 2026 19:56
@bkhouri
bkhouri requested a review from grynspan July 16, 2026 19:56
@bkhouri
bkhouri marked this pull request as ready for review July 16, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

attachments/activities 🖇️ Work related to attachments and/or activities command-line experience ⌨️ enhancements to the command line interface tools integration 🛠️ Integration of swift-testing into tools/IDEs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Swift Testing should create the attachments-path if it does not exist

2 participants