Skip to content

Conversation

kpadhiamex
Copy link

Fixes #1329

V1.13.13 added calling unmockkAll() after tests when using the JUnit 5 MockKExtension. It has the same problems with running tests in parallel that happened when the extension was modified to call clearAllMocks() after tests. The call to unmockkAll() is wrapped in a check with !context.requireParallelTesting in this PR.

@kpadhiamex
Copy link
Author

@Raibaz Could you please review this PR?

@Raibaz
Copy link
Collaborator

Raibaz commented Jan 18, 2025

Nice, thanks for putting this together!

Do you think it'd be possible to add test coverage for it?

@kpadhiamex
Copy link
Author

@Raibaz
Added some tests, could you please see if that is what you were looking for? If not, please suggest a reference.

@Raibaz Raibaz merged commit a775783 into mockk:master Jan 21, 2025
22 checks passed
@kpadhiamex kpadhiamex deleted the 1329-fix-parallel-testing-unmockkAll branch January 22, 2025 13:47
SaintPatrck added a commit to bitwarden/android that referenced this pull request Mar 4, 2025
Update mockk from 1.13.13 to 1.13.17

<details>
<summary>mockk/mockk (io.mockk:mockk)</summary>

### p`v1.13.17`](https://redirect.github.com/mockk/mockk/releases/tag/1.13.17)

[Compare Source](mockk/mockk@1.13.16...1.13.17)

##### What's Changed

-   Fix(Issue #1333): Bug fix for the issue with MockK 1.13.16 Wraps Results Objects Twice by @kpadhiamex in [#1334](mockk/mockk#1334)
-   Fix (issue# 1329) parallel testing for unmockkAll by @kpadhiamex in [#1335](mockk/mockk#1335)
-   [[#1304]](mockk/mockk#1304) feat: Restrict mocking of certain classes and add configuration option by @devtaebong in [#1340](mockk/mockk#1340
-   Update README.md - Clarify that private fields cannot be mocked by @p4ulor in [#1347](mockk/mockk#1347)
-   Added new property "failOnSetBackingFieldException" to fail test if a backing field could not be set by @cgm-aw in [#1349](mockk/mockk#1349)
-   Fix compilation error in constructedWith docs by @TWiStErRob in [#1354](mockk/mockk#1354)

**Full Changelog: **Full Changelog**: mockk/mockk@1.13.16...1.13.17

### [`v1.13.16`](https://redirect.github.com/mockk/mockk/releases/tag/1.13.16)

[Compare Source](https://redirect.github.com/mockk/mockk/compare/1.13.14...1.13.16)

##### What's Changed

-   Fix( Issue [#&#8203;1073](https://redirect.github.com/mockk/mockk/issues/1073)): Bug fix for the issue with mocking value classes with coEvery by [@&#8203;kpadhiamex](https://redirect.github.com/kpadhiamex) in [https://github.com/mockk/mockk/pull/1332](https://redirect.github.com/mockk/mockk/pull/1332)

**Full Changelog**: mockk/mockk@1.13.14...1.13.16

### [`v1.13.14`](https://redirect.github.com/mockk/mockk/releases/tag/1.13.14)

[Compare Source](https://redirect.github.com/mockk/mockk/compare/1.13.13...1.13.14)

##### What's Changed

-   fix(1308): Handle nullable complex and nested value classes by [@&#8203;VasilisDrettas-tomtom](https://redirect.github.com/VasilisDrettas-tomtom) in [https://github.com/mockk/mockk/pull/1314](https://redirect.github.com/mockk/mockk/pull/1314)
-   Fix(Issue no. 1330) for Relaxed Mocking Value When Property is Nested Value Class by [@&#8203;kpadhiamex](https://redirect.github.com/kpadhiamex) in [https://github.com/mockk/mockk/pull/1331](https://redirect.github.com/mockk/mockk/pull/1331)

##### New Contributors

-   [@&#8203;kpadhiamex](https://redirect.github.com/kpadhiamex) made their first contribution in [https://github.com/mockk/mockk/pull/1331](https://redirect.github.com/mockk/mockk/pull/1331)

**Full Changelog**: mockk/mockk@1.13.13...1.13.14

</details>
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.

MockK 1.13.13 issues with parallel testing
2 participants