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

JUnit Jupiter Extension? #2

Open
julesjacobsen opened this issue Jan 24, 2019 · 5 comments
Open

JUnit Jupiter Extension? #2

julesjacobsen opened this issue Jan 24, 2019 · 5 comments

Comments

@julesjacobsen
Copy link

Have you considered creating a JUnit 5 extension so people can hook this directly into their unit tests?

https://junit.org/junit5/docs/current/user-guide/#extensions

@drseb
Copy link
Member

drseb commented Jan 24, 2019

No. Never heard of this. Would this work for different programming languages? The linked user guide seems pretty java-specific

@julesjacobsen
Copy link
Author

julesjacobsen commented Jan 24, 2019

No, it's just a JVM-based solution. But whatever python people use will need to have a separate implementation. Still - we only need these two.

The cool thing would be that in my code I'd be able to write a JUnit unit test like this:

@ExtendWith(PhenoUnitExtension.class)
@Test
void testIC(@TestSetDefinition IcTest[] icTests) {
    // ...
}

@drseb
Copy link
Member

drseb commented Jan 24, 2019

Not sure we're on the same page here. If we want this to be really independent of any programming language (there are also R-implementations), I feel that it makes a lot of sense to choose a human readable standard format, that is "easy" to process in all languages. I am no expert in python, but maybe something like this what you showed is also possible. Not sure. That's why I said that I need more input.

@julesjacobsen
Copy link
Author

julesjacobsen commented Jan 24, 2019

The tests can all be defined in yaml as you have already, but you need a language binding to expose that nicely for people to incorporate into their code in as native a way as possible. You've gone part-way with this solution already, this is a way to hook this into people's actual code.

The PhenoUnitTestingProvider.class you have would be the extension.

@julesjacobsen
Copy link
Author

Also pytest supports extensions of some sort. Essentially the language-specific testing framework needs to collect all the test cases defined here in yaml and make them programmatically available to the code running the tests.

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