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

Can't Use BeforeAndAfterAll Because Play is Stopped #111

Open
jamesward opened this issue May 3, 2018 · 2 comments
Open

Can't Use BeforeAndAfterAll Because Play is Stopped #111

jamesward opened this issue May 3, 2018 · 2 comments

Comments

@jamesward
Copy link

I'm trying to use BeforeAndAfterAll and an afterall to cleanup some stuff. But by the time afterall gets called, Play has already shutdown. In BaseOneAppPerSuite it does this:

val status = super.run(testName, newArgs)
status.whenCompleted { _ => Play.stop(app) }

Which runs before the afterall.

@bryancannon
Copy link

What's a good work around for this? Right now i'm just creating a test at the end to clean up data.

@kwinter
Copy link

kwinter commented Apr 25, 2020

I've been poking around at trying to decouple the tests from sync versions - looks like a potential answer here might be to use BeforeAndAfterAll in the parent suites that do the setup/teardown, and only leave the config map copying in the overridden run method

unfortunately that's a change within scalatestplus-play itself, vs a workaround outside of it

kwinter added a commit to kwinter/scalatestplus-play that referenced this issue Apr 29, 2020
for app and server fixtures.  fixes playframework#111, and also doesn't start
app/server if test is excluded via tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants