Skip to content

Implement MUnit integration#119

Merged
dimafeng merged 8 commits intotestcontainers:masterfrom
the-pavels:psisoyev/munit-integration
May 4, 2020
Merged

Implement MUnit integration#119
dimafeng merged 8 commits intotestcontainers:masterfrom
the-pavels:psisoyev/munit-integration

Conversation

@the-pavels
Copy link
Copy Markdown
Contributor

I have implemented MUnit integration.
There is a known issue, though: currently, in MUnit it is not possible to retrieve test status in afterAll/afterEach block so I always pass no error to afterTest method

Comment on lines +103 to +106
startedContainers.foreach(_.stop())
}
finally {
startedContainers = None
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct me if im wrong, but it looks like you have a potential race condition here. If you add a new container between line 103 and line 106 are executed (and those lines are not atomic), you wont stop the new container. From my understanding all operations on containers should be synchronized

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I'm not sure it's worth to change state of startedContainers here at all. Probably at this point, it doesn't change anything.

Copy link
Copy Markdown
Contributor

@LMnet LMnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

Besides integration implementation is would be nice to have documentation about munit module. Could you please add it? Few examples with main concepts would be enough.

Also, it looks like munit integration doesn't support all scalatest integration features. These limitations should be highlighted in the documentation too.

Comment thread build.sbt Outdated
.dependsOn(
core,
scalatest,
munit,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allOld module is only for backward compatibility. You don't need to add new modules (like munit) to this module.

Copy link
Copy Markdown
Contributor

@LMnet LMnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for me!

@dimafeng FYI

@dimafeng
Copy link
Copy Markdown
Collaborator

dimafeng commented May 2, 2020

@psisoyev thank you for your contribution! I'll take a closer look and merge over the weekend

@the-pavels
Copy link
Copy Markdown
Contributor Author

I realized that I didn't put MUnit related classes to munit package. I guess that should be done as well. What do you think?

@LMnet
Copy link
Copy Markdown
Contributor

LMnet commented May 4, 2020

I realized that I didn't put MUnit related classes to munit package. I guess that should be done as well. What do you think?

Yes, unit stuff should be in the separate package.

@dimafeng dimafeng merged commit 306d471 into testcontainers:master May 4, 2020
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.

4 participants