ceylon-sdk
ceylon-sdk copied to clipboard
Integration between ceylon.test and java junit test
Theres lots of famous enterprise frameworks (SprintBoot, Wildfly, etc) extending JUnit behavior to provide a more useful test environment. Currently we can use these frameworks with Ceylon with almost no configuration, but we dont have anything to integrate with their test environment and this is a big restriction to make real programs because we are unable to test the code using these frameworks test environment.
This issue is much more a request for feedback to understand what are the steps to make ceylon.test delegate to junit environment.
In my mind one possible solution:
- Declare some kind of extension in ceylon test that will look up for junit test annotation
- Programatically setup Junit environment
- Delegate all tests found to junit
Of course Im talking about all this with no knowledge of both test frameworks :( .. so maybe there are restrictions that i dont know.. but Im available to focus my efforts to help with this issue and complete the enterprise development with ceylon + java integration.
What do you think @thradec ?
My take on this is that if we do integrate with JUnit, we should aim for compatibility/integration with JUnit 5/Jupiter as a TestEngine
implementation.
So why precisely is it that we can't simply use JUnit or Arquillian directly from Ceylon?
So why precisely is it that we can't simply use JUnit or Arquillian directly from Ceylon?
I believe for that we would need to create our Runner, but Arquillian and Sprinboot have their own runner and we cant specify 2 Runners for tests.
Well, I suppose we can. Use JUnit directly from Ceylon that is.
Although I have not tried it myself, so I can not vouch of how well it does work or at what point it falls over.
I suspect that JUnit's native test discovery & execution method might not work so well for Ceylon tests. But I might be wrong and it all works out fine.
What I would like to see however is that ceylon.test
tests could be picked up by third party test runners implementing JUnit 5 test runner protocol. That includes IDEs (currently only IDEA implements support for JUnit 5, but Eclipse support is in the works and I have no doubt that others are following suit), build tools, CI platforms, etc.