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

Test-specific extension is overridden by project-level extention #3613

Closed
OliverO2 opened this issue Aug 10, 2023 · 1 comment
Closed

Test-specific extension is overridden by project-level extention #3613

OliverO2 opened this issue Aug 10, 2023 · 1 comment
Milestone

Comments

@OliverO2
Copy link
Contributor

Kotest master, as of commit 45df9ae

Following up from #3602 (comment):

I am currently working on enabling nested invocations for the BlockHound extension. The following will not work:

@DoNotParallelize
class BlockHoundSpecTest : FunSpec({
   extension(BlockHound())

   test("detects for spec") {
      shouldThrow<BlockingOperationError> { blockInNonBlockingContext() }
   }

   // other tests...

   test("nested configuration").config(extensions = listOf(BlockHound(BlockHoundMode.DISABLED))) {
      shouldNotThrow<BlockingOperationError> { blockInNonBlockingContext() }
   }
})

In the above case, the test-specific extension BlockHound(BlockHoundMode.DISABLED) will be overridden by the project-level extension BlockHound(). The cause seems to be an incorrect extension processing order. I am just preparing a PR to fix this.

OliverO2 added a commit to OliverO2/kotest that referenced this issue Aug 10, 2023
)

The test is actually Sam's work (kotest#3602), which I shamelessly copied and
adapted for this issue's purpose.
sksamuel added a commit that referenced this issue Aug 17, 2023
…3614)

The test is actually Sam's work (#3602), which I shamelessly copied and
adapted for this issue's purpose.

Co-authored-by: Sam <sam@sksamuel.com>
@sksamuel sksamuel added this to the 5.7 milestone Aug 26, 2023
@sksamuel
Copy link
Member

This is fixed by #3614

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

No branches or pull requests

2 participants