Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Integration tests can not test assertion behaviors for all of NIO #1509

Open
gwynne opened this issue May 6, 2020 · 1 comment
Open

Integration tests can not test assertion behaviors for all of NIO #1509

gwynne opened this issue May 6, 2020 · 1 comment

Comments

@gwynne
Copy link
Contributor

gwynne commented May 6, 2020

Pretty much what the title says. The integration tests can only test the crashing-ness (or not) of assertions in a very small subset of NIO's code (and of course the unit tests can't test it at all). This should be fixed and tests added for such methods as EventLoop.preconditionInEventLoop() and friends.

(Filed by request of @weissi and according to remarks in #1508)

@weissi
Copy link
Member

weissi commented May 7, 2020

Correct. When I first wrote tests_05_assertions I wanted to save compile time in CI by constructing a reduced NIO package (https://github.com/apple/swift-nio/blob/master/IntegrationTests/tests_05_assertions/defines.sh).

That was a bad idea, we should just take the 30 seconds to compile NIO and build a package that can import NIO instead of trying to cherry-pick just the assertions.

This shouldn't be hard at all really, we need to build a SwiftPM package (much like we're doing now) but we should just add

dependencies: [
    .package("../../..")
]

or so to reach swift-nio. If that doesn't work then we can just use swift package edit --path /path/to/NIO swift-nio like we do in the allocation counter tests.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants