Releases: Quick/Quick
v7.0.0 - AsyncSpec and Human-Readable Test Selectors
Highlights
Async Test Changes
Quick 7 changes how Async tests are run. Instead of forcing all tests to run in an async context, Quick 7 provides a separate Spec class for Async Tests. Create an AsyncSpec
subclass, and all tests inside of that subclass will run in an async context. Tests inside of QuickSpec
subclasses will have a similar behavior to what was in Quick 5.
Additionally, Quick 7 changes how the DSL is defined slightly. In Quick 6 and before, the DSL was defined as a series of global functions, available to be called anywhere. In Quick 7, these functions were moved to be static methods on the new SyncDSLUser
(which QuickSpec
, Behavior
, and QuickConfiguration
conform to) and AsyncDSLUser
(which AsyncSpec
and AsyncBehavior
conform to) protocols. This allows us to make sure that you are using the correct DSL for the context, and was necessary for this approach.
For example:
class SynchronousSpec: QuickSpec {
override class func spec() {
it("runs synchronously, as you'd expect") {
var ocean: [String] = []
DispatchQueue.main.async {
ocean.append("dolphins")
ocean.append("whales")
}
expect(ocean).toEventually(contain("dolphins", "whales"))
}
}
}
actor OceanActor<T> {
var contents: [T] = []
func append(_ value: T) {
contents.append(value)
}
}
class AsynchronousSpec: AsyncSpec {
override class func spec() {
it("runs the test in an async context") {
let ocean = OceanActor<String>()
Task {
await ocean.append("dolphins")
await ocean.append("whales")
}
await expect { await ocean.contents }.toEventually(contain("dolphins", "whales"))
}
}
}
Unencoded Test Selectors
Furthermore, Quick 7 changes how test selectors are generated for QuickSpec
. Now, both AsyncSpec
and QuickSpec
will use the unencoded test names as the test selectors. Test selectors are now generated by joining the describe
/context
blocks leading up to the it
block with ", ". This makes test names immensely easier to read. For example, with the following spec:
class MySpec: QuickSpec {
override class func spec() {
describe("some feature") {
context("in one case") {
it("has a behavior") {}
}
context("in another case") {
it("doesn't have the earlier behavior") {}
}
}
}
}
will generate the following test selectors:
some feature, in one case, has a behavior
some feature, in another case, doesn't have the earlier behavior
You can disable this change by setting the QUICK_USE_ENCODED_TEST_SELECTOR_NAMES
environment variable.
Migrating Suggestions
Quick 7 is not a drop-in migration from either Quick 5 or Quick 6. Quick 5 users will have a slightly easier time upgrading, but due to spec
being defined as a class method instead of an instance method, there will still be changes.
Doing a Find & Replace of override func spec
with override class func spec
will take care of the low-hanging fruit. If you have any test helpers that exist as properties or methods of your QuickSpec subclasses, the you will need to either move them inside of the spec
function, or outside to another scope. For Objective-C users, this is, for the most part, a drop-in replacement. You will only need to do anything if you do not use the QuickSpecBegin
and QuickSpecEnd
macros (in which case: do a find & replace of the regex -(\s*)\(void\)(\s*)spec
with +$1(void)$2spec
).
For migrating from Quick 6 to Quick 7, it would be easiest to also do a Find & Replace of : QuickSpec
to : AsyncSpec
, then migrate tests that do not need to run in async contexts to be QuickSpec
s themselves.
Auto-Generated Changelog
What's Changed
- Bump git from 1.12.0 to 1.13.0 by @dependabot in #1191
- (Temporarily) Remove async support from Quick by @younata in #1192
- Bump activesupport from 6.1.5 to 6.1.7.1 by @dependabot in #1196
- Bump danger from 9.1.0 to 9.2.0 by @dependabot in #1198
- Transition QuickSpec.spec to be a static method. by @younata in #1200
- Add async duplicate-world based support. by @younata in #1199
- Bump cocoapods from 1.11.3 to 1.12.0 by @dependabot in #1201
- Bump activesupport from 7.0.4.2 to 7.0.4.3 by @dependabot in #1203
- Bump fkirc/skip-duplicate-actions from 5.2.0 to 5.3.0 by @dependabot in #1188
- [Translation] AsyncAwait.md Korean translation by @tisohjung in #1204
- Update Nimble to v12 by @younata in #1206
- Demangle QuickSpec test names as much as possible by @younata in #1207
- Add mechanism to fallback to legacy test selector names by @younata in #1211
- Bump cocoapods from 1.12.0 to 1.12.1 by @dependabot in #1210
- Bump danger from 9.2.0 to 9.3.0 by @dependabot in #1209
- Don't imply that we plan to remove the option to force encoded test selector names by @younata in #1212
- Merge branch quick_7 into main. by @younata in #1213
- [doc] Corrected to class method by @coffmark in #1214
- Update the english documentation for Quick 7 by @younata in #1215
- Provide a way to get the currently running spec, regardless of if we're executing an AsyncSpec or a QuickSpec by @younata in #1216
New Contributors
- @tisohjung made their first contribution in #1204
- @coffmark made their first contribution in #1214
Full Changelog: v6.1.0...v7.0.0
v7.0.0-beta.3
Beta 3 Changes
Quick 7 Beta 3 adds a flag to re-enable the encoded test selector names. This is useful for automated test analysis tools which track tests over time or are broken with the new human-readable test selectors.
Set the QUICK_USE_ENCODED_TEST_SELECTOR_NAMES
environment variable and Quick will generate the older-style encoded test selector names (all non alpha-numeric characters will be replaced with underscores).
Thanks to @tikitu and @stonko1994 for their help prioritizing adding this flag.
As with previous betas, we encourage you to check this out, and to share feedback by filing an issue or discussing this in the discussion page.
Beta 2 Changes
Quick 7 Beta 2 changes how test selectors are generated for QuickSpec
. Now, both AsyncSpec
and QuickSpec
will use the unencoded test names as the test selectors. Test selectors are now generated by joining the describe
/context
blocks leading up to the it
block with ", ". This makes test names immensely easier to read. For example, with the following spec:
class MySpec: QuickSpec {
override class func spec() {
describe("some feature") {
context("in one case") {
it("has a behavior") {}
}
context("in another case") {
it("doesn't have the earlier behavior") {}
}
}
}
}
will generate the following test selectors:
some feature, in one case, has a behavior
some feature, in another case, doesn't have the earlier behavior
Beta 1 Changes
Quick 7 changes how Async tests are run. Instead of forcing all tests to run in an async context, Quick 7 provides a separate Spec class for Async Tests. Create an AsyncSpec
subclass, and all tests inside of that subclass will run in an async context. Tests inside of QuickSpec
subclasses will have a similar behavior to what was in Quick 5.
Additionally, Quick 7 changes how the DSL is defined slightly. In Quick 6 and before, the DSL was defined as a series of global functions, available to be called anywhere. In Quick 7, these functions were moved to be static methods on the new SyncDSLUser
(which QuickSpec
, Behavior
, and QuickConfiguration
conform to) and AsyncDSLUser
(which AsyncSpec
and AsyncBehavior
conform to) protocols. This allows us to make sure that you are using the correct DSL for the context, and was necessary for this approach.
For example:
class SynchronousSpec: QuickSpec {
override class func spec() {
it("runs synchronously, as you'd expect") {
var ocean: [String] = []
DispatchQueue.main.async {
ocean.append("dolphins")
ocean.append("whales")
}
expect(ocean).toEventually(contain("dolphins", "whales"))
}
}
}
class AsynchronousSpec: AsyncSpec {
override class func spec() {
it("runs the test in an async context") {
var ocean: [String] = []
DispatchQueue.main.async {
ocean.append("dolphins")
ocean.append("whales")
}
await expect(ocean).toEventually(contain("dolphins", "whales"))
}
}
}
Doing a Find & Replace of override func spec
with override class func spec
will take care of this. If you have any test helpers that exist on properties of your QuickSpec subclasses, the you will need to either move them inside of the spec
function, or outside to another scope. For Objective-C users, this is, for the most part, a drop-in replacement. You will only need to do anything if you do not use the QuickSpecBegin
and QuickSpecEnd
macros (in which case: do a find & replace of the regex -(\s*)\(void\)(\s*)spec
with +$1(void)$2spec
).
For migrating from Quick 6 to Quick 7, it would be easiest to also do a Find & Replace of : QuickSpec
to : AsyncSpec
, then migrate tests that do not need to run in async contexts to be QuickSpec
s themselves.
We encourage you to check this out, and to share feedback by filing an issue or discussing this in the discussions.
Auto-Generated Changelog
Beta 3 Changes
- Add mechanism to fallback to legacy test selector names by @younata in #1211
- Don't imply that we plan to remove the option to force encoded test selector names by @younata in #1212
Beta 2 Changes
- Bump git from 1.12.0 to 1.13.0 by @dependabot in #1191
- Bump activesupport from 6.1.5 to 6.1.7.1 by @dependabot in #1196
- Bump danger from 9.1.0 to 9.2.0 by @dependabot in #1198
- Bump cocoapods from 1.11.3 to 1.12.0 by @dependabot in #1201
- Bump activesupport from 7.0.4.2 to 7.0.4.3 by @dependabot in #1203
- Bump fkirc/skip-duplicate-actions from 5.2.0 to 5.3.0 by @dependabot in #1188
- [Translation] AsyncAwait.md Korean translation by @tisohjung in #1204
- Update Nimble to v12 by @younata in #1206
- Demangle QuickSpec test names as much as possible by @younata in #1207
New Contributors
- @tisohjung made their first contribution in #1204
Full Changelog: v7.0.0-beta.2...v7.0.0-beta.3
v7.0.0 beta 2
Quick 7 Beta 2 changes how test selectors are generated for QuickSpec
. Now, both AsyncSpec
and QuickSpec
will use the unencoded test names as the test selectors. Test selectors are now generated by joining the describe
/context
blocks leading up to the it
block with ", ". This makes test names immensely easier to read. For example, with the following spec:
class MySpec: QuickSpec {
override class func spec() {
describe("some feature") {
context("in one case") {
it("has a behavior") {}
}
context("in another case") {
it("doesn't have the earlier behavior") {}
}
}
}
}
will generate the following test selectors:
some feature, in one case, has a behavior
some feature, in another case, doesn't have the earlier behavior
As with Beta 1, we encourage you to check this out, and to share feedback by filing an issue or discussing this in the discussion page.
Beta 1 Changes
Quick 7 changes how Async tests are run. Instead of forcing all tests to run in an async context, Quick 7 provides a separate Spec class for Async Tests. Create an AsyncSpec
subclass, and all tests inside of that subclass will run in an async context. Tests inside of QuickSpec
subclasses will have a similar behavior to what was in Quick 5.
Additionally, Quick 7 changes how the DSL is defined slightly. In Quick 6 and before, the DSL was defined as a series of global functions, available to be called anywhere. In Quick 7, these functions were moved to be static methods on the new SyncDSLUser
(which QuickSpec
, Behavior
, and QuickConfiguration
conform to) and AsyncDSLUser
(which AsyncSpec
and AsyncBehavior
conform to) protocols. This allows us to make sure that you are using the correct DSL for the context, and was necessary for this approach.
For example:
class SynchronousSpec: QuickSpec {
override class func spec() {
it("runs synchronously, as you'd expect") {
var ocean: [String] = []
DispatchQueue.main.async {
ocean.append("dolphins")
ocean.append("whales")
}
expect(ocean).toEventually(contain("dolphins", "whales"))
}
}
}
class AsynchronousSpec: AsyncSpec {
override class func spec() {
it("runs the test in an async context") {
var ocean: [String] = []
DispatchQueue.main.async {
ocean.append("dolphins")
ocean.append("whales")
}
await expect(ocean).toEventually(contain("dolphins", "whales"))
}
}
}
We encourage you to check this out, and to share feedback by filing an issue or discussing this in the discussions.
Auto-Generated Changelog
What's Changed
- Bump git from 1.12.0 to 1.13.0 by @dependabot in #1191
- Bump activesupport from 6.1.5 to 6.1.7.1 by @dependabot in #1196
- Bump danger from 9.1.0 to 9.2.0 by @dependabot in #1198
- Bump cocoapods from 1.11.3 to 1.12.0 by @dependabot in #1201
- Bump activesupport from 7.0.4.2 to 7.0.4.3 by @dependabot in #1203
- Bump fkirc/skip-duplicate-actions from 5.2.0 to 5.3.0 by @dependabot in #1188
- [Translation] AsyncAwait.md Korean translation by @tisohjung in #1204
- Update Nimble to v12 by @younata in #1206
- Demangle QuickSpec test names as much as possible by @younata in #1207
New Contributors
- @tisohjung made their first contribution in #1204
Full Changelog: v7.0.0-beta.1...v7.0.0-beta.2
v7.0.0 Beta 1
Quick 7 changes how Async tests are run. Instead of forcing all tests to run in an async context, Quick 7 provides a separate Spec class for Async Tests. Create an AsyncSpec
subclass, and all tests inside of that subclass will run in an async context. Tests inside of QuickSpec
subclasses will have a similar behavior to what was in Quick 5.
Additionally, Quick 7 changes how the DSL is defined slightly. In Quick 6 and before, the DSL was defined as a series of global functions, available to be called anywhere. In Quick 7, these functions were moved to be static methods on the new SyncDSLUser
(which QuickSpec
, Behavior
, and QuickConfiguration
conform to) and AsyncDSLUser
(which AsyncSpec
and AsyncBehavior
conform to) protocols. This allows us to make sure that you are using the correct DSL for the context, and was necessary for this approach.
For example:
class SynchronousSpec: QuickSpec {
override class func spec() {
it("runs synchronously, as you'd expect") {
var ocean: [String] = []
DispatchQueue.main.async {
ocean.append("dolphins")
ocean.append("whales")
}
expect(ocean).toEventually(contain("dolphins", "whales"))
}
}
}
class AsynchronousSpec: AsyncSpec {
override class func spec() {
it("runs the test in an async context") {
var ocean: [String] = []
DispatchQueue.main.async {
ocean.append("dolphins")
ocean.append("whales")
}
await expect(ocean).toEventually(contain("dolphins", "whales"))
}
}
}
We encourage you to check this out, and to share feedback by filing an issue or discussing this in the discussions.
Full Changelog: v6.1.0...v7.0.0-beta.1
v6.1.0
Highlighted Changes
- New
TestState
property wrapper (Thanks @CraigSiemens!). You can now wrap properties with@TestState
to have them automatically set to nil. - Objective-C API is no longer available in Swift, this should reduce confusion whether a test is being executed in an async context or not.
- This release drops support for Swift 5.6/Xcode 13.3.1.
Auto-generated Release Notes
What's Changed
- Bump danger from 9.0.0 to 9.1.0 by @dependabot in #1184
- Make Objective-C API unavailable in Swift. by @younata in #1185
- Update Nimble to 11.2.1, remove now-unnecessary usage of awaits in tests. Drop support for swift 5.6/Xcode 13.3.1 by @younata in #1187
- Added a
TestState
property wrapper. by @CraigSiemens in #1186
New Contributors
- @CraigSiemens made their first contribution in #1186
Full Changelog: v6.0.1...v6.1.0
v6.0.1
v6.0.0
This closes the v6.0.0 milestone.
Highlights
See additional details under the auto-generated release notes below.
Fixed
- No more sporadic crashes attempting to detect subclasses #1156
- Rerunning an individual test #1166
- Skipped tests are reported to Xcode #1098
New
- Async/await support. All tests now run in an async context. #1160
- You can now throw a
StopTest
error to end a test prematurely without it being reported as an error. #1165 - Added the
justBeforeEach
operator, which takes a closure and runs it immediately prior to the relevantit
tests. #1169 For example
var ordering: [Int] = []
beforeEach {
ordering.append(1)
}
justBeforeEach {
ordering.append(3)
}
beforeEach {
ordering.append(2)
}
it("runs justBeforeEach after the other beforeEach's") {
expect(ordering).to(equal([1, 2, 3]))
}
Breaking
- This version raises minimum required version to Swift 5.6, and required OS to macOS 10.15, iOS 13, and tvOS 13.
aroundEach
is removed from the Objective-C API #1160- Again, with the async support, all tests now run in an async context. This will require you to make changes, especially if you use Nimble.
Auto-Generated Release Notes
What's Changed
- Create funding.yml by @jessesquires in #1147
- Report skipped tests to Xcode by @amomchilov in #1098
- Bump danger from 8.6.0 to 8.6.1 by @dependabot in #1148
- Renamed Configuration -> QCKConfiguration on documentation by @takehilo in #1152
- Fix sporadic crashes caused by finding classes that don't play well with isSubclass(of:) by @younata in #1156
- Raise minimum supported versions to macOS 10.15, iOS 13, tvOS 13 by @younata in #1146
- version up Nimble in Package.swift by @kimxwan0319 in #1153
- Update Nimble submodule checkout to refer to the Nimble v10.0.0 commit by @younata in #1157
- Fix tests broken by Nimble 10 update by @younata in #1158
- Add @younata to funding.yml by @younata in #1164
- Bump danger from 8.6.1 to 9.0.0 by @dependabot in #1168
- Allow throwing in a test without producing an unexpected error by @bnickel in #1165
- Allow rerunning individual examples in Xcode by @bnickel in #1166
- Bump fkirc/skip-duplicate-actions from 4.0.0 to 5.1.0 by @dependabot in #1171
- Introduce an
assignBefore
operator by @esilverberg in #1169 - Bump fkirc/skip-duplicate-actions from 5.1.0 to 5.2.0 by @dependabot in #1172
- Add support for xcode 14 and swift 5.7 by @younata in #1174
- Swift Async/Await Support by @younata in #1160
- Update Nimble to V11 by @younata in #1175
New Contributors
- @amomchilov made their first contribution in #1098
- @takehilo made their first contribution in #1152
- @kimxwan0319 made their first contribution in #1153
- @bnickel made their first contribution in #1165
- @esilverberg made their first contribution in #1169
Full Changelog: v5.0.1...v6.0.0
v5.0.1
This release closes the v5.0.1 milestone.
What's Changed
- Bump danger from 8.5.0 to 8.6.0 by @dependabot in #1141
- Bump fkirc/skip-duplicate-actions from 3.4.1 to 4.0.0 by @dependabot in #1140
- Fix running tests in parallel by @younata in #1143
- [5.0.1] version bump, gen docs by @jessesquires in #1144
Full Changelog: v5.0.0...v5.0.1
v5.0.0
This release closes the v5.0.0 milestone.
Highlights
See additional details under the auto-generated release notes below.
Fixed
New
- Add support for running a single test #1116
- Add aroundEach #1132
- New API docs via Jazzy available here: http://quick.github.io/Quick/
Breaking
Auto-generated release notes
What's Changed
- [BREAKING] Make FilterFlags implementation detail by @ikesyo in #1068
- [BREAKING] Bump Swift requirement to 5.3 (Xcode 12) by @ikesyo in #1069
- Re-add missing QUICK_EXPORT to Objective-C DSL by @ikesyo in #1070
- Added documentation for how to do data driven tests using Quick by @pobengtsson in #940
- Fix typos and code issues in the data driven examples documentation by @revolter in #1072
- [CI] Test Swift 5.5 Development by @ikesyo in #1081
- [README] Remove deprecated Accio references by @ikesyo in #1082
- [CI] macOS 11 and Xcode 12.5 by @ikesyo in #1083
- Bump danger from 8.2.3 to 8.3.1 by @dependabot in #1087
- Bump cocoapods from 1.10.1 to 1.10.2 by @dependabot in #1089
- Bump fkirc/skip-duplicate-actions from 3.4.0 to 3.4.1 by @dependabot in #1092
- Specify header_dir in the podspec by @tsapeta in #1091
- [CI] Test Xcode 13 by @ikesyo in #1095
- Less String by @RomanPodymov in #1090
- Excluding Info.plist files from Swift Package by @heyzooi in #1088
- Bump cocoapods from 1.10.2 to 1.11.0 by @dependabot in #1099
- docs(DSL): fix typo by @bricker in #1100
- Bump cocoapods from 1.11.0 to 1.11.1 by @dependabot in #1101
- Fix individual tests run in Xcode 12.5 by @khramtsoff in #1097
- Use
#if canImport(Darwin)
for checking XCTIssue availability by @ikesyo in #1104 - Bump cocoapods from 1.11.1 to 1.11.2 by @dependabot in #1105
- Bump danger from 8.3.1 to 8.4.0 by @dependabot in #1107
- Bump danger from 8.4.0 to 8.4.1 by @dependabot in #1110
- Bump danger from 8.4.1 to 8.4.2 by @dependabot in #1112
- Bump danger from 8.4.2 to 8.4.3 by @dependabot in #1117
- Bump actions/checkout from 2 to 3 by @dependabot in #1120
- Bump danger from 8.4.3 to 8.4.5 by @dependabot in #1121
- Bump cocoapods from 1.11.2 to 1.11.3 by @dependabot in #1126
- Bump danger from 8.4.5 to 8.5.0 by @dependabot in #1125
- Critical! Fix test cases discoverage in Xcode 13.3 by @BobCatC in #1129
- Bump cocoapods-downloader from 1.5.1 to 1.6.3 by @dependabot in #1130
- Keep reference to AutoreleasingUnsafeMutablePointer by @ikesyo in #1103
- Use Objective-C runtime's
isSubclass(of:)
API for checking superclass by @ikesyo in #1096 - Fix Swift docs for non-named
configure
argument. by @alexhayes in #1113 - Fix
afterSuite
blocks not running when having excluded tests by @revolter in #1061 - [Breaking] Rename Configuration -> QCKConfiguration by @jessesquires in #1133
- Add aroundEach by @pcantrell in #1132
- Add support for running a single test by @younata in #1116
New Contributors
- @tsapeta made their first contribution in #1091
- @RomanPodymov made their first contribution in #1090
- @heyzooi made their first contribution in #1088
- @bricker made their first contribution in #1100
- @khramtsoff made their first contribution in #1097
- @BobCatC made their first contribution in #1129
- @alexhayes made their first contribution in #1113
- @younata made their first contribution in #1116
Full Changelog: v4.0.0...v5.0.0
v4.0.0
Quick v4 has been released! 🎉 The new major version requires Swift 5.2 / Xcode 11.4 at least.
BREAKING CHANGES
Changes
- [CI] Test Xcode 12 and Swift 5.3 #1010
- Set ENABLE_TESTING_SEARCH_PATHS to YES #1011
- Upgrade Project Format to Xcode 11.4-compatible #1012 (Thanks @mRs-)
- [CI] Use rake directly instead of travis-script-macos #1019
- Update Nimble to 9.1.0 #1020, #1062, #1066
- Xcode 12.0: Update to recommended settings #1021
- Address deprecation warnings in Xcode 12 #1040
- Migrate Linux CI from Travis to GitHub Actions #1042
- [CI] Use norionomura/swift Docker images for Linux CI #1043
- [SwiftLint] Enable yoda_condition rule #1044
- [CI] Use the official Swift Docker images #1049
- [CI] Split ci.yml into dedicated workflows #1050
- Tweak CI workflows regarding fkirc/skip-duplicate-actions and matrix testing #1051
- Xcode 12.5: Update to recommended settings #1063
- [CI] Update Xcode and Swift versions #1064
Documentation Changes
vieiwDidAppear
not be called automatically in iOS SDK 13.0 #942 (Thanks @nickm01)- [Translation] Update Chinese README.md #1053 (Thanks @EdgarDegas)
Miscellaneous
- Create dependabot.yml #1000
- Bump cocoapods #1001, #1026, #1035
- Bump danger #1002, #1009, #1022, #1024, #1036, #1054
- Bump kramdown #1004, #1058
- [Dangerfile] Avoid passing a bot account name to github.api.organization_member #1005
- Bump norio-nomura/action-swiftlint from 3.1.0 to 3.2.1 #1031
- Bump fkirc/skip-duplicate-actions from v3.3.0 to v3.4.0 #1055
- Bump rexml from 3.2.4 to 3.2.5 #1065