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

Basic swift testing support #1154

Merged
merged 7 commits into from
Sep 12, 2024
Merged

Basic swift testing support #1154

merged 7 commits into from
Sep 12, 2024

Conversation

younata
Copy link
Member

@younata younata commented Sep 9, 2024

#1148, but uses what's in the current version of swift testing.

This provides a way for Nimble to natively integrate with Swift Testing.

It's not a great integration. The error message you see will be prefixed with "Issue recorded:" (e.g. "Issue recorded: expected to equal 1, got 2").

This starts recording the fileID & column of the source (to be passed in to Swift Testing).

It works primarily by adjusting the default assertion handler to try to detect whether we're running a Swift Testing test, or an XCTest test. It detects Swift Testing by using Test.current (which unfortunately breaks if you use Task.detached. See swiftlang/swift-testing#475. However, the Swift Testing #expect and #require macros also fail in this case as well), and then falls back to reporting to XCTest if it doesn't detect swift testing.

@younata younata merged commit f12ca52 into main Sep 12, 2024
16 checks passed
@younata younata deleted the basic-swift-testing-support branch September 12, 2024 15:37
mergify bot referenced this pull request in cgrindel/rules_swift_package_manager Sep 21, 2024
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [Quick/Nimble](https://redirect.github.com/Quick/Nimble) | minor |
`from: "13.4.0"` -> `from: "13.5.0"` |

---

### Release Notes

<details>
<summary>Quick/Nimble (Quick/Nimble)</summary>

###
[`v13.5.0`](https://redirect.github.com/Quick/Nimble/releases/tag/v13.5.0)

[Compare
Source](https://redirect.github.com/Quick/Nimble/compare/v13.4.0...v13.5.0)

#### What's Changed

- Bump rexml from 3.2.8 to 3.3.6 by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/Quick/Nimble/pull/1153](https://redirect.github.com/Quick/Nimble/pull/1153)
- Basic swift testing support by
[@&#8203;younata](https://redirect.github.com/younata) in
[https://github.com/Quick/Nimble/pull/1154](https://redirect.github.com/Quick/Nimble/pull/1154)

**Full Changelog**:
Quick/Nimble@v13.4.0...v13.5.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44MC4wIiwidXBkYXRlZEluVmVyIjoiMzguODAuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: cgrindel-self-hosted-renovate[bot] <139595543+cgrindel-self-hosted-renovate[bot]@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
noamfreeman pushed a commit to noamfreeman/Nimble that referenced this pull request Oct 14, 2024
* Provide basic integration with Swift Testing

This is not reliable, in fact, failure reporting is flaky.

* Spike utilizing my changes to Swift Testing to allow direct recording of issues

* link to my branch of swift testing enabling public issues

* Support the current version of Swift Testing

* Fix broken tests

* Fix a broken test helper

* Correct a long-broken test because expectFailureMessageRegex has been a no-op for ages
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